Skip to content

Commit bb8647e

Browse files
wxiong38James Bottomley
authored andcommitted
ipr: Byte swapping for device_id attribute in sysfs
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>
1 parent 0ae80ba commit bb8647e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/scsi/ipr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4455,7 +4455,7 @@ static ssize_t ipr_show_device_id(struct device *dev, struct device_attribute *a
44554455
spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags);
44564456
res = (struct ipr_resource_entry *)sdev->hostdata;
44574457
if (res && ioa_cfg->sis64)
4458-
len = snprintf(buf, PAGE_SIZE, "0x%llx\n", res->dev_id);
4458+
len = snprintf(buf, PAGE_SIZE, "0x%llx\n", be64_to_cpu(res->dev_id));
44594459
else if (res)
44604460
len = snprintf(buf, PAGE_SIZE, "0x%llx\n", res->lun_wwn);
44614461

0 commit comments

Comments
 (0)