* [PATCH] mips: asm: fix warning when disabling MIPS_FP_SUPPORT
@ 2024-10-12 10:12 Jonas Gorski
2024-10-12 13:09 ` Maciej W. Rozycki
2024-10-30 11:16 ` Thomas Bogendoerfer
0 siblings, 2 replies; 3+ messages in thread
From: Jonas Gorski @ 2024-10-12 10:12 UTC (permalink / raw)
To: Thomas Bogendoerfer, Paul Burton; +Cc: linux-mips, linux-kernel
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: 36a498035bd2 ("MIPS: Avoid FCSR sanitization when CONFIG_MIPS_FP_SUPPORT=n")
Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
---
arch/mips/include/asm/switch_to.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/mips/include/asm/switch_to.h b/arch/mips/include/asm/switch_to.h
index a4374b4cb88fd830f8b83caab52d6e3c133fd0c4..d6ccd53440213315ec75a54caf683c32c69dcdbe 100644
--- a/arch/mips/include/asm/switch_to.h
+++ b/arch/mips/include/asm/switch_to.h
@@ -97,7 +97,7 @@ do { \
} \
} while (0)
#else
-# define __sanitize_fcr31(next)
+# define __sanitize_fcr31(next) do { (void) (next); } while (0)
#endif
/*
---
base-commit: 9852d85ec9d492ebef56dc5f229416c925758edc
change-id: 20241012-mips-fcr31-warning-d4eebcfc91c5
Best regards,
--
Jonas Gorski <jonas.gorski@gmail.com>
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] mips: asm: fix warning when disabling MIPS_FP_SUPPORT
2024-10-12 10:12 [PATCH] mips: asm: fix warning when disabling MIPS_FP_SUPPORT Jonas Gorski
@ 2024-10-12 13:09 ` Maciej W. Rozycki
2024-10-30 11:16 ` Thomas Bogendoerfer
1 sibling, 0 replies; 3+ messages in thread
From: Maciej W. Rozycki @ 2024-10-12 13:09 UTC (permalink / raw)
To: Jonas Gorski; +Cc: Thomas Bogendoerfer, Paul Burton, linux-mips, linux-kernel
On Sat, 12 Oct 2024, Jonas Gorski wrote:
> Fix this by providing an empty body for __sanitize_fcr31() like one is
> defined for __mips_mt_fpaff_switch_to().
Reviewed-by: Maciej W. Rozycki <macro@orcam.me.uk>
Maciej
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] mips: asm: fix warning when disabling MIPS_FP_SUPPORT
2024-10-12 10:12 [PATCH] mips: asm: fix warning when disabling MIPS_FP_SUPPORT Jonas Gorski
2024-10-12 13:09 ` Maciej W. Rozycki
@ 2024-10-30 11:16 ` Thomas Bogendoerfer
1 sibling, 0 replies; 3+ messages in thread
From: Thomas Bogendoerfer @ 2024-10-30 11:16 UTC (permalink / raw)
To: Jonas Gorski; +Cc: Paul Burton, linux-mips, linux-kernel
On Sat, Oct 12, 2024 at 12:12:14PM +0200, Jonas Gorski wrote:
> 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: 36a498035bd2 ("MIPS: Avoid FCSR sanitization when CONFIG_MIPS_FP_SUPPORT=n")
> Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com>
> ---
> arch/mips/include/asm/switch_to.h | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/arch/mips/include/asm/switch_to.h b/arch/mips/include/asm/switch_to.h
> index a4374b4cb88fd830f8b83caab52d6e3c133fd0c4..d6ccd53440213315ec75a54caf683c32c69dcdbe 100644
> --- a/arch/mips/include/asm/switch_to.h
> +++ b/arch/mips/include/asm/switch_to.h
> @@ -97,7 +97,7 @@ do { \
> } \
> } while (0)
> #else
> -# define __sanitize_fcr31(next)
> +# define __sanitize_fcr31(next) do { (void) (next); } while (0)
> #endif
>
> /*
>
> ---
> base-commit: 9852d85ec9d492ebef56dc5f229416c925758edc
> change-id: 20241012-mips-fcr31-warning-d4eebcfc91c5
applied to mips-next.
Thomas.
--
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea. [ RFC1925, 2.3 ]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2024-10-30 11:19 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-12 10:12 [PATCH] mips: asm: fix warning when disabling MIPS_FP_SUPPORT Jonas Gorski
2024-10-12 13:09 ` Maciej W. Rozycki
2024-10-30 11:16 ` Thomas Bogendoerfer
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox