* [PATCH] mmc: Assign boolean values to a bool variable
@ 2021-01-20 7:39 Jiapeng Zhong
2021-01-21 21:20 ` Ludovic Desroches
2021-01-22 9:44 ` Ulf Hansson
0 siblings, 2 replies; 3+ messages in thread
From: Jiapeng Zhong @ 2021-01-20 7:39 UTC (permalink / raw)
To: ludovic.desroches
Cc: ulf.hansson, nicolas.ferre, alexandre.belloni, linux-mmc,
linux-arm-kernel, linux-kernel, Jiapeng Zhong
Fix the following coccicheck warnings:
./drivers/mmc/host/atmel-mci.c:2436:2-34: WARNING: Assignment
of 0/1 to bool variable.
./drivers/mmc/host/atmel-mci.c:2425:2-20: WARNING: Assignment
of 0/1 to bool variable.
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Jiapeng Zhong <abaci-bugfix@linux.alibaba.com>
---
drivers/mmc/host/atmel-mci.c | 46 ++++++++++++++++++++++----------------------
1 file changed, 23 insertions(+), 23 deletions(-)
diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
index 444bd3a..6324120 100644
--- a/drivers/mmc/host/atmel-mci.c
+++ b/drivers/mmc/host/atmel-mci.c
@@ -2401,45 +2401,45 @@ static void atmci_get_cap(struct atmel_mci *host)
dev_info(&host->pdev->dev,
"version: 0x%x\n", version);
- host->caps.has_dma_conf_reg = 0;
- host->caps.has_pdc = 1;
- host->caps.has_cfg_reg = 0;
- host->caps.has_cstor_reg = 0;
- host->caps.has_highspeed = 0;
- host->caps.has_rwproof = 0;
- host->caps.has_odd_clk_div = 0;
- host->caps.has_bad_data_ordering = 1;
- host->caps.need_reset_after_xfer = 1;
- host->caps.need_blksz_mul_4 = 1;
- host->caps.need_notbusy_for_read_ops = 0;
+ host->caps.has_dma_conf_reg = false;
+ host->caps.has_pdc = true;
+ host->caps.has_cfg_reg = false;
+ host->caps.has_cstor_reg = false;
+ host->caps.has_highspeed = false;
+ host->caps.has_rwproof = false;
+ host->caps.has_odd_clk_div = false;
+ host->caps.has_bad_data_ordering = true;
+ host->caps.need_reset_after_xfer = true;
+ host->caps.need_blksz_mul_4 = true;
+ host->caps.need_notbusy_for_read_ops = false;
/* keep only major version number */
switch (version & 0xf00) {
case 0x600:
case 0x500:
- host->caps.has_odd_clk_div = 1;
+ host->caps.has_odd_clk_div = true;
fallthrough;
case 0x400:
case 0x300:
- host->caps.has_dma_conf_reg = 1;
- host->caps.has_pdc = 0;
- host->caps.has_cfg_reg = 1;
- host->caps.has_cstor_reg = 1;
- host->caps.has_highspeed = 1;
+ host->caps.has_dma_conf_reg = true;
+ host->caps.has_pdc = false;
+ host->caps.has_cfg_reg = true;
+ host->caps.has_cstor_reg = true;
+ host->caps.has_highspeed = true;
fallthrough;
case 0x200:
- host->caps.has_rwproof = 1;
- host->caps.need_blksz_mul_4 = 0;
- host->caps.need_notbusy_for_read_ops = 1;
+ host->caps.has_rwproof = true;
+ host->caps.need_blksz_mul_4 = false;
+ host->caps.need_notbusy_for_read_ops = true;
fallthrough;
case 0x100:
- host->caps.has_bad_data_ordering = 0;
- host->caps.need_reset_after_xfer = 0;
+ host->caps.has_bad_data_ordering = false;
+ host->caps.need_reset_after_xfer = false;
fallthrough;
case 0x0:
break;
default:
- host->caps.has_pdc = 0;
+ host->caps.has_pdc = false;
dev_warn(&host->pdev->dev,
"Unmanaged mci version, set minimum capabilities\n");
break;
--
1.8.3.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] mmc: Assign boolean values to a bool variable
2021-01-20 7:39 [PATCH] mmc: Assign boolean values to a bool variable Jiapeng Zhong
@ 2021-01-21 21:20 ` Ludovic Desroches
2021-01-22 9:44 ` Ulf Hansson
1 sibling, 0 replies; 3+ messages in thread
From: Ludovic Desroches @ 2021-01-21 21:20 UTC (permalink / raw)
To: Jiapeng Zhong
Cc: ulf.hansson, nicolas.ferre, alexandre.belloni, linux-mmc,
linux-arm-kernel, linux-kernel
On Wed, Jan 20, 2021 at 03:39:37PM +0800, Jiapeng Zhong wrote:
> Fix the following coccicheck warnings:
>
> ./drivers/mmc/host/atmel-mci.c:2436:2-34: WARNING: Assignment
> of 0/1 to bool variable.
>
> ./drivers/mmc/host/atmel-mci.c:2425:2-20: WARNING: Assignment
> of 0/1 to bool variable.
>
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Jiapeng Zhong <abaci-bugfix@linux.alibaba.com>
Acked-by: Ludovic Desroches <ludovic.desroches@microchip.com>
Thanks
> ---
> drivers/mmc/host/atmel-mci.c | 46 ++++++++++++++++++++++----------------------
> 1 file changed, 23 insertions(+), 23 deletions(-)
>
> diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
> index 444bd3a..6324120 100644
> --- a/drivers/mmc/host/atmel-mci.c
> +++ b/drivers/mmc/host/atmel-mci.c
> @@ -2401,45 +2401,45 @@ static void atmci_get_cap(struct atmel_mci *host)
> dev_info(&host->pdev->dev,
> "version: 0x%x\n", version);
>
> - host->caps.has_dma_conf_reg = 0;
> - host->caps.has_pdc = 1;
> - host->caps.has_cfg_reg = 0;
> - host->caps.has_cstor_reg = 0;
> - host->caps.has_highspeed = 0;
> - host->caps.has_rwproof = 0;
> - host->caps.has_odd_clk_div = 0;
> - host->caps.has_bad_data_ordering = 1;
> - host->caps.need_reset_after_xfer = 1;
> - host->caps.need_blksz_mul_4 = 1;
> - host->caps.need_notbusy_for_read_ops = 0;
> + host->caps.has_dma_conf_reg = false;
> + host->caps.has_pdc = true;
> + host->caps.has_cfg_reg = false;
> + host->caps.has_cstor_reg = false;
> + host->caps.has_highspeed = false;
> + host->caps.has_rwproof = false;
> + host->caps.has_odd_clk_div = false;
> + host->caps.has_bad_data_ordering = true;
> + host->caps.need_reset_after_xfer = true;
> + host->caps.need_blksz_mul_4 = true;
> + host->caps.need_notbusy_for_read_ops = false;
>
> /* keep only major version number */
> switch (version & 0xf00) {
> case 0x600:
> case 0x500:
> - host->caps.has_odd_clk_div = 1;
> + host->caps.has_odd_clk_div = true;
> fallthrough;
> case 0x400:
> case 0x300:
> - host->caps.has_dma_conf_reg = 1;
> - host->caps.has_pdc = 0;
> - host->caps.has_cfg_reg = 1;
> - host->caps.has_cstor_reg = 1;
> - host->caps.has_highspeed = 1;
> + host->caps.has_dma_conf_reg = true;
> + host->caps.has_pdc = false;
> + host->caps.has_cfg_reg = true;
> + host->caps.has_cstor_reg = true;
> + host->caps.has_highspeed = true;
> fallthrough;
> case 0x200:
> - host->caps.has_rwproof = 1;
> - host->caps.need_blksz_mul_4 = 0;
> - host->caps.need_notbusy_for_read_ops = 1;
> + host->caps.has_rwproof = true;
> + host->caps.need_blksz_mul_4 = false;
> + host->caps.need_notbusy_for_read_ops = true;
> fallthrough;
> case 0x100:
> - host->caps.has_bad_data_ordering = 0;
> - host->caps.need_reset_after_xfer = 0;
> + host->caps.has_bad_data_ordering = false;
> + host->caps.need_reset_after_xfer = false;
> fallthrough;
> case 0x0:
> break;
> default:
> - host->caps.has_pdc = 0;
> + host->caps.has_pdc = false;
> dev_warn(&host->pdev->dev,
> "Unmanaged mci version, set minimum capabilities\n");
> break;
> --
> 1.8.3.1
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] mmc: Assign boolean values to a bool variable
2021-01-20 7:39 [PATCH] mmc: Assign boolean values to a bool variable Jiapeng Zhong
2021-01-21 21:20 ` Ludovic Desroches
@ 2021-01-22 9:44 ` Ulf Hansson
1 sibling, 0 replies; 3+ messages in thread
From: Ulf Hansson @ 2021-01-22 9:44 UTC (permalink / raw)
To: Jiapeng Zhong
Cc: Ludovic Desroches, Nicolas Ferre, Alexandre Belloni, linux-mmc,
Linux ARM, Linux Kernel Mailing List
On Wed, 20 Jan 2021 at 08:39, Jiapeng Zhong
<abaci-bugfix@linux.alibaba.com> wrote:
>
> Fix the following coccicheck warnings:
>
> ./drivers/mmc/host/atmel-mci.c:2436:2-34: WARNING: Assignment
> of 0/1 to bool variable.
>
> ./drivers/mmc/host/atmel-mci.c:2425:2-20: WARNING: Assignment
> of 0/1 to bool variable.
>
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Signed-off-by: Jiapeng Zhong <abaci-bugfix@linux.alibaba.com>
Applied for next, thanks!
Kind regards
Uffe
> ---
> drivers/mmc/host/atmel-mci.c | 46 ++++++++++++++++++++++----------------------
> 1 file changed, 23 insertions(+), 23 deletions(-)
>
> diff --git a/drivers/mmc/host/atmel-mci.c b/drivers/mmc/host/atmel-mci.c
> index 444bd3a..6324120 100644
> --- a/drivers/mmc/host/atmel-mci.c
> +++ b/drivers/mmc/host/atmel-mci.c
> @@ -2401,45 +2401,45 @@ static void atmci_get_cap(struct atmel_mci *host)
> dev_info(&host->pdev->dev,
> "version: 0x%x\n", version);
>
> - host->caps.has_dma_conf_reg = 0;
> - host->caps.has_pdc = 1;
> - host->caps.has_cfg_reg = 0;
> - host->caps.has_cstor_reg = 0;
> - host->caps.has_highspeed = 0;
> - host->caps.has_rwproof = 0;
> - host->caps.has_odd_clk_div = 0;
> - host->caps.has_bad_data_ordering = 1;
> - host->caps.need_reset_after_xfer = 1;
> - host->caps.need_blksz_mul_4 = 1;
> - host->caps.need_notbusy_for_read_ops = 0;
> + host->caps.has_dma_conf_reg = false;
> + host->caps.has_pdc = true;
> + host->caps.has_cfg_reg = false;
> + host->caps.has_cstor_reg = false;
> + host->caps.has_highspeed = false;
> + host->caps.has_rwproof = false;
> + host->caps.has_odd_clk_div = false;
> + host->caps.has_bad_data_ordering = true;
> + host->caps.need_reset_after_xfer = true;
> + host->caps.need_blksz_mul_4 = true;
> + host->caps.need_notbusy_for_read_ops = false;
>
> /* keep only major version number */
> switch (version & 0xf00) {
> case 0x600:
> case 0x500:
> - host->caps.has_odd_clk_div = 1;
> + host->caps.has_odd_clk_div = true;
> fallthrough;
> case 0x400:
> case 0x300:
> - host->caps.has_dma_conf_reg = 1;
> - host->caps.has_pdc = 0;
> - host->caps.has_cfg_reg = 1;
> - host->caps.has_cstor_reg = 1;
> - host->caps.has_highspeed = 1;
> + host->caps.has_dma_conf_reg = true;
> + host->caps.has_pdc = false;
> + host->caps.has_cfg_reg = true;
> + host->caps.has_cstor_reg = true;
> + host->caps.has_highspeed = true;
> fallthrough;
> case 0x200:
> - host->caps.has_rwproof = 1;
> - host->caps.need_blksz_mul_4 = 0;
> - host->caps.need_notbusy_for_read_ops = 1;
> + host->caps.has_rwproof = true;
> + host->caps.need_blksz_mul_4 = false;
> + host->caps.need_notbusy_for_read_ops = true;
> fallthrough;
> case 0x100:
> - host->caps.has_bad_data_ordering = 0;
> - host->caps.need_reset_after_xfer = 0;
> + host->caps.has_bad_data_ordering = false;
> + host->caps.need_reset_after_xfer = false;
> fallthrough;
> case 0x0:
> break;
> default:
> - host->caps.has_pdc = 0;
> + host->caps.has_pdc = false;
> dev_warn(&host->pdev->dev,
> "Unmanaged mci version, set minimum capabilities\n");
> break;
> --
> 1.8.3.1
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-01-22 9:47 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-20 7:39 [PATCH] mmc: Assign boolean values to a bool variable Jiapeng Zhong
2021-01-21 21:20 ` Ludovic Desroches
2021-01-22 9:44 ` Ulf Hansson
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).