genhd: overlapping variable definition
authorStephen Hemminger <shemminger@vyatta.com>
Wed, 6 Jan 2010 23:45:55 +0000 (15:45 -0800)
committerJens Axboe <jens.axboe@oracle.com>
Mon, 11 Jan 2010 13:32:44 +0000 (14:32 +0100)
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>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
include/linux/genhd.h

index c6c0c41..9717081 100644 (file)
@@ -256,9 +256,9 @@ extern struct hd_struct *disk_map_sector_rcu(struct gendisk *disk,
 #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;                                                            \
 })