* drivers/net/tokenring/smctr.c: logical-bitwise or confusion?
@ 2008-03-09 21:43 Roel Kluin
2008-03-10 0:09 ` Paul Gortmaker
0 siblings, 1 reply; 4+ messages in thread
From: Roel Kluin @ 2008-03-09 21:43 UTC (permalink / raw)
To: jschlst, p_gortmaker; +Cc: netdev
drivers/net/tokenring/smctr.c:3416
tsv->svv[0] = ((tx_fstatus & 0x0100 >> 6) || IBM_PASS_SOURCE_ADDR);
shouldn't this be a bit-wise or?
from drivers/net/tokenring/smctr.h:50:
#define IBM_PASS_SOURCE_ADDR 0x01
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: drivers/net/tokenring/smctr.c: logical-bitwise or confusion?
2008-03-09 21:43 drivers/net/tokenring/smctr.c: logical-bitwise or confusion? Roel Kluin
@ 2008-03-10 0:09 ` Paul Gortmaker
2008-03-10 1:16 ` Roel Kluin
0 siblings, 1 reply; 4+ messages in thread
From: Paul Gortmaker @ 2008-03-10 0:09 UTC (permalink / raw)
To: Roel Kluin, jschlst; +Cc: netdev
--- Roel Kluin <12o3l@tiscali.nl> wrote:
> drivers/net/tokenring/smctr.c:3416
>
> tsv->svv[0] = ((tx_fstatus & 0x0100 >> 6) || IBM_PASS_SOURCE_ADDR);
>
> shouldn't this be a bit-wise or?
> from drivers/net/tokenring/smctr.h:50:
>
> #define IBM_PASS_SOURCE_ADDR 0x01
Probably a safe bet that is what they meant to have. Since
as it stands, gcc will (correctly) optimize that into:
tsv->svv[0]= 1;
which probably isn't particularly useful.
Paul.
Connect with friends from any web browser - no download required. Try the new Yahoo! Canada Messenger for the Web BETA at http://ca.messenger.yahoo.com/webmessengerpromo.php
^ permalink raw reply [flat|nested] 4+ messages in thread* Re: drivers/net/tokenring/smctr.c: logical-bitwise or confusion?
2008-03-10 0:09 ` Paul Gortmaker
@ 2008-03-10 1:16 ` Roel Kluin
2008-03-10 1:27 ` Joe Perches
0 siblings, 1 reply; 4+ messages in thread
From: Roel Kluin @ 2008-03-10 1:16 UTC (permalink / raw)
To: Paul Gortmaker; +Cc: jschlst, netdev
Paul Gortmaker wrote:
> --- Roel Kluin <12o3l@tiscali.nl> wrote:
>
>> drivers/net/tokenring/smctr.c:3416
>>
>> tsv->svv[0] = ((tx_fstatus & 0x0100 >> 6) || IBM_PASS_SOURCE_ADDR);
>>
>> shouldn't this be a bit-wise or?
>> from drivers/net/tokenring/smctr.h:50:
>>
>> #define IBM_PASS_SOURCE_ADDR 0x01
>
> Probably a safe bet that is what they meant to have. Since
> as it stands, gcc will (correctly) optimize that into:
>
> tsv->svv[0]= 1;
>
> which probably isn't particularly useful.
>
> Paul.
That was what I was thinking as well.
---
logical-bitwise | confusion
Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
---
diff --git a/drivers/net/tokenring/smctr.c b/drivers/net/tokenring/smctr.c
index 8909050..8ae5837 100644
--- a/drivers/net/tokenring/smctr.c
+++ b/drivers/net/tokenring/smctr.c
@@ -3413,7 +3413,7 @@ static int smctr_make_tx_status_code(struct net_device *dev,
tsv->svi = TRANSMIT_STATUS_CODE;
tsv->svl = S_TRANSMIT_STATUS_CODE;
- tsv->svv[0] = ((tx_fstatus & 0x0100 >> 6) || IBM_PASS_SOURCE_ADDR);
+ tsv->svv[0] = ((tx_fstatus & 0x0100 >> 6) | IBM_PASS_SOURCE_ADDR);
/* Stripped frame status of Transmitted Frame */
tsv->svv[1] = tx_fstatus & 0xff;
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: drivers/net/tokenring/smctr.c: logical-bitwise or confusion?
2008-03-10 1:16 ` Roel Kluin
@ 2008-03-10 1:27 ` Joe Perches
0 siblings, 0 replies; 4+ messages in thread
From: Joe Perches @ 2008-03-10 1:27 UTC (permalink / raw)
To: Roel Kluin, Alan Cox; +Cc: Paul Gortmaker, jschlst, netdev, Alexey Dobriyan
On Mon, 2008-03-10 at 02:16 +0100, Roel Kluin wrote:
> diff --git a/drivers/net/tokenring/smctr.c b/drivers/net/tokenring/smctr.c
> index 8909050..8ae5837 100644
> --- a/drivers/net/tokenring/smctr.c
> +++ b/drivers/net/tokenring/smctr.c
> @@ -3413,7 +3413,7 @@ static int smctr_make_tx_status_code(struct net_device *dev,
> tsv->svi = TRANSMIT_STATUS_CODE;
> tsv->svl = S_TRANSMIT_STATUS_CODE;
>
> - tsv->svv[0] = ((tx_fstatus & 0x0100 >> 6) || IBM_PASS_SOURCE_ADDR);
> + tsv->svv[0] = ((tx_fstatus & 0x0100 >> 6) | IBM_PASS_SOURCE_ADDR);
>
> /* Stripped frame status of Transmitted Frame */
> tsv->svv[1] = tx_fstatus & 0xff;
This has been posted a few times over the last 6 months.
for instance:
http://www.ussg.iu.edu/hypermail/linux/kernel/0710.1/0887.html
Somebody please apply it.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2008-03-10 1:29 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-03-09 21:43 drivers/net/tokenring/smctr.c: logical-bitwise or confusion? Roel Kluin
2008-03-10 0:09 ` Paul Gortmaker
2008-03-10 1:16 ` Roel Kluin
2008-03-10 1:27 ` Joe Perches
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).