ide: initialize rq->cmd_type in ide_init_drive_cmd() callers
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Sat, 26 Jan 2008 19:13:11 +0000 (20:13 +0100)
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Sat, 26 Jan 2008 19:13:11 +0000 (20:13 +0100)
* Initialize rq->cmd_type in ide_wait_cmd(), ide_cmd_ioctl() and
  set_pio_mode() (other callers were aleady over-riding rq->cmd_type).

* Remove no longer needed rq->cmd_type setup from ide_init_drive_cmd().

Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
drivers/ide/ide-io.c
drivers/ide/ide-taskfile.c
drivers/ide/ide.c

index 513a5685db2f6c4374437681a0a0999ff9a0e7e1..8c9890414eb2018c09564d0b4673e2f67d32b1c2 100644 (file)
@@ -1672,7 +1672,6 @@ irqreturn_t ide_intr (int irq, void *dev_id)
 void ide_init_drive_cmd (struct request *rq)
 {
        memset(rq, 0, sizeof(*rq));
-       rq->cmd_type = REQ_TYPE_ATA_CMD;
        rq->ref_count = 1;
 }
 
index b559bece6e73ea9d49925d142d453ea0912eba62..b8c7e8134d885a50b1dd2052fb4ac96384213339 100644 (file)
@@ -759,6 +759,7 @@ int ide_wait_cmd (ide_drive_t *drive, u8 cmd, u8 nsect, u8 feature, u8 sectors,
                buf = buffer;
        memset(buf, 0, 4 + SECTOR_WORDS * 4 * sectors);
        ide_init_drive_cmd(&rq);
+       rq.cmd_type = REQ_TYPE_ATA_CMD;
        rq.buffer = buf;
        *buf++ = cmd;
        *buf++ = nsect;
@@ -778,7 +779,10 @@ int ide_cmd_ioctl (ide_drive_t *drive, unsigned int cmd, unsigned long arg)
 
        if (NULL == (void *) arg) {
                struct request rq;
+
                ide_init_drive_cmd(&rq);
+               rq.cmd_type = REQ_TYPE_ATA_CMD;
+
                return ide_do_drive_cmd(drive, &rq, ide_wait);
        }
 
index 52115ef1f01a6df2589e10497a264e8e6efd501e..446b128501552c003b504dd3edc41cf44d1b4a97 100644 (file)
@@ -878,7 +878,10 @@ int set_pio_mode(ide_drive_t *drive, int arg)
 
        if (drive->special.b.set_tune)
                return -EBUSY;
+
        ide_init_drive_cmd(&rq);
+       rq.cmd_type = REQ_TYPE_ATA_CMD;
+
        drive->tune_req = (u8) arg;
        drive->special.b.set_tune = 1;
        (void) ide_do_drive_cmd(drive, &rq, ide_wait);