linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] powerpc/64s: Mark 'dummy_copy_buffer' as used
@ 2019-03-12 20:29 Mathieu Malaterre
  2019-03-12 21:06 ` Christophe Leroy
  2019-03-13 20:00 ` [PATCH v2] powerpc/64s: Remove 'dummy_copy_buffer' Mathieu Malaterre
  0 siblings, 2 replies; 5+ messages in thread
From: Mathieu Malaterre @ 2019-03-12 20:29 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: Mathieu Malaterre, Nicholas Piggin, Benjamin Herrenschmidt,
	Paul Mackerras, linuxppc-dev, linux-kernel

In commit 07d2a628bc00 ("powerpc/64s: Avoid cpabort in context switch
when possible") a buffer 'dummy_copy_buffer' was introduced. gcc does
not see this buffer being used in the inline assembly within function
'__switch_to', explicitly marked this variable as being used.

Prefer using '__aligned' to get passed line over 80 characters warning
in checkpatch.

This remove the following warning:

  arch/powerpc/kernel/process.c:1156:17: error: 'dummy_copy_buffer' defined but not used [-Werror=unused-const-variable=]

Cc: Nicholas Piggin <npiggin@gmail.com>
Signed-off-by: Mathieu Malaterre <malat@debian.org>
---
 arch/powerpc/kernel/process.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index 77e44275d025..5acf63d45802 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -1153,7 +1153,7 @@ static inline void restore_sprs(struct thread_struct *old_thread,
 
 #ifdef CONFIG_PPC_BOOK3S_64
 #define CP_SIZE 128
-static const u8 dummy_copy_buffer[CP_SIZE] __attribute__((aligned(CP_SIZE)));
+static const u8 dummy_copy_buffer[CP_SIZE] __aligned(CP_SIZE) __used;
 #endif
 
 struct task_struct *__switch_to(struct task_struct *prev,
-- 
2.20.1


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

* Re: [PATCH] powerpc/64s: Mark 'dummy_copy_buffer' as used
  2019-03-12 20:29 [PATCH] powerpc/64s: Mark 'dummy_copy_buffer' as used Mathieu Malaterre
@ 2019-03-12 21:06 ` Christophe Leroy
  2019-03-13  4:05   ` Michael Ellerman
  2019-03-13 20:00 ` [PATCH v2] powerpc/64s: Remove 'dummy_copy_buffer' Mathieu Malaterre
  1 sibling, 1 reply; 5+ messages in thread
From: Christophe Leroy @ 2019-03-12 21:06 UTC (permalink / raw)
  To: Mathieu Malaterre, Michael Ellerman
  Cc: linux-kernel, Nicholas Piggin, Paul Mackerras, linuxppc-dev

On 03/12/2019 08:29 PM, Mathieu Malaterre wrote:
> In commit 07d2a628bc00 ("powerpc/64s: Avoid cpabort in context switch
> when possible") a buffer 'dummy_copy_buffer' was introduced. gcc does
> not see this buffer being used in the inline assembly within function
> '__switch_to', explicitly marked this variable as being used.
> 
> Prefer using '__aligned' to get passed line over 80 characters warning
> in checkpatch.

Powerpc accepts 90 characters, use arch/powerpc/tools/checkpatch.sh

> 
> This remove the following warning:
> 
>    arch/powerpc/kernel/process.c:1156:17: error: 'dummy_copy_buffer' defined but not used [-Werror=unused-const-variable=]

commit 2bf1071a8d50 ("powerpc/64s: Remove POWER9 DD1 support") has 
removed the fonction using 'dummy_copy_buffer' so you should remove it 
completely.

Christophe


> 
> Cc: Nicholas Piggin <npiggin@gmail.com>
> Signed-off-by: Mathieu Malaterre <malat@debian.org>
> ---
>   arch/powerpc/kernel/process.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
> index 77e44275d025..5acf63d45802 100644
> --- a/arch/powerpc/kernel/process.c
> +++ b/arch/powerpc/kernel/process.c
> @@ -1153,7 +1153,7 @@ static inline void restore_sprs(struct thread_struct *old_thread,
>   
>   #ifdef CONFIG_PPC_BOOK3S_64
>   #define CP_SIZE 128
> -static const u8 dummy_copy_buffer[CP_SIZE] __attribute__((aligned(CP_SIZE)));
> +static const u8 dummy_copy_buffer[CP_SIZE] __aligned(CP_SIZE) __used;
>   #endif
>   
>   struct task_struct *__switch_to(struct task_struct *prev,
> 

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

* Re: [PATCH] powerpc/64s: Mark 'dummy_copy_buffer' as used
  2019-03-12 21:06 ` Christophe Leroy
@ 2019-03-13  4:05   ` Michael Ellerman
  0 siblings, 0 replies; 5+ messages in thread
From: Michael Ellerman @ 2019-03-13  4:05 UTC (permalink / raw)
  To: Christophe Leroy, Mathieu Malaterre
  Cc: linux-kernel, Nicholas Piggin, Paul Mackerras, linuxppc-dev

Christophe Leroy <christophe.leroy@c-s.fr> writes:
> On 03/12/2019 08:29 PM, Mathieu Malaterre wrote:
>> In commit 07d2a628bc00 ("powerpc/64s: Avoid cpabort in context switch
>> when possible") a buffer 'dummy_copy_buffer' was introduced. gcc does
>> not see this buffer being used in the inline assembly within function
>> '__switch_to', explicitly marked this variable as being used.
>> 
>> Prefer using '__aligned' to get passed line over 80 characters warning
>> in checkpatch.
>
> Powerpc accepts 90 characters, use arch/powerpc/tools/checkpatch.sh
>
>> 
>> This remove the following warning:
>> 
>>    arch/powerpc/kernel/process.c:1156:17: error: 'dummy_copy_buffer' defined but not used [-Werror=unused-const-variable=]
>
> commit 2bf1071a8d50 ("powerpc/64s: Remove POWER9 DD1 support") has 
> removed the fonction using 'dummy_copy_buffer' so you should remove it 
> completely.

Yes that would be better, thanks.

cheers

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

* [PATCH v2] powerpc/64s: Remove 'dummy_copy_buffer'
  2019-03-12 20:29 [PATCH] powerpc/64s: Mark 'dummy_copy_buffer' as used Mathieu Malaterre
  2019-03-12 21:06 ` Christophe Leroy
@ 2019-03-13 20:00 ` Mathieu Malaterre
  2019-05-03  6:59   ` Michael Ellerman
  1 sibling, 1 reply; 5+ messages in thread
From: Mathieu Malaterre @ 2019-03-13 20:00 UTC (permalink / raw)
  To: Michael Ellerman
  Cc: Mathieu Malaterre, Nicholas Piggin, Christophe Leroy,
	Benjamin Herrenschmidt, Paul Mackerras, linuxppc-dev,
	linux-kernel

In commit 2bf1071a8d50 ("powerpc/64s: Remove POWER9 DD1 support") the
function __switch_to remove usage for 'dummy_copy_buffer'. Since it is
not used anywhere else, remove it completely.

This remove the following warning:

  arch/powerpc/kernel/process.c:1156:17: error: 'dummy_copy_buffer' defined but not used [-Werror=unused-const-variable=]

Cc: Nicholas Piggin <npiggin@gmail.com>
Suggested-by: Christophe Leroy <christophe.leroy@c-s.fr>
Signed-off-by: Mathieu Malaterre <malat@debian.org>
---
v2: complely remove dummy_copy_buffer instead of marking it as used (since not anymore)
 arch/powerpc/kernel/process.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/arch/powerpc/kernel/process.c b/arch/powerpc/kernel/process.c
index 77e44275d025..b2f0daa2fcf1 100644
--- a/arch/powerpc/kernel/process.c
+++ b/arch/powerpc/kernel/process.c
@@ -1151,11 +1151,6 @@ static inline void restore_sprs(struct thread_struct *old_thread,
 	thread_pkey_regs_restore(new_thread, old_thread);
 }
 
-#ifdef CONFIG_PPC_BOOK3S_64
-#define CP_SIZE 128
-static const u8 dummy_copy_buffer[CP_SIZE] __attribute__((aligned(CP_SIZE)));
-#endif
-
 struct task_struct *__switch_to(struct task_struct *prev,
 	struct task_struct *new)
 {
-- 
2.20.1


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

* Re: [PATCH v2] powerpc/64s: Remove 'dummy_copy_buffer'
  2019-03-13 20:00 ` [PATCH v2] powerpc/64s: Remove 'dummy_copy_buffer' Mathieu Malaterre
@ 2019-05-03  6:59   ` Michael Ellerman
  0 siblings, 0 replies; 5+ messages in thread
From: Michael Ellerman @ 2019-05-03  6:59 UTC (permalink / raw)
  To: Mathieu Malaterre
  Cc: Mathieu Malaterre, linux-kernel, Nicholas Piggin, Paul Mackerras,
	linuxppc-dev

On Wed, 2019-03-13 at 20:00:30 UTC, Mathieu Malaterre wrote:
> In commit 2bf1071a8d50 ("powerpc/64s: Remove POWER9 DD1 support") the
> function __switch_to remove usage for 'dummy_copy_buffer'. Since it is
> not used anywhere else, remove it completely.
> 
> This remove the following warning:
> 
>   arch/powerpc/kernel/process.c:1156:17: error: 'dummy_copy_buffer' defined but not used [-Werror=unused-const-variable=]
> 
> Cc: Nicholas Piggin <npiggin@gmail.com>
> Suggested-by: Christophe Leroy <christophe.leroy@c-s.fr>
> Signed-off-by: Mathieu Malaterre <malat@debian.org>

Applied to powerpc next, thanks.

https://git.kernel.org/powerpc/c/a5ae043de7678f189303559782f60570

cheers

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

end of thread, other threads:[~2019-05-03  7:00 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-12 20:29 [PATCH] powerpc/64s: Mark 'dummy_copy_buffer' as used Mathieu Malaterre
2019-03-12 21:06 ` Christophe Leroy
2019-03-13  4:05   ` Michael Ellerman
2019-03-13 20:00 ` [PATCH v2] powerpc/64s: Remove 'dummy_copy_buffer' Mathieu Malaterre
2019-05-03  6:59   ` Michael Ellerman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).