diff mbox series

[-next] mtd: ubi: Simplify bool conversion

Message ID 20230215012117.83938-1-yang.lee@linux.alibaba.com
State Accepted
Delegated to: Richard Weinberger
Headers show
Series [-next] mtd: ubi: Simplify bool conversion | expand

Commit Message

Yang Li Feb. 15, 2023, 1:21 a.m. UTC
./drivers/mtd/ubi/build.c:1261:33-38: WARNING: conversion to bool not needed here

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4061
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
---
 drivers/mtd/ubi/build.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Zhihao Cheng March 20, 2023, 2:28 a.m. UTC | #1
在 2023/2/15 9:21, Yang Li 写道:
> ./drivers/mtd/ubi/build.c:1261:33-38: WARNING: conversion to bool not needed here
> 
> Reported-by: Abaci Robot <abaci@linux.alibaba.com>
> Link: https://bugzilla.openanolis.cn/show_bug.cgi?id=4061
> Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
> ---
>   drivers/mtd/ubi/build.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c
> index 0904eb40c95f..e9c153b7c471 100644
> --- a/drivers/mtd/ubi/build.c
> +++ b/drivers/mtd/ubi/build.c
> @@ -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.

Reviewed-by: Zhihao Cheng <chengzhihao1@huawei.com>
diff mbox series

Patch

diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c
index 0904eb40c95f..e9c153b7c471 100644
--- a/drivers/mtd/ubi/build.c
+++ b/drivers/mtd/ubi/build.c
@@ -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",