Skip to contentSkip to conversation

watchdog: sch56xx-common: set correct bits in register()

PATCH New Dan Carpenter 2 participants 2 messages May 24, 2012

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 watchdog: sch56xx-common: set correct bits in register()

WDOG_NO_WAY_OUT (3) and WDOG_ACTIVE (0) are the bit numbers, not a mask. So "data->wddev.status |= WDOG_ACTIVE;" was intended to set bit zero but it is a no-op.

drivers/hwmon/sch56xx-common.c +2 -2
index 839087c..4380f5d 100644
@@ -464,9 +464,9 @@ struct sch56xx_watchdog_data *sch56xx_watchdog_register(struct device *parent,
 	data->wddev.min_timeout = 1;
 	data->wddev.max_timeout = 255 * 60;
 	if (nowayout)
-		data->wddev.status |= WDOG_NO_WAY_OUT;
+		set_bit(WDOG_NO_WAY_OUT, &data->wddev.status);
 	if (output_enable & SCH56XX_WDOG_OUTPUT_ENABLE)
-		data->wddev.status |= WDOG_ACTIVE;
+		set_bit(WDOG_ACTIVE, &data->wddev.status);
 
 	/* Since the watchdog uses a downcounter there is no register to read
 	   the BIOS set timeout from (if any was set at all) ->
#1 lore raw

PATCH 1/1 watchdog: sch56xx-common: set correct bits in register()

Hi,

Thanks for the patch! Since the rest of the watchdog related sch56xx-common patches, which introduce this problem in the first place, are going into 3.5 through the watchdog tree, this patch should probably go in through that tree too -> forwarding this to linux-watchdog.

Also:

Regards,

Hans

-------- Original Message --------
Subject: [lm-sensors] [patch] watchdog: sch56xx-common: set correct bits in register()
Date: Thu, 24 May 2012 18:58:02 +0300
From: Dan Carpenter <[email protected]>
To: Jean Delvare <[email protected]>
CC: [email protected], [email protected]

WDOG_NO_WAY_OUT (3) and WDOG_ACTIVE (0) are the bit numbers, not a mask. So "data->wddev.status |= WDOG_ACTIVE;" was intended to set bit zero but it is a no-op.

drivers/hwmon/sch56xx-common.c +2 -2
index 839087c..4380f5d 100644
@@ -464,9 +464,9 @@ struct sch56xx_watchdog_data *sch56xx_watchdog_register(struct device *parent,
 	data->wddev.min_timeout = 1;
 	data->wddev.max_timeout = 255 * 60;
 	if (nowayout)
-		data->wddev.status |= WDOG_NO_WAY_OUT;
+		set_bit(WDOG_NO_WAY_OUT, &data->wddev.status);
 	if (output_enable & SCH56XX_WDOG_OUTPUT_ENABLE)
-		data->wddev.status |= WDOG_ACTIVE;
+		set_bit(WDOG_ACTIVE, &data->wddev.status);
 
 	/* Since the watchdog uses a downcounter there is no register to read
 	   the BIOS set timeout from (if any was set at all) ->

_______________________________________________
lm-sensors mailing list
[email protected]
http://lists.lm-sensors.org/mailman/listinfo/lm-sensors