diff options
author | Paul Moore <pmoore@redhat.com> | 2014-06-17 17:30:23 -0400 |
---|---|---|
committer | Paul Moore <pmoore@redhat.com> | 2014-06-17 17:30:23 -0400 |
commit | 170b5910d9fbea79de1bb40df22eda5f98250c0c (patch) | |
tree | ca9560e878d2842d45c6f99077d0d8b8f8b0f9ba /drivers/scsi/pm8001/pm8001_ctl.c | |
parent | 47dd0b76ace953bd2c0479076db0d3e3b9594003 (diff) | |
parent | 1860e379875dfe7271c649058aeddffe5afd9d0d (diff) |
Merge tag 'v3.15' into next
Linux 3.15
Diffstat (limited to 'drivers/scsi/pm8001/pm8001_ctl.c')
-rw-r--r-- | drivers/scsi/pm8001/pm8001_ctl.c | 38 |
1 files changed, 12 insertions, 26 deletions
diff --git a/drivers/scsi/pm8001/pm8001_ctl.c b/drivers/scsi/pm8001/pm8001_ctl.c index a04b4ff8c7f..28b4e813915 100644 --- a/drivers/scsi/pm8001/pm8001_ctl.c +++ b/drivers/scsi/pm8001/pm8001_ctl.c @@ -323,24 +323,17 @@ static ssize_t pm8001_ctl_ib_queue_log_show(struct device *cdev, int offset; char *str = buf; int start = 0; -#define IB_MEMMAP(c) \ - (*(u32 *)((u8 *)pm8001_ha-> \ - memoryMap.region[IB].virt_ptr + \ +#define IB_MEMMAP(c) \ + (*(u32 *)((u8 *)pm8001_ha-> \ + memoryMap.region[IB].virt_ptr + \ pm8001_ha->evtlog_ib_offset + (c))) for (offset = 0; offset < IB_OB_READ_TIMES; offset++) { - if (pm8001_ha->chip_id != chip_8001) - str += sprintf(str, "0x%08x\n", IB_MEMMAP(start)); - else - str += sprintf(str, "0x%08x\n", IB_MEMMAP(start)); + str += sprintf(str, "0x%08x\n", IB_MEMMAP(start)); start = start + 4; } pm8001_ha->evtlog_ib_offset += SYSFS_OFFSET; - if ((((pm8001_ha->evtlog_ib_offset) % (PM80XX_IB_OB_QUEUE_SIZE)) == 0) - && (pm8001_ha->chip_id != chip_8001)) - pm8001_ha->evtlog_ib_offset = 0; - if ((((pm8001_ha->evtlog_ib_offset) % (PM8001_IB_OB_QUEUE_SIZE)) == 0) - && (pm8001_ha->chip_id == chip_8001)) + if (((pm8001_ha->evtlog_ib_offset) % (PM80XX_IB_OB_QUEUE_SIZE)) == 0) pm8001_ha->evtlog_ib_offset = 0; return str - buf; @@ -363,24 +356,17 @@ static ssize_t pm8001_ctl_ob_queue_log_show(struct device *cdev, int offset; char *str = buf; int start = 0; -#define OB_MEMMAP(c) \ - (*(u32 *)((u8 *)pm8001_ha-> \ - memoryMap.region[OB].virt_ptr + \ +#define OB_MEMMAP(c) \ + (*(u32 *)((u8 *)pm8001_ha-> \ + memoryMap.region[OB].virt_ptr + \ pm8001_ha->evtlog_ob_offset + (c))) for (offset = 0; offset < IB_OB_READ_TIMES; offset++) { - if (pm8001_ha->chip_id != chip_8001) - str += sprintf(str, "0x%08x\n", OB_MEMMAP(start)); - else - str += sprintf(str, "0x%08x\n", OB_MEMMAP(start)); + str += sprintf(str, "0x%08x\n", OB_MEMMAP(start)); start = start + 4; } pm8001_ha->evtlog_ob_offset += SYSFS_OFFSET; - if ((((pm8001_ha->evtlog_ob_offset) % (PM80XX_IB_OB_QUEUE_SIZE)) == 0) - && (pm8001_ha->chip_id != chip_8001)) - pm8001_ha->evtlog_ob_offset = 0; - if ((((pm8001_ha->evtlog_ob_offset) % (PM8001_IB_OB_QUEUE_SIZE)) == 0) - && (pm8001_ha->chip_id == chip_8001)) + if (((pm8001_ha->evtlog_ob_offset) % (PM80XX_IB_OB_QUEUE_SIZE)) == 0) pm8001_ha->evtlog_ob_offset = 0; return str - buf; @@ -466,7 +452,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; @@ -484,7 +470,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; |