[PATCH] mtd: nand: fix boolreturn.cocci warning

Yihao Han hanyihao at vivo.com
Mon Dec 6 04:15:30 PST 2021


./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 at 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




More information about the linux-mtd mailing list