amiflop,ataflop,xd,mg_disk: clean up unnecessary stuff from block drivers
rq_data_dir() can only be READ or WRITE and rq->sector and nr_sectors
are always automatically updated after partial request completion.
Don't worry about rq_data_dir() not being either READ or WRITE or
manually update sector and nr_sectors.
[ Impact: cleanup ]
Signed-off-by: Tejun Heo <tj@kernel.org>
Cc: Jörg Dorchain <joerg@dorchain.net>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: unsik Kim <donari75@gmail.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
diff --git a/drivers/block/xd.c b/drivers/block/xd.c
index 6f6ad82..14be4c1 100644
--- a/drivers/block/xd.c
+++ b/drivers/block/xd.c
@@ -308,7 +308,6 @@
while ((req = elv_next_request(q)) != NULL) {
unsigned block = req->sector;
unsigned count = req->nr_sectors;
- int rw = rq_data_dir(req);
XD_INFO *disk = req->rq_disk->private_data;
int res = 0;
int retry;
@@ -321,13 +320,9 @@
__blk_end_request_cur(req, -EIO);
continue;
}
- if (rw != READ && rw != WRITE) {
- printk("do_xd_request: unknown request\n");
- __blk_end_request_cur(req, -EIO);
- continue;
- }
for (retry = 0; (retry < XD_RETRIES) && !res; retry++)
- res = xd_readwrite(rw, disk, req->buffer, block, count);
+ res = xd_readwrite(rq_data_dir(req), disk, req->buffer,
+ block, count);
/* wrap up, 0 = success, -errno = fail */
__blk_end_request_cur(req, res);
}