mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ricardo Martins <ricardo@scarybox.net>
To: Alexey Dobriyan <adobriyan@gmail.com>
Cc: julia@diku.dk, linux-kernel@vger.kernel.org,
	kernel-janitors@vger.kernel.org, perex@perex.cz
Subject: Re: [PATCH 1/4] sound/isa: use unsigned for loop index
Date: Sun, 11 May 2008 17:08:32 +0100	[thread overview]
Message-ID: <20080511160832.GA4709@macbookpro> (raw)
In-Reply-To: <20080511164335.GA19745@martell.zuzino.mipt.ru>

[-- Attachment #1: Type: text/plain, Size: 1062 bytes --]

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@scarybox.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

[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]

  reply	other threads:[~2008-05-11 16:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-05-11 12:50 Julia Lawall
2008-05-11 16:43 ` Alexey Dobriyan
2008-05-11 16:08   ` Ricardo Martins [this message]
2008-05-11 17:22     ` Alexey Dobriyan

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=20080511160832.GA4709@macbookpro \
    --to=ricardo@scarybox.net \
    --cc=adobriyan@gmail.com \
    --cc=julia@diku.dk \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=perex@perex.cz \
    /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

all inboxes | Powered by JetHome®