MIPS: Fix GCC-4.6 'set but not used' warning in signal*.c
authorDavid Daney <ddaney@caviumnetworks.com>
Mon, 24 Jan 2011 22:51:34 +0000 (14:51 -0800)
committerRalf Baechle <ralf@linux-mips.org>
Mon, 14 Mar 2011 20:07:25 +0000 (21:07 +0100)
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>
arch/mips/kernel/signal.c
arch/mips/kernel/signal32.c

index 5922342bca3991d4b7ab4a9d6f8483fb3e416779..dbbe0ce48d89a4957a349febda33d0934c97d9af 100644 (file)
@@ -84,7 +84,7 @@ static int protected_save_fp_context(struct sigcontext __user *sc)
 
 static int protected_restore_fp_context(struct sigcontext __user *sc)
 {
-       int err, tmp;
+       int err, tmp __maybe_unused;
        while (1) {
                lock_fpu_owner();
                own_fpu_inatomic(0);
index a0ed0e052b2e8f630c34900d5b6e5958f945bbcc..aae986613795d928fa1228331c1526f8ed9e2a56 100644 (file)
@@ -115,7 +115,7 @@ static int protected_save_fp_context32(struct sigcontext32 __user *sc)
 
 static int protected_restore_fp_context32(struct sigcontext32 __user *sc)
 {
-       int err, tmp;
+       int err, tmp __maybe_unused;
        while (1) {
                lock_fpu_owner();
                own_fpu_inatomic(0);