Skip to contentSkip to conversation

powerpc/cputable: Remove unnecessary copy of cpu_spec->oprofile_type

PATCH In review Leonardo Bras 4 participants 6 messages Feb 15, 2020 – Apr 1, 2020 PowerPC

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc/cputable: Remove unnecessary copy of cpu_spec->oprofile_type

Before checking for cpu_type == NULL, this same copy happens, so doing it here will just write the same value to the t->oprofile_type again.

Remove the repeated copy, as it is unnecessary.

---
 arch/powerpc/kernel/cputable.c | 1 -
 1 file changed, 1 deletion(-)
arch/powerpc/kernel/cputable.c +0 -1
index e745abc5457a..5a87ec96582f 100644
@@ -2197,7 +2197,6 @@ static struct cpu_spec * __init setup_cpu_spec(unsigned long offset,
 		 */
 		if (old.oprofile_cpu_type != NULL) {
 			t->oprofile_cpu_type = old.oprofile_cpu_type;
-			t->oprofile_type = old.oprofile_type;
 		}
 	}
 
Signature · 1 line
2.24.1
Reviewed-by on v1 1/1
#1 lore raw
Quoted 7 lines · Leonardo Bras

Before checking for cpu_type == NULL, this same copy happens, so doing it here will just write the same value to the t->oprofile_type again.

Remove the repeated copy, as it is unnecessary.

LGTM

Quoted 17 lines
---
 arch/powerpc/kernel/cputable.c | 1 -
 1 file changed, 1 deletion(-)
arch/powerpc/kernel/cputable.c +0 -1
index e745abc5457a..5a87ec96582f 100644
@@ -2197,7 +2197,6 @@ static struct cpu_spec * __init setup_cpu_spec(unsigned
 long offset,
 		 */
 		if (old.oprofile_cpu_type != NULL) {
 			t->oprofile_cpu_type = old.oprofile_cpu_type;
-			t->oprofile_type = old.oprofile_type;
 		}
 	}
#2 lore raw
Quoted 5 lines · Michael Neuling
Quoted 4 lines · Leonardo Bras

Before checking for cpu_type == NULL, this same copy happens, so doing it here will just write the same value to the t->oprofile_type again.

Quoted 8 lines
Quoted 3 lines

Remove the repeated copy, as it is unnecessary.

LGTM

Thanks!

Quoted 17 lines
Quoted 17 lines
---
 arch/powerpc/kernel/cputable.c | 1 -
 1 file changed, 1 deletion(-)
arch/powerpc/kernel/cputable.c +0 -1
index e745abc5457a..5a87ec96582f 100644
@@ -2197,7 +2197,6 @@ static struct cpu_spec * __init setup_cpu_spec(unsigned
 long offset,
 		 */
 		if (old.oprofile_cpu_type != NULL) {
 			t->oprofile_cpu_type = old.oprofile_cpu_type;
-			t->oprofile_type = old.oprofile_type;
 		}
 	}
#3 lore raw
In reply to Leonardo Bras

Le 15/02/2020 à 06:36, Leonardo Bras a écrit :

Quoted 16 lines

Before checking for cpu_type == NULL, this same copy happens, so doing it here will just write the same value to the t->oprofile_type again.

Remove the repeated copy, as it is unnecessary.

---
  arch/powerpc/kernel/cputable.c | 1 -
  1 file changed, 1 deletion(-)
arch/powerpc/kernel/cputable.c +0 -0
index e745abc5457a..5a87ec96582f 100644

arch/powerpc/kernel/cputable.c static struct cpu_spec * __init setup_cpu_spec(unsigned long offset, · line 2200

Quoted 5 lines
arch/powerpc/kernel/cputable.c +0 -1
@@ -2197,7 +2197,6 @@ static struct cpu_spec * __init setup_cpu_spec(unsigned long offset,
  		 */
  		if (old.oprofile_cpu_type != NULL) {
  			t->oprofile_cpu_type = old.oprofile_cpu_type;
-			t->oprofile_type = old.oprofile_type;
  		}

The action being reduced to a single line, the { } should be removed.

Christophe

#4 lore raw

Hello Christophe, thank you for the feedback.

Quoted 8 lines · Christophe Leroy

arch/powerpc/kernel/cputable.c static struct cpu_spec * __init setup_cpu_spec(unsigned long offset, · line 2200

Quoted 4 lines
  		if (old.oprofile_cpu_type != NULL) {
  			t->oprofile_cpu_type = old.oprofile_cpu_type;
arch/powerpc/kernel/cputable.c +0 -1
-			t->oprofile_type = old.oprofile_type;
  		}

The action being reduced to a single line, the { } should be removed.

Christophe

I intentionally let it this way because I just reviewed a patch that will add more itens here, and should be merged before this one.

This will avoid conflicts.

Best regards,
Leonardo Bras