[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220307093942.21310-1-lukas.bulwahn@gmail.com>
Date: Mon, 7 Mar 2022 10:39:42 +0100
From: Lukas Bulwahn <lukas.bulwahn@...il.com>
To: Andrew Morton <akpm@...ux-foundation.org>
Cc: Balbir Singh <bsingharora@...il.com>, Tom Rix <trix@...hat.com>,
Nathan Chancellor <natechancellor@...il.com>,
Nick Desaulniers <ndesaulniers@...gle.com>,
clang-built-linux@...glegroups.com,
kernel-janitors@...r.kernel.org, linux-kernel@...r.kernel.org,
Lukas Bulwahn <lukas.bulwahn@...il.com>
Subject: [PATCH RESEND 2] taskstats: remove unneeded dead assignment
make clang-analyzer on x86_64 defconfig caught my attention with:
kernel/taskstats.c:120:2: warning: Value stored to 'rc' is never read \
[clang-analyzer-deadcode.DeadStores]
rc = 0;
^
Commit d94a041519f3 ("taskstats: free skb, avoid returns in
send_cpu_listeners") made send_cpu_listeners() not return a value and
hence, the rc variable remained only to be used within the loop where
it is always assigned before read and it does not need any other
initialisation.
So, simply remove this unneeded dead initializing assignment.
As compilers will detect this unneeded assignment and optimize this anyway,
the resulting object code is identical before and after this change.
No functional change. No change to object code.
Signed-off-by: Lukas Bulwahn <lukas.bulwahn@...il.com>
Reviewed-by: Nick Desaulniers <ndesaulniers@...gle.com>
---
added Nick's Reviewed tag from the first resend:
https://lore.kernel.org/all/CAKwvOdk68xzVVCCGgdEDj3fSD9nwgh8=7zi6QGa-hhxweRibYQ@mail.gmail.com/
Andrew, please pick this minor non-urgent clean-up patch.
Balbir Singh, mentioned in MAINTAINERS, has not been active lately.
kernel/taskstats.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/kernel/taskstats.c b/kernel/taskstats.c
index 2b4898b4752e..7cdf4018a9c5 100644
--- a/kernel/taskstats.c
+++ b/kernel/taskstats.c
@@ -117,7 +117,6 @@ static void send_cpu_listeners(struct sk_buff *skb,
genlmsg_end(skb, reply);
- rc = 0;
down_read(&listeners->sem);
list_for_each_entry(s, &listeners->list, list) {
skb_next = NULL;
--
2.17.1
Powered by blists - more mailing lists