libbpf: Remove unnecessary conversion to bool
Subsystems (4)
PATCH 1/1 libbpf: Remove unnecessary conversion to bool
Fix the following coccicheck warnings:
./tools/lib/bpf/libbpf.c:1487:43-48: WARNING: conversion to bool not needed here.
Reported-by Abaci Robot <[email protected]>
Signed-off-by Jiapeng Chong <[email protected]>
--- tools/lib/bpf/libbpf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/lib/bpf/libbpf.c +1 -1
@@ -1484,7 +1484,7 @@ static int set_kcfg_value_tri(struct extern_desc *ext, void *ext_val, ext->name, value);return -EINVAL ; } - *(bool *)ext_val = value =='y' ? true : false; + *(bool *)ext_val = value =='y' ;break ;case KCFG_TRISTATE :if (value =='y' )
Signature · 1 line
1.8.3.1
Quoted 9 lines · Jiapeng Chong
Fix the following coccicheck warnings:
./tools/lib/bpf/libbpf.c:1487:43-48: WARNING: conversion to bool not needed here.
Reported-by Abaci Robot <[email protected]>Signed-off-by Jiapeng Chong <[email protected]>---
I think this came up before already. I did this on purpose and I'd like to keep it that way in the code.
Quoted 19 lines
tools/lib/bpf/libbpf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tools/lib/bpf/libbpf.c +1
-2@@ -1484,7 +1484,7 @@ static int set_kcfg_value_tri(struct extern_desc *ext, void *ext_val, ext->name, value);return -EINVAL ; } - *(bool *)ext_val = value =='y' ? true : false; + *(bool *)ext_val = value =='y' ;break ;case KCFG_TRISTATE :if (value =='y' ) --1.8.3.1