drivers/net/tokenring/smctr.c: logical-bitwise or confusion?
Subsystems (2)
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
Quoted 8 lines · --- Roel Kluin
drivers/net/tokenring/smctr.c:3416tsv->svv[0] = ((
tx_fstatus&0x0100>> 6) ||IBM_PASS_SOURCE_ADDR);shouldn't this be a bit-wise or?
fromdrivers/net/tokenring/smctr.h:50:#define
IBM_PASS_SOURCE_ADDR0x01
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
Quoted 11 lines · Paul Gortmaker
Quoted 8 lines · --- Roel Kluin
drivers/net/tokenring/smctr.c:3416tsv->svv[0] = ((
tx_fstatus&0x0100>> 6) ||IBM_PASS_SOURCE_ADDR);shouldn't this be a bit-wise or?
fromdrivers/net/tokenring/smctr.h:50:#define
IBM_PASS_SOURCE_ADDR0x01
Quoted 8 lines
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
---
drivers/net/tokenring/smctr.c +1 -1
@@ -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 ;
drivers/net/tokenring/smctr.c static int smctr_make_tx_status_code(struct net_device *dev, · line 3419
Quoted 13 lines · Roel Kluin
drivers/net/tokenring/smctr.c +1
-1@@ -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.