* [lm-sensors] [PATCH 3/4] libsensors4: Fix corner case bug in
@ 2007-08-17 15:21 Jean Delvare
2007-08-17 19:46 ` Hans de Goede
0 siblings, 1 reply; 2+ messages in thread
From: Jean Delvare @ 2007-08-17 15:21 UTC (permalink / raw)
To: lm-sensors
Contrary to what the comment says, sensors_proc_bus_count may be a
perfectly valid bus number. We need to use a different value for
chip configuration entries we want to ignore.
---
lib/data.c | 8 ++++----
lib/sensors.h | 1 +
2 files changed, 5 insertions(+), 4 deletions(-)
--- lm-sensors-3.orig/lib/data.c 2007-08-17 10:53:33.000000000 +0200
+++ lm-sensors-3/lib/data.c 2007-08-17 10:57:46.000000000 +0200
@@ -192,7 +192,7 @@ int sensors_substitute_chip(sensors_chip
if (i = sensors_config_busses_count) {
sensors_parse_error("Undeclared bus id referenced", lineno);
- name->bus.nr = sensors_proc_bus_count;
+ name->bus.nr = SENSORS_BUS_NR_IGNORE;
return -SENSORS_ERR_BUS_NAME;
}
@@ -205,9 +205,9 @@ int sensors_substitute_chip(sensors_chip
}
}
- /* We did not find anything. sensors_proc_bus_count is not
- a valid bus number, so it will never be matched. Good. */
- name->bus.nr = sensors_proc_bus_count;
+ /* We did not find a matching bus name, simply ignore this chip
+ config entry. */
+ name->bus.nr = SENSORS_BUS_NR_IGNORE;
return 0;
}
--- lm-sensors-3.orig/lib/sensors.h 2007-08-17 09:24:35.000000000 +0200
+++ lm-sensors-3/lib/sensors.h 2007-08-17 10:57:46.000000000 +0200
@@ -34,6 +34,7 @@
#define SENSORS_BUS_TYPE_ISA 1
#define SENSORS_BUS_TYPE_PCI 2
#define SENSORS_BUS_NR_ANY (-1)
+#define SENSORS_BUS_NR_IGNORE (-2)
#ifdef __cplusplus
extern "C" {
--
Jean Delvare
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [lm-sensors] [PATCH 3/4] libsensors4: Fix corner case bug in
2007-08-17 15:21 [lm-sensors] [PATCH 3/4] libsensors4: Fix corner case bug in Jean Delvare
@ 2007-08-17 19:46 ` Hans de Goede
0 siblings, 0 replies; 2+ messages in thread
From: Hans de Goede @ 2007-08-17 19:46 UTC (permalink / raw)
To: lm-sensors
Jean Delvare wrote:
> Contrary to what the comment says, sensors_proc_bus_count may be a
> perfectly valid bus number. We need to use a different value for
> chip configuration entries we want to ignore.
>
Looks good to me, can you commit these to svn before the end of the weekend,
monday I'll be back at work and there I have several machines to test with, so
if you can get all your changes into svn before monday then I can give svn a
good testing with various setups @ work.
Regards,
Hans
> ---
> lib/data.c | 8 ++++----
> lib/sensors.h | 1 +
> 2 files changed, 5 insertions(+), 4 deletions(-)
>
> --- lm-sensors-3.orig/lib/data.c 2007-08-17 10:53:33.000000000 +0200
> +++ lm-sensors-3/lib/data.c 2007-08-17 10:57:46.000000000 +0200
> @@ -192,7 +192,7 @@ int sensors_substitute_chip(sensors_chip
>
> if (i = sensors_config_busses_count) {
> sensors_parse_error("Undeclared bus id referenced", lineno);
> - name->bus.nr = sensors_proc_bus_count;
> + name->bus.nr = SENSORS_BUS_NR_IGNORE;
> return -SENSORS_ERR_BUS_NAME;
> }
>
> @@ -205,9 +205,9 @@ int sensors_substitute_chip(sensors_chip
> }
> }
>
> - /* We did not find anything. sensors_proc_bus_count is not
> - a valid bus number, so it will never be matched. Good. */
> - name->bus.nr = sensors_proc_bus_count;
> + /* We did not find a matching bus name, simply ignore this chip
> + config entry. */
> + name->bus.nr = SENSORS_BUS_NR_IGNORE;
> return 0;
> }
>
> --- lm-sensors-3.orig/lib/sensors.h 2007-08-17 09:24:35.000000000 +0200
> +++ lm-sensors-3/lib/sensors.h 2007-08-17 10:57:46.000000000 +0200
> @@ -34,6 +34,7 @@
> #define SENSORS_BUS_TYPE_ISA 1
> #define SENSORS_BUS_TYPE_PCI 2
> #define SENSORS_BUS_NR_ANY (-1)
> +#define SENSORS_BUS_NR_IGNORE (-2)
>
> #ifdef __cplusplus
> extern "C" {
>
>
_______________________________________________
lm-sensors mailing list
lm-sensors@lm-sensors.org
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2007-08-17 19:46 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-17 15:21 [lm-sensors] [PATCH 3/4] libsensors4: Fix corner case bug in Jean Delvare
2007-08-17 19:46 ` Hans de Goede
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.