ipr: Byte swapping for device_id attribute in sysfs
authorWen Xiong <wenxiong@linux.vnet.ibm.com>
Fri, 12 Jun 2015 01:45:18 +0000 (20:45 -0500)
committerJames Bottomley <JBottomley@Odin.com>
Thu, 30 Jul 2015 19:39:39 +0000 (12:39 -0700)
On LE system, users see the wrong device_id attribute. This patch
does necessary byte swapping for device_id attribute and works on
both of LE and BE systems.

Signed-off-by: Wen Xiong <wenxiong@linux.vnet.ibm.com>
Signed-off-by: Brian King <brking@linux.vnet.ibm.com>
Signed-off-by: James Bottomley <JBottomley@Odin.com>
drivers/scsi/ipr.c

index a9aa38903efefeeccf1dff34ad201af7283d70d9..15da7544177c56af394e2e89741d2bfe9b6eb821 100644 (file)
@@ -4455,7 +4455,7 @@ static ssize_t ipr_show_device_id(struct device *dev, struct device_attribute *a
        spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags);
        res = (struct ipr_resource_entry *)sdev->hostdata;
        if (res && ioa_cfg->sis64)
-               len = snprintf(buf, PAGE_SIZE, "0x%llx\n", res->dev_id);
+               len = snprintf(buf, PAGE_SIZE, "0x%llx\n", be64_to_cpu(res->dev_id));
        else if (res)
                len = snprintf(buf, PAGE_SIZE, "0x%llx\n", res->lun_wwn);