All of lore.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, Avri Altman <avri.altman@wdc.com>,
	Adrian Hunter <adrian.hunter@intel.com>,
	Bart Van Assche <bvanassche@acm.org>,
	"James E.J. Bottomley" <jejb@linux.ibm.com>,
	Stanley Chu <stanley.chu@mediatek.com>,
	Can Guo <quic_cang@quicinc.com>,
	Asutosh Das <quic_asutoshd@quicinc.com>,
	"Bao D. Nguyen" <quic_nguyenb@quicinc.com>,
	Bean Huo <beanhuo@micron.com>,
	Arthur Simchaev <Arthur.Simchaev@wdc.com>,
	Manivannan Sadhasivam <mani@kernel.org>,
	Po-Wen Kao <powen.kao@mediatek.com>,
	Eric Biggers <ebiggers@google.com>,
	Keoseong Park <keosung.park@samsung.com>,
	Daniil Lunev <dlunev@chromium.org>
Subject: [PATCH v2 10/12] scsi: ufs: Remove a member variable
Date: Thu, 27 Jul 2023 12:41:22 -0700	[thread overview]
Message-ID: <20230727194457.3152309-11-bvanassche@acm.org> (raw)
In-Reply-To: <20230727194457.3152309-1-bvanassche@acm.org>

Remove the 'response' member variable because no code reads its value.
Additionally, move the ufs_query_req and ufs_query_res data structure
definitions into include/ufs/ufshcd.h because these data structures
are related to the UFS host controller driver.

Reviewed-by: Avri Altman <avri.altman@wdc.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
---
 drivers/ufs/core/ufshcd.c |  6 +-----
 include/ufs/ufs.h         | 20 --------------------
 include/ufs/ufshcd.h      | 19 +++++++++++++++++++
 3 files changed, 20 insertions(+), 25 deletions(-)

diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
index bf76ea59ba6c..4348b0dfde29 100644
--- a/drivers/ufs/core/ufshcd.c
+++ b/drivers/ufs/core/ufshcd.c
@@ -3014,12 +3014,8 @@ static int ufshcd_clear_cmd(struct ufs_hba *hba, u32 task_tag)
 static int
 ufshcd_check_query_response(struct ufs_hba *hba, struct ufshcd_lrb *lrbp)
 {
-	struct ufs_query_res *query_res = &hba->dev_cmd.query.response;
-
-	/* Get the UPIU response */
-	query_res->response = ufshcd_get_rsp_upiu_result(lrbp->ucd_rsp_ptr) >>
+	return ufshcd_get_rsp_upiu_result(lrbp->ucd_rsp_ptr) >>
 				UPIU_RSP_CODE_OFFSET;
-	return query_res->response;
 }
 
 /**
diff --git a/include/ufs/ufs.h b/include/ufs/ufs.h
index 797bf033c19a..0ee1fdf2fe83 100644
--- a/include/ufs/ufs.h
+++ b/include/ufs/ufs.h
@@ -537,26 +537,6 @@ struct utp_upiu_rsp {
 	};
 };
 
-/**
- * struct ufs_query_req - parameters for building a query request
- * @query_func: UPIU header query function
- * @upiu_req: the query request data
- */
-struct ufs_query_req {
-	u8 query_func;
-	struct utp_upiu_query upiu_req;
-};
-
-/**
- * struct ufs_query_resp - UPIU QUERY
- * @response: device response code
- * @upiu_res: query response data
- */
-struct ufs_query_res {
-	u8 response;
-	struct utp_upiu_query upiu_res;
-};
-
 /*
  * VCCQ & VCCQ2 current requirement when UFS device is in sleep state
  * and link is in Hibern8 state.
diff --git a/include/ufs/ufshcd.h b/include/ufs/ufshcd.h
index 2b1f4f2a4464..bf4070a4b95f 100644
--- a/include/ufs/ufshcd.h
+++ b/include/ufs/ufshcd.h
@@ -202,6 +202,25 @@ struct ufshcd_lrb {
 	bool req_abort_skip;
 };
 
+/**
+ * struct ufs_query_req - parameters for building a query request
+ * @query_func: UPIU header query function
+ * @upiu_req: the query request data
+ */
+struct ufs_query_req {
+	u8 query_func;
+	struct utp_upiu_query upiu_req;
+};
+
+/**
+ * struct ufs_query_resp - UPIU QUERY
+ * @response: device response code
+ * @upiu_res: query response data
+ */
+struct ufs_query_res {
+	struct utp_upiu_query upiu_res;
+};
+
 /**
  * struct ufs_query - holds relevant data structures for query request
  * @request: request upiu and function

  parent reply	other threads:[~2023-07-27 19:48 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-27 19:41 [PATCH v2 00/12] Multiple cleanup patches for the UFS driver Bart Van Assche
2023-07-27 19:41 ` [PATCH v2 01/12] scsi: ufs: Follow the kernel-doc syntax for documenting return values Bart Van Assche
2023-07-27 19:41 ` [PATCH v2 02/12] scsi: ufs: Document all " Bart Van Assche
2023-07-27 19:41 ` [PATCH v2 03/12] scsi: ufs: Fix kernel-doc headers Bart Van Assche
2023-07-27 19:41 ` [PATCH v2 04/12] scsi: ufs: Rename a function argument Bart Van Assche
2023-07-27 19:41 ` [PATCH v2 05/12] scsi: ufs: Minimize #include directives Bart Van Assche
2023-07-27 19:41 ` [PATCH v2 06/12] scsi: ufs: Simplify zero-initialization Bart Van Assche
2023-07-27 19:41 ` [PATCH v2 07/12] scsi: ufs: Improve type safety Bart Van Assche
2023-07-27 19:41 ` [PATCH v2 08/12] scsi: ufs: Remove a local variable from ufshcd_abort_all() Bart Van Assche
2023-07-27 19:41 ` [PATCH v2 09/12] scsi: ufs: Simplify ufshcd_abort_all() Bart Van Assche
2023-11-15  6:57   ` Peter Wang (王信友)
2023-11-15 19:13     ` Bart Van Assche
2023-07-27 19:41 ` Bart Van Assche [this message]
2023-07-27 19:41 ` [PATCH v2 11/12] scsi: ufs: Simplify transfer request header initialization Bart Van Assche
2023-07-28 13:40   ` Avri Altman
2023-08-02 11:25   ` Kumar, Udit
2023-08-02 16:05     ` Bart Van Assche
2023-08-02 16:44       ` Kumar, Udit
2023-08-02 16:46         ` Bart Van Assche
2023-07-27 19:41 ` [PATCH v2 12/12] scsi: ufs: Simplify response header parsing Bart Van Assche
2023-07-28 13:54   ` Avri Altman
2023-07-31 19:19 ` [PATCH v2 00/12] Multiple cleanup patches for the UFS driver Martin K. Petersen
2023-08-08  2:50 ` 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=20230727194457.3152309-11-bvanassche@acm.org \
    --to=bvanassche@acm.org \
    --cc=Arthur.Simchaev@wdc.com \
    --cc=adrian.hunter@intel.com \
    --cc=avri.altman@wdc.com \
    --cc=beanhuo@micron.com \
    --cc=dlunev@chromium.org \
    --cc=ebiggers@google.com \
    --cc=jejb@linux.ibm.com \
    --cc=keosung.park@samsung.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=mani@kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=powen.kao@mediatek.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.