diff mbox series

scsi: ufs: change upiu_flags to be u8

Message ID 20200706123936.24799-1-huobean@gmail.com (mailing list archive)
State Accepted
Headers show
Series scsi: ufs: change upiu_flags to be u8 | expand

Commit Message

Bean Huo July 6, 2020, 12:39 p.m. UTC
From: Bean Huo <beanhuo@micron.com>

According to the UFS Spec, the Flags in the UPIU is one-byte length, not
4 bytes. change it to be u8.

Signed-off-by: Bean Huo <beanhuo@micron.com>
---
 drivers/scsi/ufs/ufshcd.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

Comments

Avri Altman July 6, 2020, 2:03 p.m. UTC | #1
> 
> 
> From: Bean Huo <beanhuo@micron.com>
> 
> According to the UFS Spec, the Flags in the UPIU is one-byte length, not
> 4 bytes. change it to be u8.
> 
> Signed-off-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Avri Altman <avri.altman@wdc.com>
Alim Akhtar July 6, 2020, 3:33 p.m. UTC | #2
Hi Bean

> -----Original Message-----
> From: Bean Huo <huobean@gmail.com>
> Sent: 06 July 2020 18:10
> To: alim.akhtar@samsung.com; avri.altman@wdc.com;
> asutoshd@codeaurora.org; jejb@linux.ibm.com; martin.petersen@oracle.com;
> stanley.chu@mediatek.com; beanhuo@micron.com; bvanassche@acm.org;
> tomas.winkler@intel.com; cang@codeaurora.org
> Cc: linux-scsi@vger.kernel.org; linux-kernel@vger.kernel.org
> Subject: [PATCH] scsi: ufs: change upiu_flags to be u8
> 
> From: Bean Huo <beanhuo@micron.com>
> 
> According to the UFS Spec, the Flags in the UPIU is one-byte length, not
> 4 bytes. change it to be u8.
> 
> Signed-off-by: Bean Huo <beanhuo@micron.com>
> ---
Reviewed-by: Alim Akhtar <alim.akhtar@samsung.com>
Booted and tested on exynos7 board, tested basic read/write, so
Tested-by: Alim Akhtar <alim.akhtar@samsung.com>

Thanks,

>  drivers/scsi/ufs/ufshcd.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index
> 96d830bb900f..d7fd5891e81f 100644
> --- a/drivers/scsi/ufs/ufshcd.c
> +++ b/drivers/scsi/ufs/ufshcd.c
> @@ -2240,7 +2240,7 @@ static void ufshcd_disable_intr(struct ufs_hba *hba,
> u32 intrs)
>   * @cmd_dir: requests data direction
>   */
>  static void ufshcd_prepare_req_desc_hdr(struct ufshcd_lrb *lrbp,
> -			u32 *upiu_flags, enum dma_data_direction cmd_dir)
> +			u8 *upiu_flags, enum dma_data_direction cmd_dir)
>  {
>  	struct utp_transfer_req_desc *req_desc = lrbp->utr_descriptor_ptr;
>  	u32 data_direction;
> @@ -2286,7 +2286,7 @@ static void ufshcd_prepare_req_desc_hdr(struct
> ufshcd_lrb *lrbp,
>   * @upiu_flags: flags
>   */
>  static
> -void ufshcd_prepare_utp_scsi_cmd_upiu(struct ufshcd_lrb *lrbp, u32
> upiu_flags)
> +void ufshcd_prepare_utp_scsi_cmd_upiu(struct ufshcd_lrb *lrbp, u8
> +upiu_flags)
>  {
>  	struct scsi_cmnd *cmd = lrbp->cmd;
>  	struct utp_upiu_req *ucd_req_ptr = lrbp->ucd_req_ptr; @@ -2319,7
> +2319,7 @@ void ufshcd_prepare_utp_scsi_cmd_upiu(struct ufshcd_lrb *lrbp,
> u32 upiu_flags)
>   * @upiu_flags: flags
>   */
>  static void ufshcd_prepare_utp_query_req_upiu(struct ufs_hba *hba,
> -				struct ufshcd_lrb *lrbp, u32 upiu_flags)
> +				struct ufshcd_lrb *lrbp, u8 upiu_flags)
>  {
>  	struct utp_upiu_req *ucd_req_ptr = lrbp->ucd_req_ptr;
>  	struct ufs_query *query = &hba->dev_cmd.query; @@ -2376,7 +2376,7
> @@ static inline void ufshcd_prepare_utp_nop_upiu(struct ufshcd_lrb *lrbp)
> static int ufshcd_compose_devman_upiu(struct ufs_hba *hba,
>  				      struct ufshcd_lrb *lrbp)
>  {
> -	u32 upiu_flags;
> +	u8 upiu_flags;
>  	int ret = 0;
> 
>  	if ((hba->ufs_version == UFSHCI_VERSION_10) || @@ -2404,7 +2404,7
> @@ static int ufshcd_compose_devman_upiu(struct ufs_hba *hba,
>   */
>  static int ufshcd_comp_scsi_upiu(struct ufs_hba *hba, struct ufshcd_lrb
*lrbp)  {
> -	u32 upiu_flags;
> +	u8 upiu_flags;
>  	int ret = 0;
> 
>  	if ((hba->ufs_version == UFSHCI_VERSION_10) || @@ -6124,7 +6124,7
> @@ static int ufshcd_issue_devman_upiu_cmd(struct ufs_hba *hba,
>  	int tag;
>  	struct completion wait;
>  	unsigned long flags;
> -	u32 upiu_flags;
> +	u8 upiu_flags;
> 
>  	down_read(&hba->clk_scaling_lock);
> 
> --
> 2.17.1
Martin K. Petersen July 8, 2020, 6:06 a.m. UTC | #3
On Mon, 6 Jul 2020 14:39:36 +0200, Bean Huo wrote:

> According to the UFS Spec, the Flags in the UPIU is one-byte length, not
> 4 bytes. change it to be u8.

Applied to 5.9/scsi-queue, thanks!

[1/1] scsi: ufs: Change upiu_flags to be u8
      https://git.kernel.org/mkp/scsi/c/a23064c4123b
diff mbox series

Patch

diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c
index 96d830bb900f..d7fd5891e81f 100644
--- a/drivers/scsi/ufs/ufshcd.c
+++ b/drivers/scsi/ufs/ufshcd.c
@@ -2240,7 +2240,7 @@  static void ufshcd_disable_intr(struct ufs_hba *hba, u32 intrs)
  * @cmd_dir: requests data direction
  */
 static void ufshcd_prepare_req_desc_hdr(struct ufshcd_lrb *lrbp,
-			u32 *upiu_flags, enum dma_data_direction cmd_dir)
+			u8 *upiu_flags, enum dma_data_direction cmd_dir)
 {
 	struct utp_transfer_req_desc *req_desc = lrbp->utr_descriptor_ptr;
 	u32 data_direction;
@@ -2286,7 +2286,7 @@  static void ufshcd_prepare_req_desc_hdr(struct ufshcd_lrb *lrbp,
  * @upiu_flags: flags
  */
 static
-void ufshcd_prepare_utp_scsi_cmd_upiu(struct ufshcd_lrb *lrbp, u32 upiu_flags)
+void ufshcd_prepare_utp_scsi_cmd_upiu(struct ufshcd_lrb *lrbp, u8 upiu_flags)
 {
 	struct scsi_cmnd *cmd = lrbp->cmd;
 	struct utp_upiu_req *ucd_req_ptr = lrbp->ucd_req_ptr;
@@ -2319,7 +2319,7 @@  void ufshcd_prepare_utp_scsi_cmd_upiu(struct ufshcd_lrb *lrbp, u32 upiu_flags)
  * @upiu_flags: flags
  */
 static void ufshcd_prepare_utp_query_req_upiu(struct ufs_hba *hba,
-				struct ufshcd_lrb *lrbp, u32 upiu_flags)
+				struct ufshcd_lrb *lrbp, u8 upiu_flags)
 {
 	struct utp_upiu_req *ucd_req_ptr = lrbp->ucd_req_ptr;
 	struct ufs_query *query = &hba->dev_cmd.query;
@@ -2376,7 +2376,7 @@  static inline void ufshcd_prepare_utp_nop_upiu(struct ufshcd_lrb *lrbp)
 static int ufshcd_compose_devman_upiu(struct ufs_hba *hba,
 				      struct ufshcd_lrb *lrbp)
 {
-	u32 upiu_flags;
+	u8 upiu_flags;
 	int ret = 0;
 
 	if ((hba->ufs_version == UFSHCI_VERSION_10) ||
@@ -2404,7 +2404,7 @@  static int ufshcd_compose_devman_upiu(struct ufs_hba *hba,
  */
 static int ufshcd_comp_scsi_upiu(struct ufs_hba *hba, struct ufshcd_lrb *lrbp)
 {
-	u32 upiu_flags;
+	u8 upiu_flags;
 	int ret = 0;
 
 	if ((hba->ufs_version == UFSHCI_VERSION_10) ||
@@ -6124,7 +6124,7 @@  static int ufshcd_issue_devman_upiu_cmd(struct ufs_hba *hba,
 	int tag;
 	struct completion wait;
 	unsigned long flags;
-	u32 upiu_flags;
+	u8 upiu_flags;
 
 	down_read(&hba->clk_scaling_lock);