lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Mon, 04 Dec 2006 16:30:18 +0100
From:	Martin Schwidefsky <schwidefsky@...ibm.com>
To:	Josef Sipek <jsipek@....cs.sunysb.edu>
Cc:	linux-kernel@...r.kernel.org, cornelia.huck@...ibm.com
Subject: Re: [S390] cio: Make ccw_dev_id_is_equal() more robust.

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.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ