public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "J.A. Magallon" <jamagallon@able.es>
To: "Jörn Engel" <joern@wohnheim.fh-wedel.de>
Cc: Margit Schubert-While <margitsw@t-online.de>,
	linux-kernel@vger.kernel.org
Subject: Re: drivers/char/sysrq.c
Date: Fri, 30 May 2003 17:13:17 +0200	[thread overview]
Message-ID: <20030530151317.GA3973@werewolf.able.es> (raw)
In-Reply-To: <20030530145851.GA15640@wohnheim.fh-wedel.de>; from joern@wohnheim.fh-wedel.de on Fri, May 30, 2003 at 16:58:51 +0200


On 05.30, Jörn Engel wrote:
> On Fri, 30 May 2003 16:44:55 +0200, Margit Schubert-While wrote:
> > 
> > In drivers/char/sysrq.c (2.4 and 2.5) we have :
> > 
> >         if ((key >= '0') & (key <= '9')) {
> >                 retval = key - '0';
> >         } else if ((key >= 'a') & (key <= 'z')) {
> > 
> > Shouldn't the "&" be (pedantically) "&&" ?
> 
> It is semantically the same.  If you can show that gcc optimization
> also creates the same assembler code, few people will object to a
> patch.
> 

I see a diff:
- & is bitwise and you always perform the op
- && is logical and gcc must shortcut it

I think people use & 'cause they prefer the extra argument calculation
than the branch for the shortcut (AFAIR...)

or not ?

-- 
J.A. Magallon <jamagallon@able.es>      \                 Software is like sex:
werewolf.able.es                         \           It's better when it's free
Mandrake Linux release 9.2 (Cooker) for i586
Linux 2.4.21-rc6-jam1 (gcc 3.2.3 (Mandrake Linux 9.2 3.2.3-1mdk))

  reply	other threads:[~2003-05-30 15:00 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-30 14:44 drivers/char/sysrq.c Margit Schubert-While
2003-05-30 14:58 ` drivers/char/sysrq.c Jörn Engel
2003-05-30 15:13   ` J.A. Magallon [this message]
2003-05-30 18:01     ` drivers/char/sysrq.c Jörn Engel
2003-05-30 20:24     ` drivers/char/sysrq.c H. Peter Anvin
  -- strict thread matches above, loose matches on Subject: below --
2003-05-30 16:11 drivers/char/sysrq.c Margit Schubert-While
2003-05-31  3:18 ` drivers/char/sysrq.c Valdis.Kletnieks

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=20030530151317.GA3973@werewolf.able.es \
    --to=jamagallon@able.es \
    --cc=joern@wohnheim.fh-wedel.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=margitsw@t-online.de \
    /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