CHROMIUM: sd: Fix warning
authorOlof Johansson <olofj@chromium.org>
Mon, 10 Sep 2012 16:54:38 +0000 (09:54 -0700)
committerGerrit <chrome-bot@google.com>
Tue, 11 Sep 2012 00:27:43 +0000 (17:27 -0700)
drivers/scsi/sd.c:2676:2: warning: assignment from incompatible pointer type [enabled by default]
drivers/scsi/sd.c:2913:2: warning: assignment from incompatible pointer type [enabled by default]

Since there's no way to return an error, do a WARN_ON() in the error
case instead.

BUG=chromium-os:34287
TEST=none (we need an automated test for error injection here)

Change-Id: Idaf0c0184e81ef7bac63b1deeda1a7690aa48a42
Signed-off-by: Olof Johansson <olofj@chromium.org>
Reviewed-on: https://gerrit.chromium.org/gerrit/32830
Reviewed-by: Sonny Rao <sonnyrao@chromium.org>
drivers/scsi/sd.c

index 69350e0..0aa67df 100644 (file)
@@ -105,7 +105,7 @@ static int  sd_probe(struct device *);
 static int  sd_remove(struct device *);
 static void sd_shutdown(struct device *);
 static int sd_suspend(struct device *, pm_message_t state);
-static int __sd_resume(struct work_struct *work);
+static void __sd_resume(struct work_struct *work);
 static int sd_resume(struct device *);
 static void sd_rescan(struct device *);
 static int sd_done(struct scsi_cmnd *);
@@ -2889,7 +2889,7 @@ done:
        return ret;
 }
 
-static int __sd_resume(struct work_struct *work)
+static void __sd_resume(struct work_struct *work)
 {
        struct scsi_disk *sdkp = container_of(work, struct scsi_disk,
                resume_work);
@@ -2900,10 +2900,11 @@ static int __sd_resume(struct work_struct *work)
 
        sd_printk(KERN_NOTICE, sdkp, "Starting disk\n");
        ret = sd_start_stop_device(sdkp, 1);
+       WARN_ON(ret);
 
 done:
        scsi_disk_put(sdkp);
-       return ret;
+       return;
 }
 
 static int sd_resume(struct device *dev)