[PATCH] scsi: ufs: ufs-mediatek: Modify the return value

Bart Van Assche bvanassche at acm.org
Fri Nov 18 09:30:04 PST 2022


On 11/17/22 20:52, Chanwoo Lee wrote:
> From: ChanWoo Lee <cw9316.lee at samsung.com>
> 
> Change the same as the other code to return bool type.
>    91: 	return !!(host->caps & UFS_MTK_CAP_BOOST_CRYPT_ENGINE);
>    98: 	return !!(host->caps & UFS_MTK_CAP_VA09_PWR_CTRL);
>    105:	return !!(host->caps & UFS_MTK_CAP_BROKEN_VCC);
> 
> Signed-off-by: ChanWoo Lee <cw9316.lee at samsung.com>
> ---
>   drivers/ufs/host/ufs-mediatek.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/ufs/host/ufs-mediatek.c b/drivers/ufs/host/ufs-mediatek.c
> index 7d13878dff47..ef5816d82326 100644
> --- a/drivers/ufs/host/ufs-mediatek.c
> +++ b/drivers/ufs/host/ufs-mediatek.c
> @@ -109,7 +109,7 @@ static bool ufs_mtk_is_pmc_via_fastauto(struct ufs_hba *hba)
>   {
>   	struct ufs_mtk_host *host = ufshcd_get_variant(hba);
>   
> -	return (host->caps & UFS_MTK_CAP_PMC_VIA_FASTAUTO);
> +	return !!(host->caps & UFS_MTK_CAP_PMC_VIA_FASTAUTO);
>   }

Hi ChanWoo,

Please drop this patch and instead remove the !! from the other functions
that have return type 'bool'. There is more Linux kernel code that relies on
the implicit conversion from type 'int' to 'bool' than code that converts
explicitly from 'int' to 'bool'.

Thanks,

Bart.




More information about the Linux-mediatek mailing list