summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosh Law <objecting@objecting.org>2026-03-06 19:24:18 +0300
committerAndrew Morton <akpm@linux-foundation.org>2026-03-28 07:19:42 +0300
commit228491c380cf0d569634587d4042f9a2ebb9f93e (patch)
tree81e9bbd0aae360d11139a01658ab4698ce2c978b
parent6a2804112d98d351df664d9209aa459a2e2fa0d0 (diff)
downloadlinux-228491c380cf0d569634587d4042f9a2ebb9f93e.tar.xz
lib/bug: remove unnecessary variable initializations
Remove the unnecessary initialization of 'rcu' to false in report_bug_entry() and report_bug(), as it is assigned by warn_rcu_enter() before its first use. Link: https://lkml.kernel.org/r/20260306162418.2815979-1-objecting@objecting.org Signed-off-by: Josh Law <objecting@objecting.org> Reviewed-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
-rw-r--r--lib/bug.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/bug.c b/lib/bug.c
index d7faa1255f85..bbc301097749 100644
--- a/lib/bug.c
+++ b/lib/bug.c
@@ -263,7 +263,7 @@ static enum bug_trap_type __report_bug(struct bug_entry *bug, unsigned long buga
enum bug_trap_type report_bug_entry(struct bug_entry *bug, struct pt_regs *regs)
{
enum bug_trap_type ret;
- bool rcu = false;
+ bool rcu;
rcu = warn_rcu_enter();
ret = __report_bug(bug, bug_addr(bug), regs);
@@ -275,7 +275,7 @@ enum bug_trap_type report_bug_entry(struct bug_entry *bug, struct pt_regs *regs)
enum bug_trap_type report_bug(unsigned long bugaddr, struct pt_regs *regs)
{
enum bug_trap_type ret;
- bool rcu = false;
+ bool rcu;
rcu = warn_rcu_enter();
ret = __report_bug(NULL, bugaddr, regs);