public inbox for linux-scsi@vger.kernel.org
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: "Martin K . Petersen" <martin.petersen@oracle.com>,
	"James E . J . Bottomley" <jejb@linux.vnet.ibm.com>
Cc: linux-scsi@vger.kernel.org, Bart Van Assche <bvanassche@acm.org>,
	Quinn Tran <qutran@marvell.com>, Martin Wilck <mwilck@suse.com>,
	Daniel Wagner <dwagner@suse.de>,
	Roman Bolshakov <r.bolshakov@yadro.com>
Subject: [PATCH v2 6/6] qla2xxx: Fix the endianness annotations for the port attribute max_frame_size member
Date: Wed, 22 Jan 2020 20:23:45 -0800	[thread overview]
Message-ID: <20200123042345.23886-7-bvanassche@acm.org> (raw)
In-Reply-To: <20200123042345.23886-1-bvanassche@acm.org>

Make sure that sparse doesn't complain about the statements that load or
store the port attribute max_frame_size member. The port attribute data
structures represent FC protocol data and hence use big endian format.
This patch only changes the meaning of two ql_dbg() statements.

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>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/scsi/qla2xxx/qla_def.h |  4 ++--
 drivers/scsi/qla2xxx/qla_gs.c  | 14 ++++++--------
 2 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/drivers/scsi/qla2xxx/qla_def.h b/drivers/scsi/qla2xxx/qla_def.h
index 968f19995063..5c6bae116b58 100644
--- a/drivers/scsi/qla2xxx/qla_def.h
+++ b/drivers/scsi/qla2xxx/qla_def.h
@@ -2741,7 +2741,7 @@ struct ct_fdmiv2_port_attr {
 		uint8_t fc4_types[32];
 		uint32_t sup_speed;
 		uint32_t cur_speed;
-		uint32_t max_frame_size;
+		__be32	max_frame_size;
 		uint8_t os_dev_name[32];
 		uint8_t host_name[256];
 		uint8_t node_name[WWN_SIZE];
@@ -2772,7 +2772,7 @@ struct ct_fdmi_port_attr {
 		uint8_t fc4_types[32];
 		uint32_t sup_speed;
 		uint32_t cur_speed;
-		uint32_t max_frame_size;
+		__be32	max_frame_size;
 		uint8_t os_dev_name[32];
 		uint8_t host_name[256];
 	} a;
diff --git a/drivers/scsi/qla2xxx/qla_gs.c b/drivers/scsi/qla2xxx/qla_gs.c
index aaa4a5bbf2ff..594b366db0ef 100644
--- a/drivers/scsi/qla2xxx/qla_gs.c
+++ b/drivers/scsi/qla2xxx/qla_gs.c
@@ -1848,14 +1848,13 @@ qla2x00_fdmi_rpa(scsi_qla_host_t *vha)
 	eiter = entries + size;
 	eiter->type = cpu_to_be16(FDMI_PORT_MAX_FRAME_SIZE);
 	eiter->len = cpu_to_be16(4 + 4);
-	eiter->a.max_frame_size = IS_FWI2_CAPABLE(ha) ?
+	eiter->a.max_frame_size = cpu_to_be32(IS_FWI2_CAPABLE(ha) ?
 	    le16_to_cpu(icb24->frame_payload_size) :
-	    le16_to_cpu(ha->init_cb->frame_payload_size);
-	eiter->a.max_frame_size = cpu_to_be32(eiter->a.max_frame_size);
+	    le16_to_cpu(ha->init_cb->frame_payload_size));
 	size += 4 + 4;
 
 	ql_dbg(ql_dbg_disc, vha, 0x203c,
-	    "Max_Frame_Size=%x.\n", eiter->a.max_frame_size);
+	       "Max_Frame_Size=%x.\n", be32_to_cpu(eiter->a.max_frame_size));
 
 	/* OS device name. */
 	eiter = entries + size;
@@ -2419,14 +2418,13 @@ qla2x00_fdmiv2_rpa(scsi_qla_host_t *vha)
 	eiter = entries + size;
 	eiter->type = cpu_to_be16(FDMI_PORT_MAX_FRAME_SIZE);
 	eiter->len = cpu_to_be16(4 + 4);
-	eiter->a.max_frame_size = IS_FWI2_CAPABLE(ha) ?
+	eiter->a.max_frame_size = cpu_to_be32(IS_FWI2_CAPABLE(ha) ?
 	    le16_to_cpu(icb24->frame_payload_size) :
-	    le16_to_cpu(ha->init_cb->frame_payload_size);
-	eiter->a.max_frame_size = cpu_to_be32(eiter->a.max_frame_size);
+	    le16_to_cpu(ha->init_cb->frame_payload_size));
 	size += 4 + 4;
 
 	ql_dbg(ql_dbg_disc, vha, 0x20bc,
-	    "Max_Frame_Size = %x.\n", eiter->a.max_frame_size);
+	       "Max_Frame_Size = %x.\n", be32_to_cpu(eiter->a.max_frame_size));
 
 	/* OS device name. */
 	eiter = entries + size;

  parent reply	other threads:[~2020-01-23  4:24 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-23  4:23 [PATCH v2 0/6] qla2xxx patches for kernel v5.6 Bart Van Assche
2020-01-23  4:23 ` [PATCH v2 1/6] qla2xxx: Check locking assumptions at runtime in qla2x00_abort_srb() Bart Van Assche
2020-01-23  8:08   ` Daniel Wagner
2020-01-23  4:23 ` [PATCH v2 2/6] qla2xxx: Simplify the code for aborting SCSI commands Bart Van Assche
2020-01-23 10:17   ` Daniel Wagner
2020-01-24  3:12     ` Bart Van Assche
2020-01-24 10:44       ` Daniel Wagner
2020-01-23  4:23 ` [PATCH v2 3/6] qla2xxx: Suppress endianness complaints in qla2x00_configure_local_loop() Bart Van Assche
2020-01-23 10:35   ` Daniel Wagner
2020-01-23  4:23 ` [PATCH v2 4/6] qla2xxx: Fix sparse warnings triggered by the PCI state checking code Bart Van Assche
2020-01-23 10:36   ` Daniel Wagner
2020-02-25 18:09   ` Roman Bolshakov
2020-01-23  4:23 ` [PATCH v2 5/6] qla2xxx: Convert MAKE_HANDLE() from a define into an inline function Bart Van Assche
2020-01-23 10:39   ` Daniel Wagner
2020-01-24  3:13     ` Bart Van Assche
2020-01-23  4:23 ` Bart Van Assche [this message]
2020-01-23 10:47   ` [PATCH v2 6/6] qla2xxx: Fix the endianness annotations for the port attribute max_frame_size member Daniel Wagner
2020-02-25 18:43   ` Roman Bolshakov
2020-02-25 19:40     ` Bart Van Assche
2020-02-05  2:36 ` [PATCH v2 0/6] qla2xxx patches for kernel v5.6 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=20200123042345.23886-7-bvanassche@acm.org \
    --to=bvanassche@acm.org \
    --cc=dwagner@suse.de \
    --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