public inbox for kernel-janitors@vger.kernel.org
 help / color / mirror / Atom feed
* [patch] watchdog: sch311x_wdt: fix printk condition
@ 2011-02-23 20:26 Dan Carpenter
  2011-02-23 20:59 ` Wim Van Sebroeck
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2011-02-23 20:26 UTC (permalink / raw)
  To: Wim Van Sebroeck; +Cc: linux-watchdog, kernel-janitors

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

Signed-off-by: Dan Carpenter <error27@gmail.com>
---
Btw, is this printk() even worth printing?

diff --git a/drivers/watchdog/sch311x_wdt.c b/drivers/watchdog/sch311x_wdt.c
index 7b687e9..b61ab1c 100644
--- a/drivers/watchdog/sch311x_wdt.c
+++ b/drivers/watchdog/sch311x_wdt.c
@@ -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 */

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-02-23 20:59 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-23 20:26 [patch] watchdog: sch311x_wdt: fix printk condition Dan Carpenter
2011-02-23 20:59 ` Wim Van Sebroeck

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox