Skip to content

Commit

Permalink
genhd: overlapping variable definition
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
Stephen Hemminger authored and Jens Axboe committed Jan 11, 2010
1 parent ce28932 commit 7af92f8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions include/linux/genhd.h
Original file line number Diff line number Diff line change
Expand Up @@ -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; \
})

Expand Down

0 comments on commit 7af92f8

Please sign in to comment.