summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/mtdswap.c
diff options
context:
space:
mode:
authorBoris BREZILLON <boris.brezillon@free-electrons.com>2016-03-07 04:46:53 -0500
committerBrian Norris <computersforpeace@gmail.com>2016-03-07 19:23:09 -0500
commitf2de0fa64306651bc5aa04f6bb56c057658486d5 (patch)
treeae866f94af372f3a00cc799caed7d5606a1d3330 /drivers/mtd/mtdswap.c
parent29f1058a90b319b01c4cf469720e0350212d5c9c (diff)
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@free-electrons.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com>
Diffstat (limited to 'drivers/mtd/mtdswap.c')
-rw-r--r--drivers/mtd/mtdswap.c8
1 files changed, 0 insertions, 8 deletions
diff --git a/drivers/mtd/mtdswap.c b/drivers/mtd/mtdswap.c
index d330eb1d3eba..cb06bdd21a1b 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)
1417 unsigned long part; 1417 unsigned long part;
1418 unsigned int eblocks, eavailable, bad_blocks, spare_cnt; 1418 unsigned int eblocks, eavailable, bad_blocks, spare_cnt;
1419 uint64_t swap_size, use_size, size_limit; 1419 uint64_t swap_size, use_size, size_limit;
1420 struct nand_ecclayout *oinfo;
1421 int ret; 1420 int ret;
1422 1421
1423 parts = &partitions[0]; 1422 parts = &partitions[0];
@@ -1447,13 +1446,6 @@ static void mtdswap_add_mtd(struct mtd_blktrans_ops *tr, struct mtd_info *mtd)
1447 return; 1446 return;
1448 } 1447 }
1449 1448
1450 oinfo = mtd->ecclayout;
1451 if (!oinfo) {
1452 printk(KERN_ERR "%s: mtd%d does not have OOB\n",
1453 MTDSWAP_PREFIX, mtd->index);
1454 return;
1455 }
1456
1457 if (!mtd->oobsize || mtd->oobavail < MTDSWAP_OOBSIZE) { 1449 if (!mtd->oobsize || mtd->oobavail < MTDSWAP_OOBSIZE) {
1458 printk(KERN_ERR "%s: Not enough free bytes in OOB, " 1450 printk(KERN_ERR "%s: Not enough free bytes in OOB, "
1459 "%d available, %zu needed.\n", 1451 "%d available, %zu needed.\n",