]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
[SCSI] pm80xx: Fixed return value issue.
authorViswas G <Viswas.G@pmcs.com>
Wed, 27 Nov 2013 05:42:33 +0000 (11:12 +0530)
committerJames Bottomley <JBottomley@Parallels.com>
Tue, 17 Dec 2013 14:54:43 +0000 (06:54 -0800)
pm80xx_get_gsm_dump() was returning "1" in error case instead of
negative error value.

Signed-off-by: Viswas G <Viswas.G@pmcs.com>
Reviewed-by: Jack Wang <xjtuwjp@gmail.com>
Reviewed-by: Tomas Henzl <thenzl@redhat.com>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
drivers/scsi/pm8001/pm8001_ctl.c
drivers/scsi/pm8001/pm8001_hwi.c

index 1e055ae61cdc3331a92ab3b2aadf64311ea04dd4..ce918520a5f0e7af0364aadaf60c7385596469c9 100644 (file)
@@ -460,7 +460,7 @@ static DEVICE_ATTR(iop_log, S_IRUGO, pm8001_ctl_iop_log_show, NULL);
 static ssize_t pm8001_ctl_fatal_log_show(struct device *cdev,
        struct device_attribute *attr, char *buf)
 {
-       u32 count;
+       ssize_t count;
 
        count = pm80xx_get_fatal_dump(cdev, attr, buf);
        return count;
@@ -478,7 +478,7 @@ static DEVICE_ATTR(fatal_log, S_IRUGO, pm8001_ctl_fatal_log_show, NULL);
 static ssize_t pm8001_ctl_gsm_log_show(struct device *cdev,
        struct device_attribute *attr, char *buf)
 {
-       u32 count;
+       ssize_t count;
 
        count = pm8001_get_gsm_dump(cdev, SYSFS_OFFSET, buf);
        return count;
index 2aa068112bda1d637a9af39766c051809f5049c7..46ace52eeb2d8e38c83bc62f0bfda96a16a927c8 100644 (file)
@@ -5020,7 +5020,7 @@ pm8001_get_gsm_dump(struct device *cdev, u32 length, char *buf)
        /* check max is 1 Mbytes */
        if ((length > 0x100000) || (gsm_dump_offset & 3) ||
                ((gsm_dump_offset + length) > 0x1000000))
-                       return 1;
+                       return -EINVAL;
 
        if (pm8001_ha->chip_id == chip_8001)
                bar = 2;
@@ -5048,12 +5048,12 @@ pm8001_get_gsm_dump(struct device *cdev, u32 length, char *buf)
                                gsm_base = GSM_BASE;
                                if (-1 == pm8001_bar4_shift(pm8001_ha,
                                                (gsm_base + shift_value)))
-                                       return 1;
+                                       return -EIO;
                        } else {
                                gsm_base = 0;
                                if (-1 == pm80xx_bar4_shift(pm8001_ha,
                                                (gsm_base + shift_value)))
-                                       return 1;
+                                       return -EIO;
                        }
                        gsm_dump_offset = (gsm_dump_offset + offset) &
                                                0xFFFF0000;
@@ -5073,7 +5073,7 @@ pm8001_get_gsm_dump(struct device *cdev, u32 length, char *buf)
        }
        /* Shift back to BAR4 original address */
        if (-1 == pm8001_bar4_shift(pm8001_ha, 0))
-                       return 1;
+                       return -EIO;
        pm8001_ha->fatal_forensic_shift_offset += 1024;
 
        if (pm8001_ha->fatal_forensic_shift_offset >= 0x100000)