From: "Michal Piotrowski" <michal.k.k.piotrowski@gmail.com>
To: "Joe Perches" <joe@perches.com>
Cc: linux-kernel@vger.kernel.org, torvalds@linux-foundation.org,
akpm@linux-foundation.org, "Mike Travis" <travis@sgi.com>
Subject: Re: [PATCH] trivial - convert "for(foo=0;foo<NR_CPUS;foo++)" to "for_each_possible_cpu(foo)"
Date: Tue, 28 Aug 2007 02:14:30 +0200 [thread overview]
Message-ID: <6bffcb0e0708271714m140d39f3pf89bdc3d97808578@mail.gmail.com> (raw)
In-Reply-To: <1188258887.18004.173.camel@localhost>
Hi Joe,
On 28/08/07, Joe Perches <joe@perches.com> wrote:
> Done via grep/sed and compile tested i386 with xen
>
> Changed the foo++ and ++foo forms
[snip]
> There are 3 more lines that could be modified:
>
> arch/powerpc/sysdev/mpic.c: for (i = 0; i < NR_CPUS; ++i, cpumask >>= 1)
for_each_possible_cpu(i) {
[..]
cpumask >>= 1;
}
> arch/sparc/kernel/smp.c: for (cpu = 0, num = 0; cpu < NR_CPUS; cpu++)
num = 0;
for_each_possible_cpu(cpu) {
[..]
}
> arch/sparc64/kernel/smp.c: for (i = 0; i < NR_CPUS; i++, ptr += size)
for_each_possible_cpu(i) {
[..]
ptr += size;
}
BTW1. There is a huge difference between pre and post incrementation -
have you checked all cases?
BTW2. Could you convert each i -> cpu?
Regards,
Michal
--
LOG
http://www.stardust.webpages.pl/log/
prev parent reply other threads:[~2007-08-28 0:14 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-08-27 23:54 Joe Perches
2007-08-28 0:12 ` Andrew Morton
2007-08-28 0:31 ` Joe Perches
2007-08-28 0:14 ` Michal Piotrowski [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=6bffcb0e0708271714m140d39f3pf89bdc3d97808578@mail.gmail.com \
--to=michal.k.k.piotrowski@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@linux-foundation.org \
--cc=travis@sgi.com \
/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®