[PATCH v13 17/24] scsi: ufs: mediatek: Clean up logging prints

sashiko-bot at kernel.org sashiko-bot at kernel.org
Thu Oct 1 01:32:08 PDT 2026


Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [Medium] ufs: %pe obfuscates positive error from ufshcd_uic_change_pwr_mode()
--

commit 3b8bc7216dce3fa2b458c4095b432de91443fd2c
Author: Nicolas Frattaroli <nicolas.frattaroli at collabora.com>

scsi: ufs: mediatek: Clean up logging prints

This patch cleans up logging prints in the MediaTek UFS driver by
adjusting verbosity levels and using the %pe format specifier for
printing error pointers instead of generic integer logging.

> diff --git a/drivers/ufs/host/ufs-mediatek.c b/drivers/ufs/host/ufs-mediatek.c
> index 2edfa8bd877af..8e5a0a39ce6cf 100644
> --- a/drivers/ufs/host/ufs-mediatek.c
> +++ b/drivers/ufs/host/ufs-mediatek.c
[ ... ]
> @@ -1411,10 +1403,9 @@ static int ufs_mtk_pre_pwr_change(struct ufs_hba *hba,
>  		ret = ufshcd_uic_change_pwr_mode(hba,
>  					FASTAUTO_MODE << 4 | FASTAUTO_MODE);
>  
> -		if (ret) {
> -			dev_err(hba->dev, "%s: HSG1B FASTAUTO failed ret=%d\n",
> -				__func__, ret);
> -		}
> +		if (ret)
> +			dev_err(hba->dev, "%s: HSG1B FASTAUTO failed: %pe\n",
> +				__func__, ERR_PTR(ret));

[Severity: Medium]
When ufshcd_uic_change_pwr_mode() fails due to a positive UPMCRS status
code (e.g., PWR_REMOTE or PWR_BUSY), the returned positive value is
evaluated by if (ret) and passed to ERR_PTR().

Because the %pe format specifier checks IS_ERR(), which evaluates to false
for small positive integers, it will fall back to printing a hashed pointer
instead of the numeric error value. 

Will this obfuscate the actual error code during UFS link initialization or
power mode change failures?

>  	}
>  
>  	/* if already configured to the requested pwr_mode, skip adapt */

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261001-mt8196-ufs-v13-0-60854adab6d9@collabora.com?part=17



More information about the linux-phy mailing list