linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Wagner <dwagner@suse.de>
To: Bart Van Assche <bvanassche@acm.org>
Cc: "Martin K . Petersen" <martin.petersen@oracle.com>,
	"James E . J . Bottomley" <jejb@linux.vnet.ibm.com>,
	linux-scsi@vger.kernel.org, Christoph Hellwig <hch@lst.de>,
	Himanshu Madhani <hmadhani@marvell.com>,
	Quinn Tran <qutran@marvell.com>, Martin Wilck <mwilck@suse.com>,
	Roman Bolshakov <r.bolshakov@yadro.com>
Subject: Re: [PATCH] qla2xxx: Fix the endianness of the qla82xx_get_fw_size() return type
Date: Thu, 19 Dec 2019 09:39:21 +0100	[thread overview]
Message-ID: <20191219083921.2w3iibvbg2e53tg3@boron> (raw)
In-Reply-To: <20191219004905.39586-1-bvanassche@acm.org>

On Wed, Dec 18, 2019 at 04:49:05PM -0800, Bart Van Assche wrote:
> Since qla82xx_get_fw_size() returns a number in CPU-endian format, change
> its return type from __le32 into u32. This patch does not change any
> functionality.
> 
> Cc: Himanshu Madhani <hmadhani@marvell.com>
> Cc: Quinn Tran <qutran@marvell.com>
> Cc: Martin Wilck <mwilck@suse.com>
> Cc: Daniel Wagner <dwagner@suse.de>
> Cc: Roman Bolshakov <r.bolshakov@yadro.com>
> Fixes: 9c2b297572bf ("[SCSI] qla2xxx: Support for loading Unified ROM Image (URI) format firmware file.")
> Signed-off-by: Bart Van Assche <bvanassche@acm.org>

Reviewed-by: Daniel Wagner <dwagner@suse.de>

> ---
>  drivers/scsi/qla2xxx/qla_nx.c | 7 +++----
>  1 file changed, 3 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/scsi/qla2xxx/qla_nx.c b/drivers/scsi/qla2xxx/qla_nx.c
> index 2b2028f2383e..c855d013ba8a 100644
> --- a/drivers/scsi/qla2xxx/qla_nx.c
> +++ b/drivers/scsi/qla2xxx/qla_nx.c
> @@ -1612,8 +1612,7 @@ qla82xx_get_bootld_offset(struct qla_hw_data *ha)
>  	return (u8 *)&ha->hablob->fw->data[offset];
>  }
>  
> -static __le32
> -qla82xx_get_fw_size(struct qla_hw_data *ha)
> +static u32 qla82xx_get_fw_size(struct qla_hw_data *ha)
>  {
>  	struct qla82xx_uri_data_desc *uri_desc = NULL;
>  
> @@ -1624,7 +1623,7 @@ qla82xx_get_fw_size(struct qla_hw_data *ha)
>  			return cpu_to_le32(uri_desc->size);
>  	}
>  
> -	return cpu_to_le32(*(u32 *)&ha->hablob->fw->data[FW_SIZE_OFFSET]);
> +	return get_unaligned_le32(&ha->hablob->fw->data[FW_SIZE_OFFSET]);
>  }
>  
>  static u8 *
> @@ -1816,7 +1815,7 @@ qla82xx_fw_load_from_blob(struct qla_hw_data *ha)
>  	}
>  
>  	flashaddr = FLASH_ADDR_START;
> -	size = (__force u32)qla82xx_get_fw_size(ha) / 8;
> +	size = qla82xx_get_fw_size(ha) / 8;
>  	ptr64 = (u64 *)qla82xx_get_fw_offs(ha);
>  
>  	for (i = 0; i < size; i++) {

  reply	other threads:[~2019-12-19  8:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-19  0:49 [PATCH] qla2xxx: Fix the endianness of the qla82xx_get_fw_size() return type Bart Van Assche
2019-12-19  8:39 ` Daniel Wagner [this message]
2019-12-20 14:23 ` Roman Bolshakov
2020-01-03  2:55 ` Martin K. Petersen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191219083921.2w3iibvbg2e53tg3@boron \
    --to=dwagner@suse.de \
    --cc=bvanassche@acm.org \
    --cc=hch@lst.de \
    --cc=hmadhani@marvell.com \
    --cc=jejb@linux.vnet.ibm.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=mwilck@suse.com \
    --cc=qutran@marvell.com \
    --cc=r.bolshakov@yadro.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).