Skip to content

Commit

Permalink
MIPS: Fix GCC-4.6 'set but not used' warning in signal*.c
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
David Daney authored and Ralf Baechle committed Mar 14, 2011
1 parent a18059a commit c726b82
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion arch/mips/kernel/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion arch/mips/kernel/signal32.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit c726b82

Please sign in to comment.