summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTomer Barletz <barletz@gmail.com>2015-08-04 21:00:24 -0700
committerStefan Agner <stefan.agner@toradex.com>2016-07-14 11:24:13 -0700
commit9f2723e14bab4fb558b4a4eb3e941876e2c55e2a (patch)
tree5a822329e8f914933c5007afcd1d4255a0bc2ce7
parente3bdb63c4dc13d1b4baac0294e8013a29b9c75bb (diff)
mtd: blkdevs: fix switch-bool compilation warning
With gcc 5.1 I get: warning: switch condition has boolean value [-Wswitch-bool] Signed-off-by: Tomer Barletz <barletz@gmail.com> Signed-off-by: Brian Norris <computersforpeace@gmail.com> (cherry picked from commit cc7fce80229067890365c1ee196be5d304d36dea)
-rw-r--r--drivers/mtd/mtd_blkdevs.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/mtd/mtd_blkdevs.c b/drivers/mtd/mtd_blkdevs.c
index ff1bf48..4b83fc8 100644
--- a/drivers/mtd/mtd_blkdevs.c
+++ b/drivers/mtd/mtd_blkdevs.c
@@ -96,14 +96,13 @@ static int do_blktrans_request(struct mtd_blktrans_ops *tr,
if (req->cmd_flags & REQ_DISCARD)
return tr->discard(dev, block, nsect);
- switch(rq_data_dir(req)) {
- case READ:
+ if (rq_data_dir(req) == READ) {
for (; nsect > 0; nsect--, block++, buf += tr->blksize)
if (tr->readsect(dev, block, buf))
return -EIO;
rq_flush_dcache_pages(req);
return 0;
- case WRITE:
+ } else {
if (!tr->writesect)
return -EIO;
@@ -112,9 +111,6 @@ static int do_blktrans_request(struct mtd_blktrans_ops *tr,
if (tr->writesect(dev, block, buf))
return -EIO;
return 0;
- default:
- printk(KERN_NOTICE "Unknown request %u\n", rq_data_dir(req));
- return -EIO;
}
}