* [PATCH] mtd: nand: fix boolreturn.cocci warning
@ 2021-12-06 12:15 Yihao Han
2021-12-09 16:54 ` Miquel Raynal
0 siblings, 1 reply; 2+ messages in thread
From: Yihao Han @ 2021-12-06 12:15 UTC (permalink / raw)
To: Miquel Raynal, Richard Weinberger, Vignesh Raghavendra,
linux-mtd, linux-kernel
Cc: kernel, Yihao Han
./drivers/mtd/nand/core.c:25:9-10: WARNING: return of 0/1 in
function 'nanddev_isbad' with return type bool
Return statements in functions returning bool should use true/false
instead of 1/0.
Signed-off-by: Yihao Han <hanyihao@vivo.com>
---
drivers/mtd/nand/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/mtd/nand/core.c b/drivers/mtd/nand/core.c
index 33c7788d76c2..416947f28b67 100644
--- a/drivers/mtd/nand/core.c
+++ b/drivers/mtd/nand/core.c
@@ -22,7 +22,7 @@
bool nanddev_isbad(struct nand_device *nand, const struct nand_pos *pos)
{
if (WARN_ONCE(mtd_expert_analysis_mode, mtd_expert_analysis_warning))
- return 0;
+ return false;
if (nanddev_bbt_is_initialized(nand)) {
unsigned int entry;
--
2.17.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] mtd: nand: fix boolreturn.cocci warning
2021-12-06 12:15 [PATCH] mtd: nand: fix boolreturn.cocci warning Yihao Han
@ 2021-12-09 16:54 ` Miquel Raynal
0 siblings, 0 replies; 2+ messages in thread
From: Miquel Raynal @ 2021-12-09 16:54 UTC (permalink / raw)
To: Yihao Han
Cc: Richard Weinberger, Vignesh Raghavendra, linux-mtd, linux-kernel, kernel
Hi Yihao,
hanyihao@vivo.com wrote on Mon, 6 Dec 2021 04:15:30 -0800:
> ./drivers/mtd/nand/core.c:25:9-10: WARNING: return of 0/1 in
> function 'nanddev_isbad' with return type bool
>
> Return statements in functions returning bool should use true/false
> instead of 1/0.
This is -next material, I want to have a clean branch there so I
applied this change inline, I hope you don't mind.
>
> Signed-off-by: Yihao Han <hanyihao@vivo.com>
> ---
> drivers/mtd/nand/core.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/mtd/nand/core.c b/drivers/mtd/nand/core.c
> index 33c7788d76c2..416947f28b67 100644
> --- a/drivers/mtd/nand/core.c
> +++ b/drivers/mtd/nand/core.c
> @@ -22,7 +22,7 @@
> bool nanddev_isbad(struct nand_device *nand, const struct nand_pos *pos)
> {
> if (WARN_ONCE(mtd_expert_analysis_mode, mtd_expert_analysis_warning))
> - return 0;
> + return false;
>
> if (nanddev_bbt_is_initialized(nand)) {
> unsigned int entry;
Thanks,
Miquèl
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-12-09 16:54 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-06 12:15 [PATCH] mtd: nand: fix boolreturn.cocci warning Yihao Han
2021-12-09 16:54 ` Miquel Raynal
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).