Skip to contentSkip to conversation

mtd: ubi: Simplify bool conversion

PATCH In review Yang Li 2 participants 2 messages Feb 15, 2023 – Mar 20, 2023

Subsystems (2)
lore
Share & tools
lore

Yang Li

author
#0 lore raw

PATCH 1/1 mtd: ubi: Simplify bool conversion

./drivers/mtd/ubi/build.c:1261:33-38: WARNING: conversion to bool not needed here

---
 drivers/mtd/ubi/build.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/ubi/build.c +1 -1
index 0904eb40c95f..e9c153b7c471 100644
@@ -1258,7 +1258,7 @@ static int __init ubi_init(void)
 		mutex_lock(&ubi_devices_mutex);
 		err = ubi_attach_mtd_dev(mtd, p->ubi_num,
 					 p->vid_hdr_offs, p->max_beb_per1024,
-					 p->enable_fm == 0 ? true : false);
+					 p->enable_fm == 0);
 		mutex_unlock(&ubi_devices_mutex);
 		if (err < 0) {
 			pr_err("UBI error: cannot attach mtd%d\n",
Signature · 6 lines
2.20.1.7.g153144c


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/
reviewer Reviewed-by on v1 1/1
#1 lore raw
Quoted 15 lines · Yang Li

./drivers/mtd/ubi/build.c:1261:33-38: WARNING: conversion to bool not needed here

---
  drivers/mtd/ubi/build.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/ubi/build.c +0 -0
index 0904eb40c95f..e9c153b7c471 100644

drivers/mtd/ubi/build.c static int __init ubi_init(void) · line 1264

Quoted 8 lines
drivers/mtd/ubi/build.c +1 -1
@@ -1258,7 +1258,7 @@ static int __init ubi_init(void)
  		mutex_lock(&ubi_devices_mutex);
  		err = ubi_attach_mtd_dev(mtd, p->ubi_num,
  					 p->vid_hdr_offs, p->max_beb_per1024,
-					 p->enable_fm == 0 ? true : false);
+					 p->enable_fm == 0);
  		mutex_unlock(&ubi_devices_mutex);
  		if (err < 0) {
  			pr_err("UBI error: cannot attach mtd%d\n",

Looks good.