Skip to contentSkip to conversation

kernel/irq/matrix.c: remove redundant assignment to variable 'end'

PATCH Applied Colin Ian King 4 participants 5 messages Apr 22, 2022 – Apr 25, 2022

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

PATCH 1/1 kernel/irq/matrix.c: remove redundant assignment to variable 'end'

Variable end is being initialized with a value that is never read, it is being re-assigned later with the same value. The initialization is redundant and can be removed.

Cleans up clang scan build warning:
kernel/irq/matrix.c:289:25: warning: Value stored to 'end' during its initialization is never read [deadcode.DeadStores]

---
 kernel/irq/matrix.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/irq/matrix.c +1 -1
index bbfb26489aa1..1698e77645ac 100644
@@ -286,7 +286,7 @@ void irq_matrix_remove_managed(struct irq_matrix *m, const struct cpumask *msk)
 int irq_matrix_alloc_managed(struct irq_matrix *m, const struct cpumask *msk,
 			     unsigned int *mapped_cpu)
 {
-	unsigned int bit, cpu, end = m->alloc_end;
+	unsigned int bit, cpu, end;
 	struct cpumap *cm;
 
 	if (cpumask_empty(msk))
Signature · 1 line
2.35.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 18 lines · Colin Ian King

Variable end is being initialized with a value that is never read, it is being re-assigned later with the same value. The initialization is redundant and can be removed.

Cleans up clang scan build warning:
kernel/irq/matrix.c:289:25: warning: Value stored to 'end' during its initialization is never read [deadcode.DeadStores]

---
  kernel/irq/matrix.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
kernel/irq/matrix.c +0 -0
index bbfb26489aa1..1698e77645ac 100644

kernel/irq/matrix.c void irq_matrix_remove_managed(struct irq_matrix *m, const struct cpumask *msk) · line 289

Quoted 5 lines
kernel/irq/matrix.c +1 -1
@@ -286,7 +286,7 @@ void irq_matrix_remove_managed(struct irq_matrix *m, const struct cpumask *msk)
  int irq_matrix_alloc_managed(struct irq_matrix *m, const struct cpumask *msk,
  			     unsigned int *mapped_cpu)
  {
-	unsigned int bit, cpu, end = m->alloc_end;
+	unsigned int bit, cpu, end;
Quoted 3 lines
kernel/irq/matrix.c +0 -0
  	struct cpumap *cm;
 
  	if (cpumask_empty(msk))
merge bot Applied
#4 lore raw

[tip: irq/core] genirq/matrix: Remove redundant assignment to variable 'end'

In reply to Colin Ian King
The following commit has been merged into the irq/core branch of tip:

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

Commit-ID:     1adb4d7ad3a585b451f5cf6b0a90c5917af3eac5
Gitweb:        https://git.kernel.org/tip/1adb4d7ad3a585b451f5cf6b0a90c5917af3eac5
Author:        Colin Ian King <[email protected]>
AuthorDate:    Fri, 22 Apr 2022 12:04:18 +01:00
Committer:     Thomas Gleixner <[email protected]>
CommitterDate: Mon, 25 Apr 2022 15:02:57 +02:00

genirq/matrix: Remove redundant assignment to variable 'end'

Variable end is being initialized with a value that is never read, it is being re-assigned later with the same value. The initialization is redundant and can be removed.

Cleans up clang scan build warning:
kernel/irq/matrix.c:289:25: warning: Value stored to 'end' during its initialization is never read [deadcode.DeadStores]

---
 kernel/irq/matrix.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/irq/matrix.c +1 -1
index bbfb264..1698e77 100644
@@ -286,7 +286,7 @@ void irq_matrix_remove_managed(struct irq_matrix *m, const struct cpumask *msk)
 int irq_matrix_alloc_managed(struct irq_matrix *m, const struct cpumask *msk,
 			     unsigned int *mapped_cpu)
 {
-	unsigned int bit, cpu, end = m->alloc_end;
+	unsigned int bit, cpu, end;
 	struct cpumap *cm;
 
 	if (cpumask_empty(msk))