Commit cc7fce80 authored by Tomer Barletz's avatar Tomer Barletz Committed by Brian Norris

mtd: blkdevs: fix switch-bool compilation warning

With gcc 5.1 I get:
warning: switch condition has boolean value [-Wswitch-bool]
Signed-off-by: default avatarTomer Barletz <barletz@gmail.com>
Signed-off-by: default avatarBrian Norris <computersforpeace@gmail.com>
parent 06bb6f5a
...@@ -97,14 +97,13 @@ static int do_blktrans_request(struct mtd_blktrans_ops *tr, ...@@ -97,14 +97,13 @@ static int do_blktrans_request(struct mtd_blktrans_ops *tr,
if (req->cmd_flags & REQ_DISCARD) if (req->cmd_flags & REQ_DISCARD)
return tr->discard(dev, block, nsect); return tr->discard(dev, block, nsect);
switch(rq_data_dir(req)) { if (rq_data_dir(req) == READ) {
case READ:
for (; nsect > 0; nsect--, block++, buf += tr->blksize) for (; nsect > 0; nsect--, block++, buf += tr->blksize)
if (tr->readsect(dev, block, buf)) if (tr->readsect(dev, block, buf))
return -EIO; return -EIO;
rq_flush_dcache_pages(req); rq_flush_dcache_pages(req);
return 0; return 0;
case WRITE: } else {
if (!tr->writesect) if (!tr->writesect)
return -EIO; return -EIO;
...@@ -113,9 +112,6 @@ static int do_blktrans_request(struct mtd_blktrans_ops *tr, ...@@ -113,9 +112,6 @@ static int do_blktrans_request(struct mtd_blktrans_ops *tr,
if (tr->writesect(dev, block, buf)) if (tr->writesect(dev, block, buf))
return -EIO; return -EIO;
return 0; return 0;
default:
printk(KERN_NOTICE "Unknown request %u\n", rq_data_dir(req));
return -EIO;
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment