All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mips: fix 64-bit compilation error without CONFIG_MIPS32_O32
@ 2013-12-20 16:31 ` Alex Smith
  0 siblings, 0 replies; 3+ messages in thread
From: Alex Smith @ 2013-12-20 16:31 UTC (permalink / raw)
  To: linux-mips; +Cc: Alex Smith

Attempting to compile a 64-bit kernel without CONFIG_MIPS32_O32 defined
(using GCC 4.8.1) results in the following compilation error:

arch/mips/include/asm/syscall.h: In function 'mips_get_syscall_arg':
arch/mips/include/asm/syscall.h:32:16: error: unused variable 'usp' [-Werror=unused-variable]

Fix by adding __maybe_unsued to the definition of usp.

Signed-off-by: Alex Smith <alex.smith@imgtec.com>
Reviewed-by: Markos Chandras <markos.chandras@imgtec.com>
---
 arch/mips/include/asm/syscall.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/mips/include/asm/syscall.h b/arch/mips/include/asm/syscall.h
index 81c8913..c48f8d8 100644
--- a/arch/mips/include/asm/syscall.h
+++ b/arch/mips/include/asm/syscall.h
@@ -29,7 +29,7 @@ static inline long syscall_get_nr(struct task_struct *task,
 static inline unsigned long mips_get_syscall_arg(unsigned long *arg,
 	struct task_struct *task, struct pt_regs *regs, unsigned int n)
 {
-	unsigned long usp = regs->regs[29];
+	unsigned long __maybe_unused usp = regs->regs[29];
 
 	switch (n) {
 	case 0: case 1: case 2: case 3:
-- 
1.8.5.2

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

* [PATCH] mips: fix 64-bit compilation error without CONFIG_MIPS32_O32
@ 2013-12-20 16:31 ` Alex Smith
  0 siblings, 0 replies; 3+ messages in thread
From: Alex Smith @ 2013-12-20 16:31 UTC (permalink / raw)
  To: linux-mips; +Cc: Alex Smith

Attempting to compile a 64-bit kernel without CONFIG_MIPS32_O32 defined
(using GCC 4.8.1) results in the following compilation error:

arch/mips/include/asm/syscall.h: In function 'mips_get_syscall_arg':
arch/mips/include/asm/syscall.h:32:16: error: unused variable 'usp' [-Werror=unused-variable]

Fix by adding __maybe_unsued to the definition of usp.

Signed-off-by: Alex Smith <alex.smith@imgtec.com>
Reviewed-by: Markos Chandras <markos.chandras@imgtec.com>
---
 arch/mips/include/asm/syscall.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/mips/include/asm/syscall.h b/arch/mips/include/asm/syscall.h
index 81c8913..c48f8d8 100644
--- a/arch/mips/include/asm/syscall.h
+++ b/arch/mips/include/asm/syscall.h
@@ -29,7 +29,7 @@ static inline long syscall_get_nr(struct task_struct *task,
 static inline unsigned long mips_get_syscall_arg(unsigned long *arg,
 	struct task_struct *task, struct pt_regs *regs, unsigned int n)
 {
-	unsigned long usp = regs->regs[29];
+	unsigned long __maybe_unused usp = regs->regs[29];
 
 	switch (n) {
 	case 0: case 1: case 2: case 3:
-- 
1.8.5.2

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

* Re: [PATCH] mips: fix 64-bit compilation error without CONFIG_MIPS32_O32
       [not found] ` <CACtiza=_eWy2CwUSUmBQReSduCx_+UwtV0yU43GBBbA4FjZ60g@mail.gmail.com>
@ 2013-12-20 17:27   ` Alex Smith
  0 siblings, 0 replies; 3+ messages in thread
From: Alex Smith @ 2013-12-20 17:27 UTC (permalink / raw)
  To: Dmitri Vorobiev; +Cc: Linux-MIPS

On 20/12/13 16:48, Dmitri Vorobiev wrote:
> Hi,
>
> Maybe it would be better to place the variable definition under
>
> #ifdef CONFIG_32BIT || (CONFIG_64BIT && CONFIG_64BIT_O32)
> #endif
>
> In my opinion those pseudo-qualifiers, which simply silence the
> compiler, are harmful, because they hide the problem instead of solving it.
>
> Thanks,
> Dmitri

I originally did so, but changed it to __maybe_unused as the ifdef block 
is somewhat ugly. The compiler is sensible to optimize the variable away 
when it is unused.

I can change it if others also feel that wrapping it in ifdef would be 
better.

Thanks,
Alex

>
>
> On Fri, Dec 20, 2013 at 6:31 PM, Alex Smith <alex.smith@imgtec.com
> <mailto:alex.smith@imgtec.com>> wrote:
>
>     Attempting to compile a 64-bit kernel without CONFIG_MIPS32_O32 defined
>     (using GCC 4.8.1) results in the following compilation error:
>
>     arch/mips/include/asm/syscall.h: In function 'mips_get_syscall_arg':
>     arch/mips/include/asm/syscall.h:32:16: error: unused variable 'usp'
>     [-Werror=unused-variable]
>
>     Fix by adding __maybe_unsued to the definition of usp.
>
>     Signed-off-by: Alex Smith <alex.smith@imgtec.com
>     <mailto:alex.smith@imgtec.com>>
>     Reviewed-by: Markos Chandras <markos.chandras@imgtec.com
>     <mailto:markos.chandras@imgtec.com>>
>     ---
>       arch/mips/include/asm/syscall.h | 2 +-
>       1 file changed, 1 insertion(+), 1 deletion(-)
>
>     diff --git a/arch/mips/include/asm/syscall.h
>     b/arch/mips/include/asm/syscall.h
>     index 81c8913..c48f8d8 100644
>     --- a/arch/mips/include/asm/syscall.h
>     +++ b/arch/mips/include/asm/syscall.h
>     @@ -29,7 +29,7 @@ static inline long syscall_get_nr(struct
>     task_struct *task,
>       static inline unsigned long mips_get_syscall_arg(unsigned long *arg,
>              struct task_struct *task, struct pt_regs *regs, unsigned int n)
>       {
>     -       unsigned long usp = regs->regs[29];
>     +       unsigned long __maybe_unused usp = regs->regs[29];
>
>              switch (n) {
>              case 0: case 1: case 2: case 3:
>     --
>     1.8.5.2
>
>
>
>

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

end of thread, other threads:[~2013-12-20 17:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-12-20 16:31 [PATCH] mips: fix 64-bit compilation error without CONFIG_MIPS32_O32 Alex Smith
2013-12-20 16:31 ` Alex Smith
     [not found] ` <CACtiza=_eWy2CwUSUmBQReSduCx_+UwtV0yU43GBBbA4FjZ60g@mail.gmail.com>
2013-12-20 17:27   ` Alex Smith

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.