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>
Cc: linux-scsi@vger.kernel.org, Bart Van Assche <bvanassche@acm.org>,
	Arnd Bergmann <arnd@arndb.de>, kernel test robot <lkp@intel.com>,
	"James E.J. Bottomley" <jejb@linux.ibm.com>,
	Stanley Chu <stanley.chu@mediatek.com>,
	Can Guo <quic_cang@quicinc.com>,
	Manivannan Sadhasivam <mani@kernel.org>,
	Asutosh Das <quic_asutoshd@quicinc.com>,
	"Bao D. Nguyen" <quic_nguyenb@quicinc.com>,
	Bean Huo <beanhuo@micron.com>,
	Arthur Simchaev <Arthur.Simchaev@wdc.com>,
	Avri Altman <avri.altman@wdc.com>
Subject: [PATCH] scsi: ufs: Fix the build for big endian 32-bit ARM systems
Date: Sun, 27 Aug 2023 16:30:35 -0700	[thread overview]
Message-ID: <20230827233042.12945-1-bvanassche@acm.org> (raw)

Although it is not clear to me why, this patch fixes the following build
error for big endian 32-bit ARM systems:

include/linux/build_bug.h:78:41: error: static assertion failed: "sizeof(struct utp_upiu_header) == 12"

Cc: Arnd Bergmann <arnd@arndb.de>
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202308251634.tuRn4OVv-lkp@intel.com/
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/ufs/core/ufshcd.c        |  6 +++---
 include/uapi/scsi/scsi_bsg_ufs.h | 10 +++-------
 2 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
index 88daf5cb0fe6..e124f66b1f77 100644
--- a/drivers/ufs/core/ufshcd.c
+++ b/drivers/ufs/core/ufshcd.c
@@ -2645,7 +2645,7 @@ static void ufshcd_prepare_utp_query_req_upiu(struct ufs_hba *hba,
 		.flags = upiu_flags,
 		.lun = lrbp->lun,
 		.task_tag = lrbp->task_tag,
-		.query_function = query->request.query_func,
+		.tm_or_query_function = query->request.query_func,
 		/* Data segment length only need for WRITE_DESC */
 		.data_segment_length =
 			query->request.upiu_req.opcode ==
@@ -7004,7 +7004,7 @@ static int ufshcd_issue_tm_cmd(struct ufs_hba *hba, int lun_id, int task_id,
 	/* Configure task request UPIU */
 	treq.upiu_req.req_header.transaction_code = UPIU_TRANSACTION_TASK_REQ;
 	treq.upiu_req.req_header.lun = lun_id;
-	treq.upiu_req.req_header.tm_function = tm_function;
+	treq.upiu_req.req_header.tm_or_query_function = tm_function;
 
 	/*
 	 * The host shall provide the same value for LUN field in the basic
@@ -7160,7 +7160,7 @@ int ufshcd_exec_raw_upiu_cmd(struct ufs_hba *hba,
 	enum dev_cmd_type cmd_type = DEV_CMD_TYPE_QUERY;
 	struct utp_task_req_desc treq = { };
 	enum utp_ocs ocs_value;
-	u8 tm_f = req_upiu->header.tm_function;
+	u8 tm_f = req_upiu->header.tm_or_query_function;
 
 	switch (msgcode) {
 	case UPIU_TRANSACTION_NOP_OUT:
diff --git a/include/uapi/scsi/scsi_bsg_ufs.h b/include/uapi/scsi/scsi_bsg_ufs.h
index bf1832dc35db..165b8443bde8 100644
--- a/include/uapi/scsi/scsi_bsg_ufs.h
+++ b/include/uapi/scsi/scsi_bsg_ufs.h
@@ -50,9 +50,8 @@ enum ufs_rpmb_op_type {
  * @task_tag: Task tag.
  * @iid: Initiator ID.
  * @command_set_type: 0 for SCSI command set; 1 for UFS specific.
- * @tm_function: Task management function in case of a task management request
- *	UPIU.
- * @query_function: Query function in case of a query request UPIU.
+ * @tm_or_query_function: Task management function in case of a task management
+ *	request	UPIU; query function in case of a query request UPIU.
  * @response: 0 for success; 1 for failure.
  * @status: SCSI status if this is the header of a response to a SCSI command.
  * @ehs_length: EHS length in units of 32 bytes.
@@ -80,10 +79,7 @@ struct utp_upiu_header {
 #else
 #error
 #endif
-			union {
-				__u8 tm_function;
-				__u8 query_function;
-			};
+			__u8 tm_or_query_function;
 			__u8 response;
 			__u8 status;
 			__u8 ehs_length;

             reply	other threads:[~2023-08-27 23:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-27 23:30 Bart Van Assche [this message]
2023-08-28  0:28 ` [PATCH] scsi: ufs: Fix the build for big endian 32-bit ARM systems Arnd Bergmann
2023-08-29 16:02   ` Bart Van Assche

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=20230827233042.12945-1-bvanassche@acm.org \
    --to=bvanassche@acm.org \
    --cc=Arthur.Simchaev@wdc.com \
    --cc=arnd@arndb.de \
    --cc=avri.altman@wdc.com \
    --cc=beanhuo@micron.com \
    --cc=jejb@linux.ibm.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=mani@kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=quic_asutoshd@quicinc.com \
    --cc=quic_cang@quicinc.com \
    --cc=quic_nguyenb@quicinc.com \
    --cc=stanley.chu@mediatek.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