Commit c726b822131e7fdb62745a5585449e6a159395e8

Authored by David Daney
Committed by Ralf Baechle
1 parent a18059ace1

MIPS: Fix GCC-4.6 'set but not used' warning in signal*.c

GCC-4.6 can find more unused code than previous versions could.

In the case of protected_restore_fp_context{,32}, the variable tmp is
really used.  Its use is tricky in that we really care about the side
effects of the __put_user() calls.  So we must mark tmp with
__maybe_unused to quiet the warning.

Signed-off-by: David Daney <ddaney@caviumnetworks.com>
To: linux-mips@linux-mips.org
Patchwork: https://patchwork.linux-mips.org/patch/2035/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

Showing 2 changed files with 2 additions and 2 deletions Side-by-side Diff

arch/mips/kernel/signal.c
... ... @@ -84,7 +84,7 @@
84 84  
85 85 static int protected_restore_fp_context(struct sigcontext __user *sc)
86 86 {
87   - int err, tmp;
  87 + int err, tmp __maybe_unused;
88 88 while (1) {
89 89 lock_fpu_owner();
90 90 own_fpu_inatomic(0);
arch/mips/kernel/signal32.c
... ... @@ -115,7 +115,7 @@
115 115  
116 116 static int protected_restore_fp_context32(struct sigcontext32 __user *sc)
117 117 {
118   - int err, tmp;
  118 + int err, tmp __maybe_unused;
119 119 while (1) {
120 120 lock_fpu_owner();
121 121 own_fpu_inatomic(0);