Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 7637
b: refs/heads/master
c: f63eb21
h: refs/heads/master
i:
  7635: c912d70
v: v3
  • Loading branch information
Jens Axboe committed Jun 20, 2005
1 parent 7c17499 commit df403d0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: e1f546e185e9d8cb9303d74d1cd5bc704f265384
refs/heads/master: f63eb21b4f32028755b6b9d47e5eb13c18ba0cae
6 changes: 1 addition & 5 deletions trunk/drivers/block/scsi_ioctl.c
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ static int sg_io(struct file *file, request_queue_t *q,
struct gendisk *bd_disk, struct sg_io_hdr *hdr)
{
unsigned long start_time;
int reading, writing, ret = 0;
int writing = 0, ret = 0;
struct request *rq;
struct bio *bio;
char sense[SCSI_SENSE_BUFFERSIZE];
Expand All @@ -234,19 +234,15 @@ static int sg_io(struct file *file, request_queue_t *q,
if (hdr->dxfer_len > (q->max_sectors << 9))
return -EIO;

reading = writing = 0;
if (hdr->dxfer_len)
switch (hdr->dxfer_direction) {
default:
return -EINVAL;
case SG_DXFER_TO_FROM_DEV:
reading = 1;
/* fall through */
case SG_DXFER_TO_DEV:
writing = 1;
break;
case SG_DXFER_FROM_DEV:
reading = 1;
break;
}

Expand Down

0 comments on commit df403d0

Please sign in to comment.