From: Stephen Hemminger <shemminger@vyatta.com>
To: Jens Axboe <jens.axboe@oracle.com>,
Jerome Marchand <jmarchan@redhat.com>,
Theodore Ts'o <tytso@mit.edu>
Cc: Greg KH <gregkh@suse.de>, Andreas Dilger <adilger@sun.com>,
linux-ext4@vger.kernel.org
Subject: [PATCH] genhd: overlapping variable definition
Date: Wed, 6 Jan 2010 15:45:55 -0800 [thread overview]
Message-ID: <20100106154555.3dd77fe2@nehalam> (raw)
This fixes the sparse warning:
fs/ext4/super.c:2390:40: warning: symbol 'i' shadows an earlier one
fs/ext4/super.c:2368:22: originally declared here
Using 'i' in a macro is dubious practice.
Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
--- a/include/linux/genhd.h 2010-01-06 10:49:11.822315232 -0800
+++ b/include/linux/genhd.h 2010-01-06 10:50:02.272939396 -0800
@@ -256,9 +256,9 @@ extern struct hd_struct *disk_map_sector
#define part_stat_read(part, field) \
({ \
typeof((part)->dkstats->field) res = 0; \
- int i; \
- for_each_possible_cpu(i) \
- res += per_cpu_ptr((part)->dkstats, i)->field; \
+ unsigned int _cpu; \
+ for_each_possible_cpu(_cpu) \
+ res += per_cpu_ptr((part)->dkstats, _cpu)->field; \
res; \
})
next reply other threads:[~2010-01-06 23:46 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-06 23:45 Stephen Hemminger [this message]
2010-01-11 13:32 ` [PATCH] genhd: overlapping variable definition Jens Axboe
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=20100106154555.3dd77fe2@nehalam \
--to=shemminger@vyatta.com \
--cc=adilger@sun.com \
--cc=gregkh@suse.de \
--cc=jens.axboe@oracle.com \
--cc=jmarchan@redhat.com \
--cc=linux-ext4@vger.kernel.org \
--cc=tytso@mit.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;
as well as URLs for NNTP newsgroup(s).