mtd: mtdswap: remove useless if (!mtd->ecclayout) test
Linux-MTD Mailing List
linux-mtd at lists.infradead.org
Thu Mar 24 11:59:10 PDT 2016
Gitweb: http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=f2de0fa64306651bc5aa04f6bb56c057658486d5
Commit: f2de0fa64306651bc5aa04f6bb56c057658486d5
Parent: 29f1058a90b319b01c4cf469720e0350212d5c9c
Author: Boris BREZILLON <boris.brezillon at free-electrons.com>
AuthorDate: Mon Mar 7 10:46:53 2016 +0100
Committer: Brian Norris <computersforpeace at gmail.com>
CommitDate: Mon Mar 7 16:23:09 2016 -0800
mtd: mtdswap: remove useless if (!mtd->ecclayout) test
If the MTD device does not have OOB, the mtd->oobsize and mtd->oobavail
fields are set to zero, and we are testing those values in the following
test.
Remove the useless if (!mtd->ecclayout) test.
Signed-off-by: Boris Brezillon <boris.brezillon at free-electrons.com>
Signed-off-by: Brian Norris <computersforpeace at gmail.com>
---
drivers/mtd/mtdswap.c | 8 --------
1 file changed, 8 deletions(-)
diff --git a/drivers/mtd/mtdswap.c b/drivers/mtd/mtdswap.c
index d330eb1..cb06bdd 100644
--- a/drivers/mtd/mtdswap.c
+++ b/drivers/mtd/mtdswap.c
@@ -1417,7 +1417,6 @@ static void mtdswap_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd)
unsigned long part;
unsigned int eblocks, eavailable, bad_blocks, spare_cnt;
uint64_t swap_size, use_size, size_limit;
- struct nand_ecclayout *oinfo;
int ret;
parts = &partitions[0];
@@ -1447,13 +1446,6 @@ static void mtdswap_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd)
return;
}
- oinfo = mtd->ecclayout;
- if (!oinfo) {
- printk(KERN_ERR "%s: mtd%d does not have OOB\n",
- MTDSWAP_PREFIX, mtd->index);
- return;
- }
-
if (!mtd->oobsize || mtd->oobavail < MTDSWAP_OOBSIZE) {
printk(KERN_ERR "%s: Not enough free bytes in OOB, "
"%d available, %zu needed.\n",
More information about the linux-mtd-cvs
mailing list