提交 f63eb21b 编写于 作者: J Jens Axboe

[PATCH] kill 'reading' variable in sg_io(), it isn't used anymore.

Signed-off-by: NJens Axboe <axboe@suse.de>
上级 e1f546e1
...@@ -216,7 +216,7 @@ static int sg_io(struct file *file, request_queue_t *q, ...@@ -216,7 +216,7 @@ static int sg_io(struct file *file, request_queue_t *q,
struct gendisk *bd_disk, struct sg_io_hdr *hdr) struct gendisk *bd_disk, struct sg_io_hdr *hdr)
{ {
unsigned long start_time; unsigned long start_time;
int reading, writing, ret = 0; int writing = 0, ret = 0;
struct request *rq; struct request *rq;
struct bio *bio; struct bio *bio;
char sense[SCSI_SENSE_BUFFERSIZE]; char sense[SCSI_SENSE_BUFFERSIZE];
...@@ -234,19 +234,15 @@ static int sg_io(struct file *file, request_queue_t *q, ...@@ -234,19 +234,15 @@ static int sg_io(struct file *file, request_queue_t *q,
if (hdr->dxfer_len > (q->max_sectors << 9)) if (hdr->dxfer_len > (q->max_sectors << 9))
return -EIO; return -EIO;
reading = writing = 0;
if (hdr->dxfer_len) if (hdr->dxfer_len)
switch (hdr->dxfer_direction) { switch (hdr->dxfer_direction) {
default: default:
return -EINVAL; return -EINVAL;
case SG_DXFER_TO_FROM_DEV: case SG_DXFER_TO_FROM_DEV:
reading = 1;
/* fall through */
case SG_DXFER_TO_DEV: case SG_DXFER_TO_DEV:
writing = 1; writing = 1;
break; break;
case SG_DXFER_FROM_DEV: case SG_DXFER_FROM_DEV:
reading = 1;
break; break;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册