Skip to contentSkip to conversation

watchdog: sch311x_wdt: fix printk condition

PATCH In review Dan Carpenter 2 participants 2 messages Feb 23, 2011

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

PATCH 1/1 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.

---
Btw, is this printk() even worth printing?

drivers/watchdog/sch311x_wdt.c +1 -1
index 7b687e9..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 */
#1 lore raw

Hi Dan,

Quoted 7 lines

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

---
Btw, is this printk() even worth printing?

Patch will be added.
About the printk -> need to look into the data sheet for that... We might need to exit the driver or activate it or ...

Kind regards,
Wim.