diff options
author | Tomer Barletz <barletz@gmail.com> | 2015-08-04 21:00:24 -0700 |
---|---|---|
committer | Stefan Agner <stefan.agner@toradex.com> | 2017-10-02 15:16:27 +0200 |
commit | 4b20a89fc6b70a809feae01bd2e7658997c0016b (patch) | |
tree | 16300b77b284d1d00d8d205863dbc04a3dd15f89 | |
parent | c595a9eda7dd1c72420d621e88f7e2c1e35a96f5 (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.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/mtd/mtd_blkdevs.c b/drivers/mtd/mtd_blkdevs.c index c0bb374286f0..7f66bef74768 100644 --- a/drivers/mtd/mtd_blkdevs.c +++ b/drivers/mtd/mtd_blkdevs.c @@ -97,14 +97,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; @@ -113,9 +112,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; } } |