Skip to contentSkip to conversation

mips: Fix build error seen in some configurations

PATCH In review Guenter Roeck 2 participants 2 messages Nov 25, 2013 – Nov 26, 2013 MIPS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mips: Fix build error seen in some configurations

The following build error is seen if CONFIG_32BIT is undefined, CONFIG_64BIT is defined, and CONFIG_MIPS32_O32 is undefined.

asm/syscall.h: In function 'mips_get_syscall_arg':
arch/mips/include/asm/syscall.h:32:16: error: unused variable 'usp' [-Werror=unused-variable]
cc1: all warnings being treated as errors

Fixes c0ff3c53d4f9 ('MIPS: Enable HAVE_ARCH_TRACEHOOK')
---
 arch/mips/include/asm/syscall.h |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/mips/include/asm/syscall.h +1 -1
index 81c8913..33e8dbf 100644
@@ -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 usp __maybe_unused = regs->regs[29];
 
 	switch (n) {
 	case 0: case 1: case 2: case 3:
Signature · 1 line
1.7.9.7
Acked-by on v1 1/1
#1 lore raw
Quoted 9 lines · Guenter Roeck

The following build error is seen if CONFIG_32BIT is undefined, CONFIG_64BIT is defined, and CONFIG_MIPS32_O32 is undefined.

asm/syscall.h: In function 'mips_get_syscall_arg':
arch/mips/include/asm/syscall.h:32:16: error: unused variable 'usp' [-Werror=unused-variable]
cc1: all warnings being treated as errors

Fixes c0ff3c53d4f9 ('MIPS: Enable HAVE_ARCH_TRACEHOOK')
Quoted 18 lines
---
  arch/mips/include/asm/syscall.h |    2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
arch/mips/include/asm/syscall.h +1 -1
index 81c8913..33e8dbf 100644
@@ -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 usp __maybe_unused = regs->regs[29];
 
  	switch (n) {
  	case 0: case 1: case 2: case 3: