Patchwork ATM: misplaced parentheses?

login
register
mail settings
Submitter roel kluin
Date Feb. 17, 2009, 9:59 a.m.
Message ID <499A8A88.2070300@gmail.com>
Download mbox | patch
Permalink /patch/23245/
State Accepted
Delegated to: David Miller
Headers show

Comments

roel kluin - Feb. 17, 2009, 9:59 a.m.
Al Viro wrote:

> while you technically only need parens around ?:, in this case it's
> better to keep it fully parenthesised - more readable that way.
> 
> The lack of parens around ?: in the current tree is an obvious bug.

Ok, with extra for clarity:

-------------------------->8------------------8<---------------------------
Add missing parentheses

Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
---
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
David Miller - Feb. 19, 2009, 1:41 a.m.
From: Roel Kluin <roel.kluin@gmail.com>
Date: Tue, 17 Feb 2009 10:59:36 +0100

> Add missing parentheses
> 
> Signed-off-by: Roel Kluin <roel.kluin@gmail.com>

Applied.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/drivers/atm/lanai.c b/drivers/atm/lanai.c
index 144a49f..8733a2e 100644
--- a/drivers/atm/lanai.c
+++ b/drivers/atm/lanai.c
@@ -901,7 +901,7 @@  static int __devinit eeprom_read(struct lanai_dev *lanai)
 		clock_l(); udelay(5);
 		for (i = 128; i != 0; i >>= 1) {   /* write command out */
 			tmp = (lanai->conf1 & ~CONFIG1_PROMDATA) |
-			    (data & i) ? CONFIG1_PROMDATA : 0;
+			    ((data & i) ? CONFIG1_PROMDATA : 0);
 			if (lanai->conf1 != tmp) {
 				set_config1(tmp);
 				udelay(5);	/* Let new data settle */