* [PATCH] genhd: overlapping variable definition
@ 2010-01-06 23:45 Stephen Hemminger
2010-01-11 13:32 ` Jens Axboe
0 siblings, 1 reply; 2+ messages in thread
From: Stephen Hemminger @ 2010-01-06 23:45 UTC (permalink / raw)
To: Jens Axboe, Jerome Marchand, Theodore Ts'o
Cc: Greg KH, Andreas Dilger, linux-ext4
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; \
})
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] genhd: overlapping variable definition
2010-01-06 23:45 [PATCH] genhd: overlapping variable definition Stephen Hemminger
@ 2010-01-11 13:32 ` Jens Axboe
0 siblings, 0 replies; 2+ messages in thread
From: Jens Axboe @ 2010-01-11 13:32 UTC (permalink / raw)
To: Stephen Hemminger
Cc: Jerome Marchand, Theodore Ts'o, Greg KH, Andreas Dilger,
linux-ext4
On Wed, Jan 06 2010, Stephen Hemminger wrote:
> 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.
Indeed, applied. Thanks!
--
Jens Axboe
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-01-11 13:32 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-01-06 23:45 [PATCH] genhd: overlapping variable definition Stephen Hemminger
2010-01-11 13:32 ` Jens Axboe
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).