[PATCH] [MTD] block2mtd: remove casts

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Mon Mar 26 07:59:02 EDT 2007


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=0ffb74ccc06a112042adfaf8229684b78202bcae
Commit:     0ffb74ccc06a112042adfaf8229684b78202bcae
Parent:     1ca949299260aa49eeba34ff912e2321c8b1f647
Author:     Joern Engel <joern at wh.fh-wedel.de>
AuthorDate: Tue Feb 20 20:20:58 2007 +0100
Committer:  Joern Engel <joern at wh.fh-wedel.de>
CommitDate: Tue Feb 20 20:20:58 2007 +0100

    [PATCH] [MTD] block2mtd: remove casts
    
    Remove two casts - they were not only pointless, but outright harmful.
    
    Spotted by Felix Fietkau <nbd at openwrt.org>
    
    Signed-off-by: Jörn Engel <joern at lazybastard.org>
---
 drivers/mtd/devices/block2mtd.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/mtd/devices/block2mtd.c b/drivers/mtd/devices/block2mtd.c
index f9f2ce7..6a9fb80 100644
--- a/drivers/mtd/devices/block2mtd.c
+++ b/drivers/mtd/devices/block2mtd.c
@@ -111,8 +111,8 @@ static int _block2mtd_erase(struct block2mtd_dev *dev, loff_t to, size_t len)
 		if (IS_ERR(page))
 			return PTR_ERR(page);
 
-		max = (u_long*)page_address(page) + PAGE_SIZE;
-		for (p=(u_long*)page_address(page); p<max; p++)
+		max = page_address(page) + PAGE_SIZE;
+		for (p=page_address(page); p<max; p++)
 			if (*p != -1UL) {
 				lock_page(page);
 				memset(page_address(page), 0xff, PAGE_SIZE);



More information about the linux-mtd-cvs mailing list