2
0
mirror of https://github.com/lm-sensors/lm-sensors synced 2025-08-30 13:57:41 +00:00

libsensors no longer returns ignored features so no need to check for

this in applications anymore.


git-svn-id: http://lm-sensors.org/svn/lm-sensors/branches/lm-sensors-3.0.0@4709 7894878c-1315-0410-8ee3-d5d059ff63e0
This commit is contained in:
Jean Delvare
2007-08-26 11:45:46 +00:00
parent 252c5faf86
commit 7268001a5d
3 changed files with 5 additions and 31 deletions

View File

@@ -155,17 +155,14 @@ applyToFeatures
int labelNumber = feature->dataNumbers[0];
const char *rawLabel = NULL;
char *label = NULL;
int valid = 0;
if (getValid (chip, labelNumber, &valid)) {
sensorLog (LOG_ERR, "Error getting sensor validity: %s/#%d", chip->prefix, labelNumber);
ret = -1;
} else if (getRawLabel (chip, labelNumber, &rawLabel)) {
if (getRawLabel (chip, labelNumber, &rawLabel)) {
sensorLog (LOG_ERR, "Error getting raw sensor label: %s/#%d", chip->prefix, labelNumber);
ret = -1;
} else if (!(label = sensors_get_label (chip, labelNumber))) {
sensorLog (LOG_ERR, "Error getting sensor label: %s/#%d", chip->prefix, labelNumber);
ret = -1;
} else if (valid) {
} else {
rrdCheckLabel (rawLabel, num);
ret = fn (data, rrdLabels[num], label, feature);
++ num;

View File

@@ -33,18 +33,6 @@
#define DO_SET 2
#define DO_RRD 3
int
getValid
(const sensors_chip_name *name, int feature, int *valid) {
int err;
err = sensors_get_ignored (name, feature);
if (err >= 0) {
*valid = err;
err = 0;
}
return err;
}
int
getRawLabel
(const sensors_chip_name *name, int feature, const char **label) {
@@ -95,17 +83,11 @@ readUnknownChip
while ((ret == 0) && ((sensor = sensors_get_all_features (chip, &index0, &index1)) != NULL)) {
char *label = NULL;
int valid = 0;
double value;
if (getValid (chip, sensor->number, &valid)) {
sensorLog (LOG_ERR, "Error getting sensor validity: %s/%s", chip->prefix, sensor->name);
ret = 20;
} else if (!(label = sensors_get_label (chip, sensor->number))) {
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 (!valid) {
/* skip invalid */
} else if (!(sensor->mode & SENSORS_MODE_R)) {
sensorLog (LOG_INFO, "%s: %s", sensor->name, label);
} else if ((ret = sensors_get_value (chip, sensor->number, &value))) {
@@ -154,17 +136,13 @@ doKnownChip
int alarm = alarms & feature->alarmMask;
int beep = beeps & feature->beepMask;
char *label = NULL;
int valid = 0;
if ((action == DO_SCAN) && !alarm) {
continue;
} else if (getValid (chip, labelNumber, &valid)) {
sensorLog (LOG_ERR, "Error getting sensor validity: %s/#%d", chip->prefix, labelNumber);
ret = 22;
} else if (!(label = sensors_get_label (chip, labelNumber))) {
sensorLog (LOG_ERR, "Error getting sensor label: %s/#%d", chip->prefix, labelNumber);
ret = 22;
} else if (valid) {
} else {
double values[MAX_DATA];
for (subindex = 0; !ret && (feature->dataNumbers[subindex] >= 0); ++ subindex) {

View File

@@ -58,7 +58,6 @@ extern int unloadLib (void);
/* from sense.c */
extern int getValid (const sensors_chip_name *name, int feature, int *valid);
extern int getRawLabel (const sensors_chip_name *name, int feature, const char **label);
extern int readChips (void);