Skip to content

Commit

Permalink
mips: asm: fix warning when disabling MIPS_FP_SUPPORT
Browse files Browse the repository at this point in the history
[ Upstream commit da09935 ]

When MIPS_FP_SUPPORT is disabled, __sanitize_fcr31() is defined as
nothing, which triggers a gcc warning:

    In file included from kernel/sched/core.c:79:
    kernel/sched/core.c: In function 'context_switch':
    ./arch/mips/include/asm/switch_to.h:114:39: warning: suggest braces around empty body in an 'if' statement [-Wempty-body]
      114 |                 __sanitize_fcr31(next);                                 \
          |                                       ^
    kernel/sched/core.c:5316:9: note: in expansion of macro 'switch_to'
     5316 |         switch_to(prev, next, prev);
          |         ^~~~~~~~~

Fix this by providing an empty body for __sanitize_fcr31() like one is
defined for __mips_mt_fpaff_switch_to().

Fixes: 36a4980 ("MIPS: Avoid FCSR sanitization when CONFIG_MIPS_FP_SUPPORT=n")
Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
Reviewed-by: Maciej W. Rozycki <macro@orcam.me.uk>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
KanjiMonster authored and gregkh committed Dec 5, 2024
1 parent 26cc506 commit 2a375be
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/mips/include/asm/switch_to.h
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ do { \
} \
} while (0)
#else
# define __sanitize_fcr31(next)
# define __sanitize_fcr31(next) do { (void) (next); } while (0)
#endif

/*
Expand Down

0 comments on commit 2a375be

Please sign in to comment.