Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1326225
| From | Tyrel Datwyler <tyreld@linux.vnet.ibm.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 6/6] ibmvscsi: Add endian conversions to sysfs attribute show functions |
| Date | 2016-02-04 00:40 +0100 |
| Message-ID | <qYfbJ-uu-55@gated-at.bofh.it> (permalink) |
| References | <qYf24-oH-53@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
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: Tyrel Datwyler <tyreld@linux.vnet.ibm.com> --- drivers/scsi/ibmvscsi/ibmvscsi.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/scsi/ibmvscsi/ibmvscsi.c b/drivers/scsi/ibmvscsi/ibmvscsi.c index a2b8db1..3621ac5 100644 --- a/drivers/scsi/ibmvscsi/ibmvscsi.c +++ b/drivers/scsi/ibmvscsi/ibmvscsi.c @@ -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; } -- 2.5.0
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH 0/6] ibmvscsi: code cleanup Tyrel Datwyler <tyreld@linux.vnet.ibm.com> - 2016-02-04 00:30 +0100
[PATCH 1/6] ibmvscsi: Correct values for several viosrp_crq_format enums Tyrel Datwyler <tyreld@linux.vnet.ibm.com> - 2016-02-04 00:40 +0100
Re: [PATCH 1/6] ibmvscsi: Correct values for several viosrp_crq_format enums Johannes Thumshirn <jthumshirn@suse.de> - 2016-02-04 09:40 +0100
[PATCH 2/6] ibmvscsi: Add and use enums for valid CRQ header values Tyrel Datwyler <tyreld@linux.vnet.ibm.com> - 2016-02-04 00:40 +0100
Re: [PATCH 2/6] ibmvscsi: Add and use enums for valid CRQ header values Johannes Thumshirn <jthumshirn@suse.de> - 2016-02-04 09:40 +0100
Re: [PATCH 2/6] ibmvscsi: Add and use enums for valid CRQ header values Manoj Kumar <manoj@linux.vnet.ibm.com> - 2016-02-04 21:00 +0100
Re: [PATCH 2/6] ibmvscsi: Add and use enums for valid CRQ header values Tyrel Datwyler <tyreld@linux.vnet.ibm.com> - 2016-02-04 22:30 +0100
[PATCH 4/6] ibmvscsi: Use of_root to access OF device tree root node Tyrel Datwyler <tyreld@linux.vnet.ibm.com> - 2016-02-04 00:40 +0100
Re: [PATCH 4/6] ibmvscsi: Use of_root to access OF device tree root node Johannes Thumshirn <jthumshirn@suse.de> - 2016-02-04 09:50 +0100
[PATCH 6/6] ibmvscsi: Add endian conversions to sysfs attribute show functions Tyrel Datwyler <tyreld@linux.vnet.ibm.com> - 2016-02-04 00:40 +0100
Re: [PATCH 6/6] ibmvscsi: Add endian conversions to sysfs attribute show functions Johannes Thumshirn <jthumshirn@suse.de> - 2016-02-04 09:50 +0100
[PATCH 3/6] ibmvscsi: Replace magic values in set_adpater_info() with defines Tyrel Datwyler <tyreld@linux.vnet.ibm.com> - 2016-02-04 00:40 +0100
Re: [PATCH 3/6] ibmvscsi: Replace magic values in set_adpater_info() with defines Johannes Thumshirn <jthumshirn@suse.de> - 2016-02-04 09:50 +0100
csiph-web