From: Yang Li <yang.lee@linux.alibaba.com>
To: tglx@linutronix.de
Cc: mingo@redhat.com, bp@alien8.de, x86@kernel.org, hpa@zytor.com,
nathan@kernel.org, ndesaulniers@google.com,
linux-kernel@vger.kernel.org, clang-built-linux@googlegroups.com,
Yang Li <yang.lee@linux.alibaba.com>
Subject: [PATCH] x86/unwind/orc: Remove redundant initialization of 'mid'
Date: Mon, 10 May 2021 17:43:35 +0800 [thread overview]
Message-ID: <1620639815-93579-1-git-send-email-yang.lee@linux.alibaba.com> (raw)
Pointer mid is being initialized however this value is never
read as mid is assigned an updated value in while statement.
Remove the redundant initialization. At the same time, adjust the
declarations order of variables to keep the "upside-down x-mas tree"
look of them.
Clean up clang warning:
arch/x86/kernel/unwind_orc.c:38:7: warning: Value stored to 'mid' during
its initialization is never read [clang-analyzer-deadcode.DeadStores]
Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
---
arch/x86/kernel/unwind_orc.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/arch/x86/kernel/unwind_orc.c b/arch/x86/kernel/unwind_orc.c
index a120253..bb76f4f 100644
--- a/arch/x86/kernel/unwind_orc.c
+++ b/arch/x86/kernel/unwind_orc.c
@@ -33,9 +33,10 @@ static inline unsigned long orc_ip(const int *ip)
static struct orc_entry *__orc_find(int *ip_table, struct orc_entry *u_table,
unsigned int num_entries, unsigned long ip)
{
- int *first = ip_table;
int *last = ip_table + num_entries - 1;
- int *mid = first, *found = first;
+ int *first = ip_table;
+ int *found = first;
+ int *mid;
if (!num_entries)
return NULL;
--
1.8.3.1
reply other threads:[~2021-05-10 9:43 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1620639815-93579-1-git-send-email-yang.lee@linux.alibaba.com \
--to=yang.lee@linux.alibaba.com \
--cc=bp@alien8.de \
--cc=clang-built-linux@googlegroups.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=tglx@linutronix.de \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox