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] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080511160832.GA4709@macbookpro>
Date:	Sun, 11 May 2008 17:08:32 +0100
From:	Ricardo Martins <ricardo@...rybox.net>
To:	Alexey Dobriyan <adobriyan@...il.com>
Cc:	julia@...u.dk, linux-kernel@...r.kernel.org,
	kernel-janitors@...r.kernel.org, perex@...ex.cz
Subject: Re: [PATCH 1/4] sound/isa: use unsigned for loop index

On Sun, 11 May 2008 20:43, Alexey Dobriyan wrote:
> On Sun, May 11, 2008 at 02:50:33PM +0200, Julia Lawall wrote:
> > A few more cases in the spirit of the patch "Trivial: Replacement of always
> > >0 ints with unsigned ints" submitted by Ricardo Martins <ricardo@...rybox.net>
> 
> And rationale for those would be ...?

Acccording to the kernel-janitors TODO [1], Jeff Garzik suggested the following:

  2) "unsigned int" is preferred to "int", it generates better asm code
  on all platforms except sh5. This replacement needs to be done manually,
  because often 'int' is required due to negative values -Exxx commonly
  passed as error values.

Since (most) loop counters such as "int i" are always either zero or a positive
number, they are perfect candidates for using unsigned int instead, imho.
It goes without saying, that each case must be considered separately in
case a negative value is indeed needed.

[1] http://kernelnewbies.org/KernelJanitors/Todo

Regards,
-- 
 Ricardo Martins  *  scarybox.net  *  GPG key: 0x1308F1B4

Content of type "application/pgp-signature" skipped

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ