Skip to contentSkip to conversation

watchdog - v2.6.38-rc8

GIT PULL Wim Van Sebroeck 1 participant 1 message Mar 14, 2011

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

Hi Linus,

Please pull from 'master' branch of
git://git.kernel.org/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog.git
or if master.kernel.org hasn't synced up yet:
master.kernel.org:/pub/scm/linux/kernel/git/wim/linux-2.6-watchdog.git

This will update the following files:

 drivers/watchdog/cpwd.c         |    2 +-
 drivers/watchdog/hpwdt.c        |    4 ++--
 drivers/watchdog/sch311x_wdt.c  |    2 +-
 drivers/watchdog/w83697ug_wdt.c |    2 +-
 4 files changed, 5 insertions(+), 5 deletions(-)

with these Changes:

Author: Axel Lin <[email protected]>
Date:   Wed Mar 2 11:49:44 2011 +0800

watchdog: hpwdt: eliminate section mismatch warning

hpwdt_init_nmi_decoding() is called in hpwdt_init_one error handling, thus remove the __devexit annotation of hpwdt_exit_nmi_decoding().

This patch fixes below warning:

WARNING: drivers/watchdog/hpwdt.o(.devinit.text+0x36f): Section mismatch in reference from the function hpwdt_init_one() to the function .devexit.text:hpwdt_exit_nmi_decoding() The function __devinit hpwdt_init_one() references
a function __devexit hpwdt_exit_nmi_decoding().
This is often seen when error handling in the init function
uses functionality in the exit path.
The fix is often to remove the __devexit annotation of
hpwdt_exit_nmi_decoding() so it may be used outside an exit section.

Author: Wim Van Sebroeck <[email protected]>
Date:   Mon Feb 21 19:28:58 2011 +0000

watchdog: w83697ug_wdt: Fix set bit 0 to activate GPIO2

outb_p(c || 0x01, WDT_EFDR); -> || should be |

Author: Dan Carpenter <[email protected]>
Date:   Wed Feb 23 23:26:01 2011 +0300

watchdog: sch311x_wdt: fix printk condition

"==" has higher precedence than "&". Since
if (sch311x_sio_inb(sio_config_port, 0x30) & (0x01 == 0)) is always false the message is never printed.

Author: Wim Van Sebroeck <[email protected]>
Date:   Mon Feb 21 19:09:40 2011 +0000

watchdog: sch311x_wdt: Fix LDN active check

if (sch311x_sio_inb(sio_config_port, 0x30) && 0x01 == 0) -> && should be &

Author: Wim Van Sebroeck <[email protected]>
Date:   Mon Feb 21 10:52:43 2011 +0000

watchdog: cpwd: Fix buffer-overflow

cppcheck-1.47 reports:
[drivers/watchdog/cpwd.c:650]: (error) Buffer access out-of-bounds: p.devs

The source code is
for (i = 0; i < 4; i++) {
misc_deregister(&p->devs[i].misc);

where devs is defined as WD_NUMDEVS big and WD_NUMDEVS is equal to 3. So the 4 should be a 3 or WD_NUMDEVS.

Reported-By David Binderman

The Changes can also be looked at on:

	http://www.kernel.org/git/?p=linux/kernel/git/wim/linux-2.6-watchdog.git;a=summary

For completeness, I added the overal diff below.

Greetings,
Wim.

================================================================================

drivers/watchdog/cpwd.c +1 -1
index eca855a..3de4ba0 100644
@@ -646,7 +646,7 @@ static int __devexit cpwd_remove(struct platform_device *op)
 	struct cpwd *p = dev_get_drvdata(&op->dev);
 	int i;
 
-	for (i = 0; i < 4; i++) {
+	for (i = 0; i < WD_NUMDEVS; i++) {
 		misc_deregister(&p->devs[i].misc);
 
 		if (!p->enabled) {
drivers/watchdog/hpwdt.c +2 -2
index 24b966d..204a560 100644
@@ -710,7 +710,7 @@ static int __devinit hpwdt_init_nmi_decoding(struct pci_dev *dev)
 	return 0;
 }
 
-static void __devexit hpwdt_exit_nmi_decoding(void)
+static void hpwdt_exit_nmi_decoding(void)
 {
 	unregister_die_notifier(&die_notifier);
 	if (cru_rom_addr)
@@ -726,7 +726,7 @@ static int __devinit hpwdt_init_nmi_decoding(struct pci_dev *dev)
 	return 0;
 }
 
-static void __devexit hpwdt_exit_nmi_decoding(void)
+static void hpwdt_exit_nmi_decoding(void)
 {
 }
 #endif /* CONFIG_HPWDT_NMI_DECODING */
drivers/watchdog/sch311x_wdt.c +1 -1
index 0461858..b61ab1c 100644
@@ -508,7 +508,7 @@ static int __init sch311x_detect(int sio_config_port, unsigned short *addr)
 	sch311x_sio_outb(sio_config_port, 0x07, 0x0a);
 
 	/* Check if Logical Device Register is currently active */
-	if (sch311x_sio_inb(sio_config_port, 0x30) && 0x01 == 0)
+	if ((sch311x_sio_inb(sio_config_port, 0x30) & 0x01) == 0)
 		printk(KERN_INFO PFX "Seems that LDN 0x0a is not active...\n");
 
 	/* Get the base address of the runtime registers */
drivers/watchdog/w83697ug_wdt.c +1 -1
index a6c12de..df2a64d 100644
@@ -109,7 +109,7 @@ static int w83697ug_select_wd_register(void)
 	outb_p(0x08, WDT_EFDR); /* select logical device 8 (GPIO2) */
 	outb_p(0x30, WDT_EFER); /* select CR30 */
 	c = inb_p(WDT_EFDR);
-	outb_p(c || 0x01, WDT_EFDR); /* set bit 0 to activate GPIO2 */
+	outb_p(c | 0x01, WDT_EFDR); /* set bit 0 to activate GPIO2 */
 
 	return 0;
 }