From 87efbc06c5bb5c4ee60bb0412f9726d3bf119c40 Mon Sep 17 00:00:00 2001 From: Jean Delvare Date: Wed, 5 Sep 2007 08:13:15 +0000 Subject: [PATCH] Rename sensors_feature_data.mode to flags, as we plan to use it to store non-mode flags soon. git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4757 7894878c-1315-0410-8ee3-d5d059ff63e0 --- lib/access.c | 4 ++-- lib/data.h | 2 +- lib/libsensors.3 | 4 ++-- lib/sensors.h | 4 ++-- lib/sysfs.c | 4 ++-- prog/sensord/sense.c | 2 +- prog/sensors/chips.c | 2 +- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/lib/access.c b/lib/access.c index af8167cb..c6644ca1 100644 --- a/lib/access.c +++ b/lib/access.c @@ -238,7 +238,7 @@ int sensors_get_value(const sensors_chip_name *name, int feature, alt_feature = sensors_lookup_feature_nr(name, main_feature->data.compute_mapping); - if (!(main_feature->data.mode & SENSORS_MODE_R)) + if (!(main_feature->data.flags & SENSORS_MODE_R)) return -SENSORS_ERR_ACCESS_R; for (chip = NULL; !expr && (chip = sensors_for_all_config_chips(name, chip));) @@ -285,7 +285,7 @@ int sensors_set_value(const sensors_chip_name *name, int feature, alt_feature = sensors_lookup_feature_nr(name, main_feature->data.compute_mapping); - if (!(main_feature->data.mode & SENSORS_MODE_W)) + if (!(main_feature->data.flags & SENSORS_MODE_W)) return -SENSORS_ERR_ACCESS_W; for (chip = NULL; !expr && (chip = sensors_for_all_config_chips(name, chip));) diff --git a/lib/data.h b/lib/data.h index 25818a6f..151c5ac3 100644 --- a/lib/data.h +++ b/lib/data.h @@ -132,7 +132,7 @@ typedef struct sensors_bus { compute_mapping is like logical_mapping, only it refers to another feature whose compute line will be inherited (a group could be fan and fan_max, but not fan_div) - mode is a bitfield, its value is a combination of SENSORS_MODE_R (readable) + flags is a bitfield, its value is a combination of SENSORS_MODE_R (readable) and SENSORS_MODE_W (writable). scaling is the number of decimal points to scale by. Divide the read value by 10**scaling to get the real value. */ diff --git a/lib/libsensors.3 b/lib/libsensors.3 index dcd9ef1c..5673b6d4 100644 --- a/lib/libsensors.3 +++ b/lib/libsensors.3 @@ -115,11 +115,11 @@ This structure is used when you want to get all features of a specific chip. .br int compute_mapping; .br - int mode; + unsigned int flags; .br } sensors_feature_data;\fP .br -The mode field is a bitfield, its value is a combination of +The flags field is a bitfield, its value is a combination of SENSORS_MODE_R (readable) and SENSORS_MODE_W (writable). \fBconst sensors_feature_data *sensors_get_all_features diff --git a/lib/sensors.h b/lib/sensors.h index b853687e..b6f55f5d 100644 --- a/lib/sensors.h +++ b/lib/sensors.h @@ -112,7 +112,7 @@ int sensors_do_chip_sets(const sensors_chip_name *name); const sensors_chip_name *sensors_get_detected_chips(const sensors_chip_name *match, int *nr); -/* These defines are used in the mode field of sensors_feature_data */ +/* These defines are used in the flags field of sensors_feature_data */ #define SENSORS_MODE_R 1 #define SENSORS_MODE_W 2 @@ -164,7 +164,7 @@ typedef struct sensors_feature_data { sensors_feature_type type; int mapping; int compute_mapping; - int mode; + unsigned int flags; } sensors_feature_data; /* This returns all features of a specific chip. They are returned in diff --git a/lib/sysfs.c b/lib/sysfs.c index e84e11ba..07ad7579 100644 --- a/lib/sysfs.c +++ b/lib/sysfs.c @@ -153,9 +153,9 @@ static int sensors_read_dynamic_chip(sensors_chip_features *chip, } if (attr->method & SYSFS_METHOD_SHOW) - feature.data.mode |= SENSORS_MODE_R; + feature.data.flags |= SENSORS_MODE_R; if (attr->method & SYSFS_METHOD_STORE) - feature.data.mode |= SENSORS_MODE_W; + feature.data.flags |= SENSORS_MODE_W; feature.scaling = get_type_scaling(type); diff --git a/prog/sensord/sense.c b/prog/sensord/sense.c index ddd8747a..2532723c 100644 --- a/prog/sensord/sense.c +++ b/prog/sensord/sense.c @@ -88,7 +88,7 @@ readUnknownChip if (!(label = sensors_get_label (chip, sensor->number))) { sensorLog (LOG_ERR, "Error getting sensor label: %s/%s", chip->prefix, sensor->name); ret = 21; - } else if (!(sensor->mode & SENSORS_MODE_R)) { + } else if (!(sensor->flags & SENSORS_MODE_R)) { sensorLog (LOG_INFO, "%s: %s", sensor->name, label); } else if ((ret = sensors_get_value (chip, sensor->number, &value))) { sensorLog (LOG_ERR, "Error getting sensor data: %s/%s: %s", chip->prefix, sensor->name, sensors_strerror (ret)); diff --git a/prog/sensors/chips.c b/prog/sensors/chips.c index ed710015..576cf1f2 100644 --- a/prog/sensors/chips.c +++ b/prog/sensors/chips.c @@ -41,7 +41,7 @@ void print_chip_raw(const sensors_chip_name *name) data->name); continue; } - if (data->mode & SENSORS_MODE_R) { + if (data->flags & SENSORS_MODE_R) { if (sensors_get_value(name, data->number, &val)) printf("ERROR: Can't get feature `%s' data!\n", data->name);