LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Avri Altman <Avri.Altman@wdc.com>
To: Bean Huo <huobean@gmail.com>,
	"alim.akhtar@samsung.com" <alim.akhtar@samsung.com>,
	"martin.petersen@oracle.com" <martin.petersen@oracle.com>,
	"stanley.chu@mediatek.com" <stanley.chu@mediatek.com>,
	"beanhuo@micron.com" <beanhuo@micron.com>,
	"bvanassche@acm.org" <bvanassche@acm.org>,
	"cang@codeaurora.org" <cang@codeaurora.org>
Cc: "linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: RE: [PATCH] scsi: ufs: Remove useless if-state in ufshcd_add_command_trace
Date: Wed, 4 Aug 2021 06:38:32 +0000	[thread overview]
Message-ID: <DM6PR04MB65755981B606ECC00D1F198BFCF19@DM6PR04MB6575.namprd04.prod.outlook.com> (raw)
In-Reply-To: <20210802180803.100033-1-huobean@gmail.com>

> 
> From: Bean Huo <beanhuo@micron.com>
> 
> ufshcd_add_cmd_upiu_trace() will be called anyway, so move if-state down,
> make code simpler.
> 
> Signed-off-by: Bean Huo <beanhuo@micron.com>
Reviewed-by: Avri Altman <avri.altman@wdc.com>


> ---
>  drivers/scsi/ufs/ufshcd.c | 9 +++------
>  1 file changed, 3 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index
> 064a44e628d6..02f54153fd6d 100644
> --- a/drivers/scsi/ufs/ufshcd.c
> +++ b/drivers/scsi/ufs/ufshcd.c
> @@ -380,14 +380,11 @@ static void ufshcd_add_command_trace(struct
> ufs_hba *hba, unsigned int tag,
>         if (!cmd)
>                 return;
> 
> -       if (!trace_ufshcd_command_enabled()) {
> -               /* trace UPIU W/O tracing command */
> -               ufshcd_add_cmd_upiu_trace(hba, tag, str_t);
> -               return;
> -       }
> -
>         /* trace UPIU also */
>         ufshcd_add_cmd_upiu_trace(hba, tag, str_t);
> +       if (!trace_ufshcd_command_enabled())
> +               return;
> +
>         opcode = cmd->cmnd[0];
>         lba = scsi_get_lba(cmd);
> 
> --
> 2.25.1


  reply	other threads:[~2021-08-04  6:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-02 18:08 Bean Huo
2021-08-04  6:38 ` Avri Altman [this message]
2021-08-06  3:11 ` Martin K. Petersen
2021-08-10  5:20 ` 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=DM6PR04MB65755981B606ECC00D1F198BFCF19@DM6PR04MB6575.namprd04.prod.outlook.com \
    --to=avri.altman@wdc.com \
    --cc=alim.akhtar@samsung.com \
    --cc=beanhuo@micron.com \
    --cc=bvanassche@acm.org \
    --cc=cang@codeaurora.org \
    --cc=huobean@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=stanley.chu@mediatek.com \
    --subject='RE: [PATCH] scsi: ufs: Remove useless if-state in ufshcd_add_command_trace' \
    /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

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).