public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Martin Schwidefsky <schwidefsky@de.ibm.com>
To: Josef Sipek <jsipek@fsl.cs.sunysb.edu>
Cc: linux-kernel@vger.kernel.org, cornelia.huck@de.ibm.com
Subject: Re: [S390] cio: Make ccw_dev_id_is_equal() more robust.
Date: Mon, 04 Dec 2006 16:30:18 +0100	[thread overview]
Message-ID: <1165246218.8364.3.camel@localhost> (raw)
In-Reply-To: <20061204152348.GA30961@filer.fsl.cs.sunysb.edu>

On Mon, 2006-12-04 at 10:23 -0500, Josef Sipek wrote:
> > diff -urpN linux-2.6/include/asm-s390/cio.h linux-2.6-patched/include/asm-s390/cio.h
> > --- linux-2.6/include/asm-s390/cio.h	2006-12-04 14:50:48.000000000 +0100
> > +++ linux-2.6-patched/include/asm-s390/cio.h	2006-12-04 14:51:00.000000000 +0100
> > @@ -278,7 +278,10 @@ struct ccw_dev_id {
> >  static inline int ccw_dev_id_is_equal(struct ccw_dev_id *dev_id1,
> >  				      struct ccw_dev_id *dev_id2)
> >  {
> > -	return !memcmp(dev_id1, dev_id2, sizeof(struct ccw_dev_id));
> > +	if ((dev_id1->ssid == dev_id2->ssid) &&
> > +	    (dev_id1->devno == dev_id2->devno))
> > +		return 1;
> > +	return 0;
> >  }
> 
> Why not just:
> 
> return ((dev_id1->ssid == ......) && (...));

Yes, why not. It would be a little bit shorter. The compiler probably
won't care and generate the same code..

-- 
blue skies,
  Martin.

Martin Schwidefsky
Linux for zSeries Development & Services
IBM Deutschland Entwicklung GmbH

"Reality continues to ruin my life." - Calvin.



      reply	other threads:[~2006-12-04 15:30 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-12-04 14:56 [S390] cio: Make ccw_dev_id_is_equal() more robust Martin Schwidefsky
2006-12-04 15:23 ` Josef Sipek
2006-12-04 15:30   ` Martin Schwidefsky [this message]

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=1165246218.8364.3.camel@localhost \
    --to=schwidefsky@de.ibm.com \
    --cc=cornelia.huck@de.ibm.com \
    --cc=jsipek@fsl.cs.sunysb.edu \
    --cc=linux-kernel@vger.kernel.org \
    /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