linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] scsi: ufs: ufs-mediatek: Modify the return value
       [not found] <CGME20221118045326epcas1p408c9e16a58201043c9eb3c99110fab0c@epcas1p4.samsung.com>
@ 2022-11-18  4:52 ` Chanwoo Lee
  2022-11-18  5:42   ` Stanley Chu
                     ` (4 more replies)
  0 siblings, 5 replies; 9+ messages in thread
From: Chanwoo Lee @ 2022-11-18  4:52 UTC (permalink / raw)
  To: stanley.chu, jejb, martin.petersen, matthias.bgg, linux-scsi,
	linux-mediatek
  Cc: ChanWoo Lee

From: ChanWoo Lee <cw9316.lee@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@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);
 }
 
 static void ufs_mtk_cfg_unipro_cg(struct ufs_hba *hba, bool enable)
-- 
2.29.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH] scsi: ufs: ufs-mediatek: Modify the return value
  2022-11-18  4:52 ` [PATCH] scsi: ufs: ufs-mediatek: Modify the return value Chanwoo Lee
@ 2022-11-18  5:42   ` Stanley Chu
  2022-11-18 10:39   ` AngeloGioacchino Del Regno
                     ` (3 subsequent siblings)
  4 siblings, 0 replies; 9+ messages in thread
From: Stanley Chu @ 2022-11-18  5:42 UTC (permalink / raw)
  To: Chanwoo Lee
  Cc: stanley.chu, jejb, martin.petersen, matthias.bgg, linux-scsi,
	linux-mediatek

On Fri, Nov 18, 2022 at 12:57 PM Chanwoo Lee <cw9316.lee@samsung.com> wrote:
>
> From: ChanWoo Lee <cw9316.lee@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@samsung.com>

Reviewed-by: Stanley Chu <stanley.chu@mediatek.com>

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] scsi: ufs: ufs-mediatek: Modify the return value
  2022-11-18  4:52 ` [PATCH] scsi: ufs: ufs-mediatek: Modify the return value Chanwoo Lee
  2022-11-18  5:42   ` Stanley Chu
@ 2022-11-18 10:39   ` AngeloGioacchino Del Regno
  2022-11-18 17:30   ` Bart Van Assche
                     ` (2 subsequent siblings)
  4 siblings, 0 replies; 9+ messages in thread
From: AngeloGioacchino Del Regno @ 2022-11-18 10:39 UTC (permalink / raw)
  To: Chanwoo Lee, stanley.chu, jejb, martin.petersen, matthias.bgg,
	linux-scsi, linux-mediatek

Il 18/11/22 05:52, Chanwoo Lee ha scritto:
> From: ChanWoo Lee <cw9316.lee@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@samsung.com>
> Reviewed-by: Stanley Chu <stanley.chu@mediatek.com>

Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>




^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] scsi: ufs: ufs-mediatek: Modify the return value
  2022-11-18  4:52 ` [PATCH] scsi: ufs: ufs-mediatek: Modify the return value Chanwoo Lee
  2022-11-18  5:42   ` Stanley Chu
  2022-11-18 10:39   ` AngeloGioacchino Del Regno
@ 2022-11-18 17:30   ` Bart Van Assche
  2022-11-18 21:34     ` Finn Thain
  2022-11-26  2:11   ` Martin K. Petersen
  2022-12-01  3:45   ` Martin K. Petersen
  4 siblings, 1 reply; 9+ messages in thread
From: Bart Van Assche @ 2022-11-18 17:30 UTC (permalink / raw)
  To: Chanwoo Lee, stanley.chu, jejb, martin.petersen, matthias.bgg,
	linux-scsi, linux-mediatek

On 11/17/22 20:52, Chanwoo Lee wrote:
> From: ChanWoo Lee <cw9316.lee@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@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.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] scsi: ufs: ufs-mediatek: Modify the return value
  2022-11-18 17:30   ` Bart Van Assche
@ 2022-11-18 21:34     ` Finn Thain
  2022-11-18 21:44       ` Bart Van Assche
  0 siblings, 1 reply; 9+ messages in thread
From: Finn Thain @ 2022-11-18 21:34 UTC (permalink / raw)
  To: Bart Van Assche
  Cc: Chanwoo Lee, stanley.chu, jejb, martin.petersen, matthias.bgg,
	linux-scsi, linux-mediatek


On Fri, 18 Nov 2022, Bart Van Assche wrote:

> There is more Linux kernel code that [...] than code that [...]. 

Thus mediocrity prevails.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] scsi: ufs: ufs-mediatek: Modify the return value
  2022-11-18 21:34     ` Finn Thain
@ 2022-11-18 21:44       ` Bart Van Assche
  2022-11-18 22:29         ` Finn Thain
  0 siblings, 1 reply; 9+ messages in thread
From: Bart Van Assche @ 2022-11-18 21:44 UTC (permalink / raw)
  To: Finn Thain
  Cc: Chanwoo Lee, stanley.chu, jejb, martin.petersen, matthias.bgg,
	linux-scsi, linux-mediatek

On 11/18/22 13:34, Finn Thain wrote:
> On Fri, 18 Nov 2022, Bart Van Assche wrote:
> 
>> There is more Linux kernel code that [...] than code that [...].
> 
> Thus mediocrity prevails.

Mediocrity? I don't understand the above comment. Personally I prefer 
the style without !! and I don't think that it's a mediocre style.

Bart.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] scsi: ufs: ufs-mediatek: Modify the return value
  2022-11-18 21:44       ` Bart Van Assche
@ 2022-11-18 22:29         ` Finn Thain
  0 siblings, 0 replies; 9+ messages in thread
From: Finn Thain @ 2022-11-18 22:29 UTC (permalink / raw)
  To: Bart Van Assche
  Cc: Chanwoo Lee, stanley.chu, jejb, martin.petersen, matthias.bgg,
	linux-scsi, linux-mediatek


On Fri, 18 Nov 2022, Bart Van Assche wrote:

> On 11/18/22 13:34, Finn Thain wrote:
> > On Fri, 18 Nov 2022, Bart Van Assche wrote:
> > 
> >> There is more Linux kernel code that [...] than code that [...].
> > 
> > Thus mediocrity prevails.
> 
> Mediocrity? I don't understand the above comment. 

I'm afraid it was poorly expressed.

> Personally I prefer the style without !! and I don't think that it's a 
> mediocre style.
> 

My comment goes to the rationale you gave not the decision you made.

Regarding the decision, it's a choice between "explicit is better than 
implicit" and "brevity is better than redundancy". The patch opted for the 
former, you opted for the latter. I also have an opinion, but I'm not the 
maintainer so I'll keep it to myself.

Regarding the rationale, a maintainer who merely follows the majority is 
not actually doing code review. This will lead to mediocrity.

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] scsi: ufs: ufs-mediatek: Modify the return value
  2022-11-18  4:52 ` [PATCH] scsi: ufs: ufs-mediatek: Modify the return value Chanwoo Lee
                     ` (2 preceding siblings ...)
  2022-11-18 17:30   ` Bart Van Assche
@ 2022-11-26  2:11   ` Martin K. Petersen
  2022-12-01  3:45   ` Martin K. Petersen
  4 siblings, 0 replies; 9+ messages in thread
From: Martin K. Petersen @ 2022-11-26  2:11 UTC (permalink / raw)
  To: Chanwoo Lee
  Cc: stanley.chu, jejb, martin.petersen, matthias.bgg, linux-scsi,
	linux-mediatek


Chanwoo,

> Change the same as the other code to return bool type.

Applied to 6.2/scsi-staging, thanks!

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH] scsi: ufs: ufs-mediatek: Modify the return value
  2022-11-18  4:52 ` [PATCH] scsi: ufs: ufs-mediatek: Modify the return value Chanwoo Lee
                     ` (3 preceding siblings ...)
  2022-11-26  2:11   ` Martin K. Petersen
@ 2022-12-01  3:45   ` Martin K. Petersen
  4 siblings, 0 replies; 9+ messages in thread
From: Martin K. Petersen @ 2022-12-01  3:45 UTC (permalink / raw)
  To: linux-mediatek, jejb, matthias.bgg, Chanwoo Lee, linux-scsi, stanley.chu
  Cc: Martin K . Petersen

On Fri, 18 Nov 2022 13:52:42 +0900, Chanwoo Lee wrote:

> From: ChanWoo Lee <cw9316.lee@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);
> 
> [...]

Applied to 6.2/scsi-queue, thanks!

[1/1] scsi: ufs: ufs-mediatek: Modify the return value
      https://git.kernel.org/mkp/scsi/c/96a2dfa1df4b

-- 
Martin K. Petersen	Oracle Linux Engineering

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2022-12-01  3:46 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <CGME20221118045326epcas1p408c9e16a58201043c9eb3c99110fab0c@epcas1p4.samsung.com>
2022-11-18  4:52 ` [PATCH] scsi: ufs: ufs-mediatek: Modify the return value Chanwoo Lee
2022-11-18  5:42   ` Stanley Chu
2022-11-18 10:39   ` AngeloGioacchino Del Regno
2022-11-18 17:30   ` Bart Van Assche
2022-11-18 21:34     ` Finn Thain
2022-11-18 21:44       ` Bart Van Assche
2022-11-18 22:29         ` Finn Thain
2022-11-26  2:11   ` Martin K. Petersen
2022-12-01  3:45   ` Martin K. Petersen

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