From: Andreas Dilger <adilger@clusterfs.com>
To: Zhenmin Li <zli4@cs.uiuc.edu>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [OPERA] Another potential error detected by static analysis tool (2.6.4)
Date: Fri, 7 May 2004 17:07:22 -0600 [thread overview]
Message-ID: <20040507230722.GH9641@schnapps.adilger.int> (raw)
In-Reply-To: <001101c43481$d49756d0$76f6ae80@Turandot>
On May 07, 2004 17:22 -0500, Zhenmin Li wrote:
> Version: 2.6.4
> Files:
> /arch/alpha/kernel/irq.c
>
> --- 539,547 ----
> #ifdef CONFIG_SMP
> if (i == 0) {
> seq_puts(p, " ");
> ! for (i = 0; i < NR_CPUS; i++)
> ! if (cpu_online(i))
> ! seq_printf(p, "CPU%d ", i);
> seq_putc(p, '\n');
> }
> #endif
>
>
> Maybe change to:
> *** 539,547 ****
> #ifdef CONFIG_SMP
> if (i == 0) {
> seq_puts(p, " ");
> ! for (j = 0; j < NR_CPUS; j++)
> ! if (cpu_online(j))
> ! seq_printf(p, "CPU%d ", j);
> seq_putc(p, '\n');
> }
> #endif
The real bug is that someone used "i" for something meaningful other than
a loop counter. In addition to your change, this should be fixed to call
that variable "irq" or something more useful ;-).
Cheers, Andreas
--
Andreas Dilger
http://sourceforge.net/projects/ext2resize/
http://www-mddsp.enel.ucalgary.ca/People/adilger/
prev parent reply other threads:[~2004-05-07 23:07 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-05-06 3:41 [OPERA] Potential bugs detected by static analysis tool in 2.6.4 Zhenmin Li
2004-05-06 9:43 ` Geert Uytterhoeven
2004-05-06 16:29 ` Brad Boyer
2004-05-06 16:44 ` Zhenmin Li
2004-05-06 20:22 ` Brad Boyer
2004-05-07 0:14 ` Luiz Fernando N. Capitulino
2004-05-07 22:22 ` [OPERA] Another potential error detected by static analysis tool (2.6.4) Zhenmin Li
2004-05-07 23:07 ` Andreas Dilger [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=20040507230722.GH9641@schnapps.adilger.int \
--to=adilger@clusterfs.com \
--cc=linux-kernel@vger.kernel.org \
--cc=zli4@cs.uiuc.edu \
/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