LinuxPPC-Dev Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH 1/1] powerpc/cputable: Remove unnecessary copy of cpu_spec->oprofile_type
@ 2020-02-15  5:36 Leonardo Bras
  2020-02-16 22:33 ` Michael Neuling
  2020-02-17  6:31 ` Christophe Leroy
  0 siblings, 2 replies; 5+ messages in thread
From: Leonardo Bras @ 2020-02-15  5:36 UTC (permalink / raw)
  To: Benjamin Herrenschmidt, Paul Mackerras, Michael Ellerman,
	Christophe Leroy, Greg Kroah-Hartman, Leonardo Bras,
	Thomas Gleixner, desnesn
  Cc: linuxppc-dev, linux-kernel

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;
 		}
 	}
 
-- 
2.24.1


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/1] powerpc/cputable: Remove unnecessary copy of cpu_spec->oprofile_type
  2020-02-15  5:36 [PATCH 1/1] powerpc/cputable: Remove unnecessary copy of cpu_spec->oprofile_type Leonardo Bras
@ 2020-02-16 22:33 ` Michael Neuling
  2020-02-17 14:15   ` Leonardo Bras
  2020-02-17  6:31 ` Christophe Leroy
  1 sibling, 1 reply; 5+ messages in thread
From: Michael Neuling @ 2020-02-16 22:33 UTC (permalink / raw)
  To: Leonardo Bras, Benjamin Herrenschmidt, Paul Mackerras,
	Michael Ellerman, Christophe Leroy, Greg Kroah-Hartman,
	Thomas Gleixner, desnesn
  Cc: linuxppc-dev, linux-kernel

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;
>  		}
>  	}
>  


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/1] powerpc/cputable: Remove unnecessary copy of cpu_spec->oprofile_type
  2020-02-15  5:36 [PATCH 1/1] powerpc/cputable: Remove unnecessary copy of cpu_spec->oprofile_type Leonardo Bras
  2020-02-16 22:33 ` Michael Neuling
@ 2020-02-17  6:31 ` Christophe Leroy
  2020-02-17 14:18   ` Leonardo Bras
  1 sibling, 1 reply; 5+ messages in thread
From: Christophe Leroy @ 2020-02-17  6:31 UTC (permalink / raw)
  To: Leonardo Bras, Benjamin Herrenschmidt, Paul Mackerras,
	Michael Ellerman, Greg Kroah-Hartman, Thomas Gleixner, desnesn
  Cc: linuxppc-dev, linux-kernel



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

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/1] powerpc/cputable: Remove unnecessary copy of cpu_spec->oprofile_type
  2020-02-16 22:33 ` Michael Neuling
@ 2020-02-17 14:15   ` Leonardo Bras
  0 siblings, 0 replies; 5+ messages in thread
From: Leonardo Bras @ 2020-02-17 14:15 UTC (permalink / raw)
  To: Michael Neuling, Benjamin Herrenschmidt, Paul Mackerras,
	Michael Ellerman, Christophe Leroy, Greg Kroah-Hartman,
	Thomas Gleixner, desnesn
  Cc: linuxppc-dev, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 1074 bytes --]

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;
> >  		}
> >  	}
> >  

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH 1/1] powerpc/cputable: Remove unnecessary copy of cpu_spec->oprofile_type
  2020-02-17  6:31 ` Christophe Leroy
@ 2020-02-17 14:18   ` Leonardo Bras
  0 siblings, 0 replies; 5+ messages in thread
From: Leonardo Bras @ 2020-02-17 14:18 UTC (permalink / raw)
  To: Christophe Leroy, Benjamin Herrenschmidt, Paul Mackerras,
	Michael Ellerman, Greg Kroah-Hartman, Thomas Gleixner, desnesn
  Cc: linuxppc-dev, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 565 bytes --]

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


[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, back to index

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-15  5:36 [PATCH 1/1] powerpc/cputable: Remove unnecessary copy of cpu_spec->oprofile_type Leonardo Bras
2020-02-16 22:33 ` Michael Neuling
2020-02-17 14:15   ` Leonardo Bras
2020-02-17  6:31 ` Christophe Leroy
2020-02-17 14:18   ` Leonardo Bras

LinuxPPC-Dev Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linuxppc-dev/0 linuxppc-dev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linuxppc-dev linuxppc-dev/ https://lore.kernel.org/linuxppc-dev \
		linuxppc-dev@lists.ozlabs.org linuxppc-dev@ozlabs.org
	public-inbox-index linuxppc-dev

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.ozlabs.lists.linuxppc-dev


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git