From 78a521b1a83a66d066f75c93c7315038ae141234 Mon Sep 17 00:00:00 2001 From: Hans de Goede Date: Mon, 9 Apr 2007 14:52:28 +0000 Subject: [PATCH] Some fixes for problems with the dyn chip support / generic printing routines which showed up while testing with the abituguru driver git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4364 7894878c-1315-0410-8ee3-d5d059ff63e0 --- lib/access.c | 6 ++++++ prog/sensors/chips_generic.c | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/lib/access.c b/lib/access.c index a0ca6175..57fe0784 100644 --- a/lib/access.c +++ b/lib/access.c @@ -535,9 +535,15 @@ sensors_feature_type sensors_feature_get_type( if (strlen(name) == 3 || strstr(name, "input")) return SENSORS_FEATURE_IN; + if (strstr(name, "max_alarm")) + return SENSORS_FEATURE_IN_MAX_ALARM; + if (strstr(name, "max")) return SENSORS_FEATURE_IN_MAX; + if (strstr(name, "min_alarm")) + return SENSORS_FEATURE_IN_MIN_ALARM; + if (strstr(name, "min")) return SENSORS_FEATURE_IN_MIN; diff --git a/prog/sensors/chips_generic.c b/prog/sensors/chips_generic.c index 4b4f5101..f3287833 100644 --- a/prog/sensors/chips_generic.c +++ b/prog/sensors/chips_generic.c @@ -95,7 +95,7 @@ static void print_generic_chip_temp(const sensors_chip_name *name, char *label; int valid, type; const int size = SENSORS_FEATURE_TEMP_CRIT - SENSORS_FEATURE_TEMP; - short has_features[SENSORS_FEATURE_TEMP_CRIT - SENSORS_FEATURE_TEMP] = {0, }; + short has_features[SENSORS_FEATURE_TEMP_CRIT - SENSORS_FEATURE_TEMP] = {0, 0, 0, 0, 0, 0, 0, 0, 0 }; double feature_vals[SENSORS_FEATURE_TEMP_CRIT - SENSORS_FEATURE_TEMP] = {0.0, }; if (sensors_get_label_and_valid(*name, feature->number, &label, &valid)) { @@ -224,7 +224,7 @@ static void print_generic_chip_in(const sensors_chip_name *name, { const int size = SENSORS_FEATURE_IN_MAX_ALARM - SENSORS_FEATURE_IN; int valid; - short has_features[SENSORS_FEATURE_IN_MAX_ALARM - SENSORS_FEATURE_IN] = {0, }; + short has_features[SENSORS_FEATURE_IN_MAX_ALARM - SENSORS_FEATURE_IN] = {0, 0, 0, 0, 0 }; double feature_vals[SENSORS_FEATURE_IN_MAX_ALARM - SENSORS_FEATURE_IN] = {0.0, }; double val, alarm_max, alarm_min; char *label;