diff mbox series

[v1] ufs: core: correct clear tm error log

Message ID 20231002125551.15111-1-peter.wang@mediatek.com (mailing list archive)
State Superseded
Headers show
Series [v1] ufs: core: correct clear tm error log | expand

Commit Message

Peter Wang (王信友) Oct. 2, 2023, 12:55 p.m. UTC
From: Peter Wang <peter.wang@mediatek.com>

The clear tm function error log is inverted.

Signed-off-by: Peter Wang <peter.wang@mediatek.com>
---
 drivers/ufs/core/ufshcd.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Avri Altman Oct. 2, 2023, 6:44 p.m. UTC | #1
> From: Peter Wang <peter.wang@mediatek.com>
> 
> The clear tm function error log is inverted.
> 
> Signed-off-by: Peter Wang <peter.wang@mediatek.com>
Reviewed-by: Avri Altman <avri.altman@wdc.com>

> ---
>  drivers/ufs/core/ufshcd.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c index
> c2df07545f96..4095d88eee44 100644
> --- a/drivers/ufs/core/ufshcd.c
> +++ b/drivers/ufs/core/ufshcd.c
> @@ -6895,7 +6895,7 @@ static int ufshcd_clear_tm_cmd(struct ufs_hba
> *hba, int tag)
>                         mask, 0, 1000, 1000);
> 
>         dev_err(hba->dev, "Clearing task management function with tag %d
> %s\n",
> -               tag, err ? "succeeded" : "failed");
> +               tag, err ? "failed" : "succeeded");
> 
>  out:
>         return err;
> --
> 2.18.0
Bart Van Assche Oct. 2, 2023, 8:33 p.m. UTC | #2
On 10/2/23 05:55, peter.wang@mediatek.com wrote:
> From: Peter Wang <peter.wang@mediatek.com>
> 
> The clear tm function error log is inverted.
> 
> Signed-off-by: Peter Wang <peter.wang@mediatek.com>
> ---
>   drivers/ufs/core/ufshcd.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
> index c2df07545f96..4095d88eee44 100644
> --- a/drivers/ufs/core/ufshcd.c
> +++ b/drivers/ufs/core/ufshcd.c
> @@ -6895,7 +6895,7 @@ static int ufshcd_clear_tm_cmd(struct ufs_hba *hba, int tag)
>   			mask, 0, 1000, 1000);
>   
>   	dev_err(hba->dev, "Clearing task management function with tag %d %s\n",
> -		tag, err ? "succeeded" : "failed");
> +		tag, err ? "failed" : "succeeded");
>   
>   out:
>   	return err;

Please consider changing "err ?" into "err < 0 ?" to make it more clear
that negative return values represent an error. Additionally, please
consider adding the following:

Fixes: 4693fad7d6d4 ("scsi: ufs: core: Log error handler activity")

Thanks,

Bart.
Peter Wang (王信友) Oct. 3, 2023, 2:18 a.m. UTC | #3
On Mon, 2023-10-02 at 13:33 -0700, Bart Van Assche wrote:
> Please consider changing "err ?" into "err < 0 ?" to make it more
> clear
> that negative return values represent an error. Additionally, please
> consider adding the following:
> 
> Fixes: 4693fad7d6d4 ("scsi: ufs: core: Log error handler activity")
> 
> Thanks,
> 
> Bart.

Hi Bart,

Thanks for review and good suggestion. will update next version.

Thanks.
Peter
diff mbox series

Patch

diff --git a/drivers/ufs/core/ufshcd.c b/drivers/ufs/core/ufshcd.c
index c2df07545f96..4095d88eee44 100644
--- a/drivers/ufs/core/ufshcd.c
+++ b/drivers/ufs/core/ufshcd.c
@@ -6895,7 +6895,7 @@  static int ufshcd_clear_tm_cmd(struct ufs_hba *hba, int tag)
 			mask, 0, 1000, 1000);
 
 	dev_err(hba->dev, "Clearing task management function with tag %d %s\n",
-		tag, err ? "succeeded" : "failed");
+		tag, err ? "failed" : "succeeded");
 
 out:
 	return err;