diff mbox series

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

Message ID 20200215053637.280880-1-leonardo@linux.ibm.com (mailing list archive)
State Accepted, archived
Commit 41b8426fdb59218f56a6e3b3facd43a82816e3eb
Headers show
Series [1/1] powerpc/cputable: Remove unnecessary copy of cpu_spec->oprofile_type | expand

Checks

Context Check Description
snowpatch_ozlabs/apply_patch success Successfully applied on branch powerpc/merge (a5bc6e124219546a81ce334dc9b16483d55e9abf)
snowpatch_ozlabs/build-ppc64le success Build succeeded
snowpatch_ozlabs/build-ppc64be success Build succeeded
snowpatch_ozlabs/build-ppc64e success Build succeeded
snowpatch_ozlabs/build-pmac32 success Build succeeded
snowpatch_ozlabs/checkpatch success total: 0 errors, 0 warnings, 0 checks, 7 lines checked
snowpatch_ozlabs/needsstable success Patch has no Fixes tags

Commit Message

Leonardo Bras Feb. 15, 2020, 5:36 a.m. UTC
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.

Signed-off-by: Leonardo Bras <leonardo@linux.ibm.com>
---
 arch/powerpc/kernel/cputable.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Michael Neuling Feb. 16, 2020, 10:33 p.m. UTC | #1
On Sat, 2020-02-15 at 02:36 -0300, Leonardo Bras wrote:
> 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.
> 
> Signed-off-by: Leonardo Bras <leonardo@linux.ibm.com>

LGTM

Reviewed-by: Michael Neuling <mikey@neuling.org>

> ---
>  arch/powerpc/kernel/cputable.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c
> index e745abc5457a..5a87ec96582f 100644
> --- a/arch/powerpc/kernel/cputable.c
> +++ b/arch/powerpc/kernel/cputable.c
> @@ -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;
>  		}
>  	}
>
Christophe Leroy Feb. 17, 2020, 6:31 a.m. UTC | #2
Le 15/02/2020 à 06:36, Leonardo Bras a écrit :
> 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.
> 
> Signed-off-by: Leonardo Bras <leonardo@linux.ibm.com>
> ---
>   arch/powerpc/kernel/cputable.c | 1 -
>   1 file changed, 1 deletion(-)
> 
> diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c
> index e745abc5457a..5a87ec96582f 100644
> --- a/arch/powerpc/kernel/cputable.c
> +++ b/arch/powerpc/kernel/cputable.c
> @@ -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
Leonardo Bras Feb. 17, 2020, 2:15 p.m. UTC | #3
On Mon, 2020-02-17 at 09:33 +1100, Michael Neuling wrote:
> On Sat, 2020-02-15 at 02:36 -0300, Leonardo Bras wrote:
> > 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.
> > 
> > Signed-off-by: Leonardo Bras <leonardo@linux.ibm.com>
> 
> LGTM
> 
> Reviewed-by: Michael Neuling <mikey@neuling.org>
> 

Thanks!

> > ---
> >  arch/powerpc/kernel/cputable.c | 1 -
> >  1 file changed, 1 deletion(-)
> > 
> > diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c
> > index e745abc5457a..5a87ec96582f 100644
> > --- a/arch/powerpc/kernel/cputable.c
> > +++ b/arch/powerpc/kernel/cputable.c
> > @@ -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;
> >  		}
> >  	}
> >
Leonardo Bras Feb. 17, 2020, 2:18 p.m. UTC | #4
Hello Christophe, thank you for the feedback.

On Mon, 2020-02-17 at 07:31 +0100, Christophe Leroy wrote:
> >   		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

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
Michael Ellerman April 1, 2020, 12:53 p.m. UTC | #5
On Sat, 2020-02-15 at 05:36:37 UTC, Leonardo Bras wrote:
> 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.
> 
> Signed-off-by: Leonardo Bras <leonardo@linux.ibm.com>

Series applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/41b8426fdb59218f56a6e3b3facd43a82816e3eb

cheers
diff mbox series

Patch

diff --git a/arch/powerpc/kernel/cputable.c b/arch/powerpc/kernel/cputable.c
index e745abc5457a..5a87ec96582f 100644
--- a/arch/powerpc/kernel/cputable.c
+++ b/arch/powerpc/kernel/cputable.c
@@ -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;
 		}
 	}