[PATCH] block/genhd.c: fix sparse warning

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: H Hartley Sweeten
Date: Wednesday, April 15, 2009 - 6:53 pm

Fix sparse warning in block/genhd.c.

	warning: symbol '__mptr' shadows an earlier one

Signed-off-by: H Hartley Sweeten <hsweeten@visionengravers.com>

---

diff --git a/block/genhd.c b/block/genhd.c
index a9ec910..ca3eedb 100644
--- a/block/genhd.c
+++ b/block/genhd.c
@@ -576,8 +576,10 @@ struct gendisk *get_gendisk(dev_t devt, int
*partno)
 		struct kobject *kobj;
 
 		kobj = kobj_lookup(bdev_map, devt, partno);
-		if (kobj)
-			disk = dev_to_disk(kobj_to_dev(kobj));
+		if (kobj) {
+			struct device *dev = kobj_to_dev(kobj);
+			disk = dev_to_disk(dev);
+		}
 	} else {
 		struct hd_struct *part;
 
@@ -1010,7 +1012,7 @@ static int diskstats_show(struct seq_file *seqf,
void *v)
 				"wsect wuse running use aveq"
 				"\n\n");
 	*/
- 
+
 	disk_part_iter_init(&piter, gp, DISK_PITER_INCL_PART0);
 	while ((hd = disk_part_iter_next(&piter))) {
 		cpu = part_stat_lock();
@@ -1034,7 +1036,7 @@ static int diskstats_show(struct seq_file *seqf,
void *v)
 			);
 	}
 	disk_part_iter_exit(&piter);
- 
+
 	return 0;
 }
  
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] block/genhd.c: fix sparse warning, H Hartley Sweeten, (Wed Apr 15, 6:53 pm)
Re: [PATCH] block/genhd.c: fix sparse warning, Vegard Nossum, (Wed Apr 15, 9:46 pm)
Re: [PATCH] block/genhd.c: fix sparse warning, Al Viro, (Wed Apr 15, 10:42 pm)
Re: [PATCH] block/genhd.c: fix sparse warning, Vegard Nossum, (Thu Apr 16, 12:17 am)
RE: [PATCH] block/genhd.c: fix sparse warning, H Hartley Sweeten, (Thu Apr 16, 11:03 am)
Re: [PATCH] block/genhd.c: fix sparse warning, Al Viro, (Thu Apr 16, 11:33 am)