diff mbox

[2/4] ipr: Byte swapping for device_id attribute in sysfs

Message ID 201506120145.t5C1jIXa014812@d01av05.pok.ibm.com (mailing list archive)
State New, archived
Headers show

Commit Message

Brian King June 12, 2015, 1:45 a.m. UTC
From: Wen Xiong <wenxiong@linux.vnet.ibm.com>

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>
---

 drivers/scsi/ipr.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox

Patch

diff -puN drivers/scsi/ipr.c~ipr_device_id_swap drivers/scsi/ipr.c
--- linux/drivers/scsi/ipr.c~ipr_device_id_swap	2015-06-11 20:18:26.578563454 -0500
+++ linux-bjking1/drivers/scsi/ipr.c	2015-06-11 20:33:52.946558852 -0500
@@ -4449,7 +4449,7 @@  static ssize_t ipr_show_device_id(struct
 	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);