mtd: block2mtd: page_read() never returns NULL

Linux-MTD Mailing List linux-mtd at lists.infradead.org
Mon May 28 07:59:04 EDT 2012


Gitweb:     http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=39a5d0b93c244f40ee2e1502e4870685b7dcc1fa
Commit:     39a5d0b93c244f40ee2e1502e4870685b7dcc1fa
Parent:     5329d67cc32c0306426dc4bc4b5e66a36cb87ce0
Author:     Ryosuke Saito <raitosyo at gmail.com>
AuthorDate: Mon Apr 23 19:47:17 2012 +0900
Committer:  David Woodhouse <David.Woodhouse at intel.com>
CommitDate: Sun May 13 22:56:52 2012 -0500

    mtd: block2mtd: page_read() never returns NULL
    
    page_read() never returns NULL, so we can remove the NULL check here.
    
    Signed-off-by: Ryosuke Saito <raitosyo at gmail.com>
    Signed-off-by: Artem Bityutskiy <artem.bityutskiy at linux.intel.com>
    Signed-off-by: David Woodhouse <David.Woodhouse at intel.com>
---
 drivers/mtd/devices/block2mtd.c |    6 ------
 1 files changed, 0 insertions(+), 6 deletions(-)

diff --git a/drivers/mtd/devices/block2mtd.c b/drivers/mtd/devices/block2mtd.c
index a4a80b7..300aeb8 100644
--- a/drivers/mtd/devices/block2mtd.c
+++ b/drivers/mtd/devices/block2mtd.c
@@ -52,8 +52,6 @@ static int _block2mtd_erase(struct block2mtd_dev *dev, loff_t to, size_t len)
 
 	while (pages) {
 		page = page_read(mapping, index);
-		if (!page)
-			return -ENOMEM;
 		if (IS_ERR(page))
 			return PTR_ERR(page);
 
@@ -112,8 +110,6 @@ static int block2mtd_read(struct mtd_info *mtd, loff_t from, size_t len,
 		len = len - cpylen;
 
 		page = page_read(dev->blkdev->bd_inode->i_mapping, index);
-		if (!page)
-			return -ENOMEM;
 		if (IS_ERR(page))
 			return PTR_ERR(page);
 
@@ -148,8 +144,6 @@ static int _block2mtd_write(struct block2mtd_dev *dev, const u_char *buf,
 		len = len - cpylen;
 
 		page = page_read(mapping, index);
-		if (!page)
-			return -ENOMEM;
 		if (IS_ERR(page))
 			return PTR_ERR(page);
 



More information about the linux-mtd-cvs mailing list