lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <200902162202.n1GM2aI0009056@cmf.nrl.navy.mil>
Date:	Mon, 16 Feb 2009 17:02:36 -0500
From:	"Chas Williams (CONTRACTOR)" <chas@....nrl.navy.mil>
To:	Roel Kluin <roel.kluin@...il.com>
cc:	netdev@...r.kernel.org, Andrew Morton <akpm@...ux-foundation.org>
Subject: Re: [PATCH] ATM: misplaced parentheses?

that doesnt seem to make sense either.  the original code
is:

 		for (i = 128; i != 0; i >>= 1) {   /* write command out */
...
 			tmp = (lanai->conf1 & ~CONFIG1_PROMDATA) |
			    (data & i) ? CONFIG1_PROMDATA : 0;

since i is always positive here, you wouldnt need the ?: if your suggested
fix is the original intent.  it looks like setting CONFIG1_PROMDATA
means '1' and not setting it means '0' when writing the value of data
to the register.

In message <49983DB0.6040008@...il.com>,Roel Kluin writes:
>I think below is what was intended? otherwise we could as well have written:
>
>tmp = (lanai->conf1 & ~CONFIG1_PROMDATA) ||
>	(data & i) ? CONFIG1_PROMDATA : 0;
>
>Does this fix the parsing of the EEPROM?
>
>please review.
>-------------------------->8------------------8<---------------------------
>Fix misplaced parentheses
>
>Signed-off-by: Roel Kluin <roel.kluin@...il.com>
>---
>diff --git a/drivers/atm/lanai.c b/drivers/atm/lanai.c
>index 144a49f..317fb5a 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 */
>--
>To unsubscribe from this list: send the line "unsubscribe netdev" in
>the body of a message to majordomo@...r.kernel.org
>More majordomo info at  http://vger.kernel.org/majordomo-info.html
>
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ