From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965143AbcBDIp4 (ORCPT ); Thu, 4 Feb 2016 03:45:56 -0500 Received: from mx2.suse.de ([195.135.220.15]:44698 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S964852AbcBDIpz (ORCPT ); Thu, 4 Feb 2016 03:45:55 -0500 Date: Thu, 4 Feb 2016 09:45:52 +0100 From: Johannes Thumshirn To: Tyrel Datwyler Cc: JBottomley@odin.com, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, nfont@linux.vnet.ibm.com, brking@linux.vnet.ibm.com, hare@suse.de Subject: Re: [PATCH 6/6] ibmvscsi: Add endian conversions to sysfs attribute show functions Message-ID: <20160204084552.GY27969@c203.arch.suse.de> References: <1454542114-1797-1-git-send-email-tyreld@linux.vnet.ibm.com> <1454542114-1797-7-git-send-email-tyreld@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1454542114-1797-7-git-send-email-tyreld@linux.vnet.ibm.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 03, 2016 at 05:28:34PM -0600, Tyrel Datwyler wrote: > 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 > --- > 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 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-scsi" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html Reviewed-by: Johannes Thumshirn -- Johannes Thumshirn Storage jthumshirn@suse.de +49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850