]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
lib/bug: remove unnecessary variable initializations
authorJosh Law <objecting@objecting.org>
Fri, 6 Mar 2026 16:24:18 +0000 (16:24 +0000)
committerAndrew Morton <akpm@linux-foundation.org>
Sat, 28 Mar 2026 04:19:42 +0000 (21:19 -0700)
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>
lib/bug.c

index d7faa1255f859077aaeb61df1c1af9a32af47dee..bbc301097749b6e95b2b7e2d029061ddbb120f92 100644 (file)
--- 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);