netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Roel Kluin <12o3l@tiscali.nl>
To: Paul Gortmaker <p_gortmaker@yahoo.com>
Cc: jschlst@samba.org, netdev@vger.kernel.org
Subject: Re: drivers/net/tokenring/smctr.c: logical-bitwise or confusion?
Date: Mon, 10 Mar 2008 02:16:31 +0100	[thread overview]
Message-ID: <47D48BEF.2070103@tiscali.nl> (raw)
In-Reply-To: <993737.45508.qm@web65610.mail.ac4.yahoo.com>

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;

  reply	other threads:[~2008-03-10  1:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2008-03-10  1:27     ` Joe Perches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=47D48BEF.2070103@tiscali.nl \
    --to=12o3l@tiscali.nl \
    --cc=jschlst@samba.org \
    --cc=netdev@vger.kernel.org \
    --cc=p_gortmaker@yahoo.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).