提交 f36948cb 编写于 作者: T Tyrel Datwyler 提交者: Martin K. Petersen

ibmvscsi: Add endian conversions to sysfs attribute show functions

The values returned by the show functions for the host os_type,
mad_version, and partition_number attributes get their values directly
from the madapter_info struct whose associated fields are __be32
typed. Added endian conversion to ensure these values are sane on LE
platforms.
Signed-off-by: NTyrel Datwyler <tyreld@linux.vnet.ibm.com>
Reviewed-by: NJohannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
上级 0a1c0ebf
......@@ -1983,7 +1983,7 @@ static ssize_t show_host_partition_number(struct device *dev,
int len;
len = snprintf(buf, PAGE_SIZE, "%d\n",
hostdata->madapter_info.partition_number);
be32_to_cpu(hostdata->madapter_info.partition_number));
return len;
}
......@@ -2003,7 +2003,7 @@ static ssize_t show_host_mad_version(struct device *dev,
int len;
len = snprintf(buf, PAGE_SIZE, "%d\n",
hostdata->madapter_info.mad_version);
be32_to_cpu(hostdata->madapter_info.mad_version));
return len;
}
......@@ -2022,7 +2022,8 @@ static ssize_t show_host_os_type(struct device *dev,
struct ibmvscsi_host_data *hostdata = shost_priv(shost);
int len;
len = snprintf(buf, PAGE_SIZE, "%d\n", hostdata->madapter_info.os_type);
len = snprintf(buf, PAGE_SIZE, "%d\n",
be32_to_cpu(hostdata->madapter_info.os_type));
return len;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册