linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche@acm.org>
To: Avri Altman <avri.altman@sandisk.com>,
	"Martin K . Petersen" <martin.petersen@oracle.com>
Cc: linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] scsi: ufs: Clear ucd_rsp_ptr for UPIU requests once
Date: Tue, 17 Jun 2025 13:35:26 -0700	[thread overview]
Message-ID: <289fa5bc-ffb5-4ceb-a03c-dd79f282d2fe@acm.org> (raw)
In-Reply-To: <20250617095611.89229-2-avri.altman@sandisk.com>

On 6/17/25 2:56 AM, Avri Altman wrote:
> Previously, the response buffer (ucd_rsp_ptr) was cleared in multiple
> UPIU preparation functions. Do it once.
> 
> Signed-off-by: Avri Altman <avri.altman@sandisk.com>
> ---
>   drivers/ufs/core/ufshcd.c | 6 ++----
>   1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
> index 0a702356a715..c2048aca09fc 100644
> --- a/drivers/ufs/core/ufshcd.c
> +++ b/drivers/ufs/core/ufshcd.c
> @@ -2826,8 +2826,6 @@ static void ufshcd_prepare_utp_query_req_upiu(struct ufs_hba *hba,
>   	/* Copy the Descriptor */
>   	if (query->request.upiu_req.opcode == UPIU_QUERY_OPCODE_WRITE_DESC)
>   		memcpy(ucd_req_ptr + 1, query->descriptor, len);
> -
> -	memset(lrbp->ucd_rsp_ptr, 0, sizeof(struct utp_upiu_rsp));
>   }
>   
>   static inline void ufshcd_prepare_utp_nop_upiu(struct ufshcd_lrb *lrbp)
> @@ -2840,8 +2838,6 @@ static inline void ufshcd_prepare_utp_nop_upiu(struct ufshcd_lrb *lrbp)
>   		.transaction_code = UPIU_TRANSACTION_NOP_OUT,
>   		.task_tag = lrbp->task_tag,
>   	};
> -
> -	memset(lrbp->ucd_rsp_ptr, 0, sizeof(struct utp_upiu_rsp));
>   }
>   
>   /**
> @@ -2867,6 +2863,8 @@ static int ufshcd_compose_devman_upiu(struct ufs_hba *hba,
>   	else
>   		ret = -EINVAL;
>   
> +	memset(lrbp->ucd_rsp_ptr, 0, sizeof(struct utp_upiu_rsp));
> +
>   	return ret;
>   }

Reviewed-by: Bart Van Assche <bvanassche@acm.org>

  reply	other threads:[~2025-06-17 20:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-17  9:56 [PATCH 0/2] scsi: ufs: Two minor optimizations in query UPIU preparation Avri Altman
2025-06-17  9:56 ` [PATCH 1/2] scsi: ufs: Clear ucd_rsp_ptr for UPIU requests once Avri Altman
2025-06-17 20:35   ` Bart Van Assche [this message]
2025-06-20  2:54   ` Martin K. Petersen
2025-06-17  9:56 ` [PATCH 2/2] scsi: ufs: Document NOP_OUT transaction code Avri Altman
2025-06-17 15:59   ` Bart Van Assche
2025-06-25  1:44 ` (subset) [PATCH 0/2] scsi: ufs: Two minor optimizations in query UPIU preparation 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=289fa5bc-ffb5-4ceb-a03c-dd79f282d2fe@acm.org \
    --to=bvanassche@acm.org \
    --cc=avri.altman@sandisk.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.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).