mtd/drivers/mtd/devices block2mtd.c,1.11,1.12

joern at infradead.org joern at infradead.org
Wed Dec 22 08:10:25 EST 2004


Update of /home/cvs/mtd/drivers/mtd/devices
In directory phoenix.infradead.org:/home/joern/mtd/drivers/mtd/devices

Modified Files:
	block2mtd.c 
Log Message:
I hate casts.  This adds a line, but is much simpler to read.  Also
renames the function.



Index: block2mtd.c
===================================================================
RCS file: /home/cvs/mtd/drivers/mtd/devices/block2mtd.c,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -r1.11 -r1.12
--- block2mtd.c	22 Dec 2004 13:09:57 -0000	1.11
+++ block2mtd.c	22 Dec 2004 13:10:22 -0000	1.12
@@ -336,12 +336,14 @@
 
 
 /* sync the device - wait until the write queue is empty */
-static void blkmtd_sync(struct mtd_info *mtd)
+static void blockmtd_sync(struct mtd_info *mtd)
 {
-	sync_blockdev(((struct blkmtd_dev*)mtd->priv)->blkdev);
+	struct blkmtd_dev *dev = mtd->priv;
+	sync_blockdev(dev->blkdev);
 	return;
 }
 
+
 static void blockmtd_free_device(struct blkmtd_dev *dev)
 {
 	if (!dev)
@@ -479,7 +481,7 @@
 	dev->mtd_info.erase = blkmtd_erase;
 	dev->mtd_info.write = blkmtd_write;
 	dev->mtd_info.writev = default_mtd_writev;
-	dev->mtd_info.sync = blkmtd_sync;
+	dev->mtd_info.sync = blockmtd_sync;
 	dev->mtd_info.read = blkmtd_read;
 	dev->mtd_info.readv = default_mtd_readv;
 	dev->mtd_info.priv = dev;
@@ -624,7 +626,7 @@
 	list_for_each_safe(temp1, temp2, &blkmtd_device_list) {
 		struct blkmtd_dev *dev = list_entry(temp1, struct blkmtd_dev,
 						    list);
-		blkmtd_sync(&dev->mtd_info);
+		blockmtd_sync(&dev->mtd_info);
 		del_mtd_device(&dev->mtd_info);
 		INFO("mtd%d: [%s] removed", dev->mtd_info.index,
 				dev->mtd_info.name + strlen("blkmtd: "));





More information about the linux-mtd-cvs mailing list