[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1586779076-101346-1-git-send-email-zou_wei@huawei.com>
Date: Mon, 13 Apr 2020 19:57:56 +0800
From: Zou Wei <zou_wei@...wei.com>
To: <ast@...nel.org>, <daniel@...earbox.net>, <kafai@...com>,
<songliubraving@...com>, <yhs@...com>, <andriin@...com>,
<john.fastabend@...il.com>, <kpsingh@...omium.org>,
<netdev@...r.kernel.org>, <bpf@...r.kernel.org>,
<linux-kernel@...r.kernel.org>
CC: Zou Wei <zou_wei@...wei.com>
Subject: [PATCH-next] bpf: Verifier, remove unneeded conversion to bool
This issue was detected by using the Coccinelle software:
kernel/bpf/verifier.c:1259:16-21: WARNING: conversion to bool not needed here
The conversion to bool is unneeded, remove it
Reported-by: Hulk Robot <hulkci@...wei.com>
Signed-off-by: Zou Wei <zou_wei@...wei.com>
---
kernel/bpf/verifier.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/kernel/bpf/verifier.c b/kernel/bpf/verifier.c
index 04c6630..38cfcf7 100644
--- a/kernel/bpf/verifier.c
+++ b/kernel/bpf/verifier.c
@@ -1255,8 +1255,7 @@ static void __mark_reg_unknown(const struct bpf_verifier_env *env,
reg->type = SCALAR_VALUE;
reg->var_off = tnum_unknown;
reg->frameno = 0;
- reg->precise = env->subprog_cnt > 1 || !env->allow_ptr_leaks ?
- true : false;
+ reg->precise = env->subprog_cnt > 1 || !env->allow_ptr_leaks;
__mark_reg_unbounded(reg);
}
--
2.6.2
Powered by blists - more mailing lists