cciss: Fix weird usage of ENXIO in cciss_scsi.c
authorStephen M. Cameron <scameron@beardog.cce.hp.com>
Thu, 12 Nov 2009 18:50:06 +0000 (12:50 -0600)
committerJens Axboe <jens.axboe@oracle.com>
Fri, 13 Nov 2009 07:45:54 +0000 (08:45 +0100)
cciss: Fix weird usage of ENXIO in cciss_scsi.c

Signed-off-by: Stephen M. Cameron <scameron@beardog.cce.hp.com>
Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
drivers/block/cciss.c
drivers/block/cciss_scsi.c

index 1bd313dcf6af90abd8643d6271763ae3d5457ccc..eab81c6c0ca5c066f3881fe45291c0dfc76140e9 100644 (file)
@@ -422,12 +422,9 @@ cciss_proc_write(struct file *file, const char __user *buf,
        if (strncmp(ENGAGE_SCSI, buffer, sizeof ENGAGE_SCSI - 1) == 0) {
                struct seq_file *seq = file->private_data;
                ctlr_info_t *h = seq->private;
-               int rc;
 
-               rc = cciss_engage_scsi(h->ctlr);
-               if (rc != 0)
-                       err = -rc;
-               else
+               err = cciss_engage_scsi(h->ctlr);
+               if (err == 0)
                        err = length;
        } else
 #endif /* CONFIG_CISS_SCSI_TAPE */
index 237d2b353652e5e12ffa81560cdb3f368ab7e4a8..5d0e46dc36320f701f816f825ca3563bedf6d3e9 100644 (file)
@@ -1547,7 +1547,7 @@ cciss_engage_scsi(int ctlr)
        if (sa->registered) {
                printk("cciss%d: SCSI subsystem already engaged.\n", ctlr);
                spin_unlock_irqrestore(CCISS_LOCK(ctlr), flags);
-               return ENXIO;
+               return -ENXIO;
        }
        sa->registered = 1;
        spin_unlock_irqrestore(CCISS_LOCK(ctlr), flags);