Skip to content

Commit f458783

Browse files
Yang GuangNobody
authored andcommitted
libbpf: remove unneeded conversion to bool
The coccinelle report ./tools/lib/bpf/libbpf.c:1644:43-48: WARNING: conversion to bool not needed here Relational and logical operators evaluate to bool, explicit conversion is overly verbose and unneeded. Reported-by: Zeal Robot <zealci@zte.com.cn> Signed-off-by: Yang Guang <yang.guang5@zte.com.cn>
1 parent 9c9090c commit f458783

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/lib/bpf/libbpf.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1641,7 +1641,7 @@ static int set_kcfg_value_tri(struct extern_desc *ext, void *ext_val,
16411641
ext->name, value);
16421642
return -EINVAL;
16431643
}
1644-
*(bool *)ext_val = value == 'y' ? true : false;
1644+
*(bool *)ext_val = value == 'y';
16451645
break;
16461646
case KCFG_TRISTATE:
16471647
if (value == 'y')

0 commit comments

Comments
 (0)