Skip to contentSkip to conversation

x86/unwind/orc: remove redundant initialization of pointer mid

PATCH Applied Colin Ian King 2 participants 2 messages Sep 20, 2023 – Sep 21, 2023

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 x86/unwind/orc: remove redundant initialization of pointer mid

The pointer mid is being initialized with a value that is never read, it is being re-assigned and used inside a for-loop. Remove the redundant initialization. Cleans up clang scan build warning:

arch/x86/kernel/unwind_orc.c:88:7: warning: Value stored to 'mid' during its initialization is never read [deadcode.DeadStores]

---
 arch/x86/kernel/unwind_orc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kernel/unwind_orc.c +1 -1
index 7e574cf3bf8a..d00c28aaa5be 100644
@@ -85,7 +85,7 @@ static struct orc_entry *__orc_find(int *ip_table, struct orc_entry *u_table,
 {
 	int *first = ip_table;
 	int *last = ip_table + num_entries - 1;
-	int *mid = first, *found = first;
+	int *mid, *found = first;
 
 	if (!num_entries)
 		return NULL;
Signature · 1 line
2.39.2
merge bot Applied
#1 lore raw

[tip: objtool/core] x86/unwind/orc: Remove redundant initialization of 'mid' pointer in __orc_find()

The following commit has been merged into the objtool/core branch of tip:

The following commit has been merged into the objtool/core branch of tip:

Commit-ID:     fef44ebaf61b57a71ab818058926a3f9a0ac81e6
Gitweb:        https://git.kernel.org/tip/fef44ebaf61b57a71ab818058926a3f9a0ac81e6
Author:        Colin Ian King <[email protected]>
AuthorDate:    Wed, 20 Sep 2023 12:41:41 +01:00
Committer:     Ingo Molnar <[email protected]>
CommitterDate: Thu, 21 Sep 2023 08:41:23 +02:00

x86/unwind/orc: Remove redundant initialization of 'mid' pointer in __orc_find()

The 'mid' pointer is being initialized with a value that is never read, it is being re-assigned and used inside a for-loop. Remove the redundant initialization.

Cleans up clang scan build warning:

arch/x86/kernel/unwind_orc.c:88:7: warning: Value stored to 'mid' during its initialization is never read [deadcode.DeadStores]

---
 arch/x86/kernel/unwind_orc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kernel/unwind_orc.c +1 -1
index 7e574cf..d00c28a 100644
@@ -85,7 +85,7 @@ static struct orc_entry *__orc_find(int *ip_table, struct orc_entry *u_table,
 {
 	int *first = ip_table;
 	int *last = ip_table + num_entries - 1;
-	int *mid = first, *found = first;
+	int *mid, *found = first;
 
 	if (!num_entries)
 		return NULL;