Commit 4cb25d47 authored by Tyrel Datwyler's avatar Tyrel Datwyler Committed by Tim Gardner

ibmvscsi: Add endian conversions to sysfs attribute show functions

BugLink: http://bugs.launchpad.net/bugs/1547153

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: default avatarTyrel Datwyler <tyreld@linux.vnet.ibm.com>
Reviewed-by: default avatarJohannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: default avatarMartin K. Petersen <martin.petersen@oracle.com>
(cherry picked from linux-next commit f9e3de0d6053ae89828188291a405c64d8d95a0e)
Signed-off-by: default avatarTim Gardner <tim.gardner@canonical.com>
parent 9bb0ab7e
...@@ -2041,7 +2041,7 @@ static ssize_t show_host_partition_number(struct device *dev, ...@@ -2041,7 +2041,7 @@ static ssize_t show_host_partition_number(struct device *dev,
int len; int len;
len = snprintf(buf, PAGE_SIZE, "%d\n", len = snprintf(buf, PAGE_SIZE, "%d\n",
hostdata->madapter_info.partition_number); be32_to_cpu(hostdata->madapter_info.partition_number));
return len; return len;
} }
...@@ -2061,7 +2061,7 @@ static ssize_t show_host_mad_version(struct device *dev, ...@@ -2061,7 +2061,7 @@ static ssize_t show_host_mad_version(struct device *dev,
int len; int len;
len = snprintf(buf, PAGE_SIZE, "%d\n", len = snprintf(buf, PAGE_SIZE, "%d\n",
hostdata->madapter_info.mad_version); be32_to_cpu(hostdata->madapter_info.mad_version));
return len; return len;
} }
...@@ -2080,7 +2080,8 @@ static ssize_t show_host_os_type(struct device *dev, ...@@ -2080,7 +2080,8 @@ static ssize_t show_host_os_type(struct device *dev,
struct ibmvscsi_host_data *hostdata = shost_priv(shost); struct ibmvscsi_host_data *hostdata = shost_priv(shost);
int len; 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; return len;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment