Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit bb8647e8 authored by Wen Xiong's avatar Wen Xiong Committed by James Bottomley
Browse files

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: default avatarWen Xiong <wenxiong@linux.vnet.ibm.com>
Signed-off-by: default avatarBrian King <brking@linux.vnet.ibm.com>
Signed-off-by: default avatarJames Bottomley <JBottomley@Odin.com>
parent 0ae80ba9
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -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);
	spin_lock_irqsave(ioa_cfg->host->host_lock, lock_flags);
	res = (struct ipr_resource_entry *)sdev->hostdata;
	res = (struct ipr_resource_entry *)sdev->hostdata;
	if (res && ioa_cfg->sis64)
	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)
	else if (res)
		len = snprintf(buf, PAGE_SIZE, "0x%llx\n", res->lun_wwn);
		len = snprintf(buf, PAGE_SIZE, "0x%llx\n", res->lun_wwn);