All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] sparse: can do constant folding of __builtin_bswap*()
@ 2021-02-26  9:22 Luc Van Oostenryck
  2021-02-26 10:38 ` Arnd Bergmann
  2021-02-26 12:17 ` Miguel Ojeda
  0 siblings, 2 replies; 3+ messages in thread
From: Luc Van Oostenryck @ 2021-02-26  9:22 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Miguel Ojeda, Andrew Morton, linux-kernel, Luc Van Oostenryck

Sparse can do constant folding of __builtin_bswap*() since 2017.
Also, a much recent version of Sparse is needed anyway, see
commit 6ec4476ac825 ("Raise gcc version requirement to 4.9").

So, remove the comment about sparse not being yet able to constant
fold __builtin_bswap*() and remove the corresponding test of __CHECKER__.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
---
 include/linux/compiler-gcc.h | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/include/linux/compiler-gcc.h b/include/linux/compiler-gcc.h
index 74c6c0486eed..d1016cc6798a 100644
--- a/include/linux/compiler-gcc.h
+++ b/include/linux/compiler-gcc.h
@@ -95,15 +95,11 @@
  */
 #define asm_volatile_goto(x...)	do { asm goto(x); asm (""); } while (0)
 
-/*
- * sparse (__CHECKER__) pretends to be gcc, but can't do constant
- * folding in __builtin_bswap*() (yet), so don't set these for it.
- */
-#if defined(CONFIG_ARCH_USE_BUILTIN_BSWAP) && !defined(__CHECKER__)
+#if defined(CONFIG_ARCH_USE_BUILTIN_BSWAP)
 #define __HAVE_BUILTIN_BSWAP32__
 #define __HAVE_BUILTIN_BSWAP64__
 #define __HAVE_BUILTIN_BSWAP16__
-#endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP && !__CHECKER__ */
+#endif /* CONFIG_ARCH_USE_BUILTIN_BSWAP */
 
 #if GCC_VERSION >= 70000
 #define KASAN_ABI_VERSION 5
-- 
2.30.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] sparse: can do constant folding of __builtin_bswap*()
  2021-02-26  9:22 [PATCH] sparse: can do constant folding of __builtin_bswap*() Luc Van Oostenryck
@ 2021-02-26 10:38 ` Arnd Bergmann
  2021-02-26 12:17 ` Miguel Ojeda
  1 sibling, 0 replies; 3+ messages in thread
From: Arnd Bergmann @ 2021-02-26 10:38 UTC (permalink / raw)
  To: Luc Van Oostenryck
  Cc: Arnd Bergmann, Miguel Ojeda, Andrew Morton, linux-kernel

On Fri, Feb 26, 2021 at 10:22 AM Luc Van Oostenryck
<luc.vanoostenryck@gmail.com> wrote:
>
> Sparse can do constant folding of __builtin_bswap*() since 2017.
> Also, a much recent version of Sparse is needed anyway, see
> commit 6ec4476ac825 ("Raise gcc version requirement to 4.9").
>
> So, remove the comment about sparse not being yet able to constant
> fold __builtin_bswap*() and remove the corresponding test of __CHECKER__.
>
> Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>

Acked-by: Arnd Bergmann <arnd@arndb.de>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] sparse: can do constant folding of __builtin_bswap*()
  2021-02-26  9:22 [PATCH] sparse: can do constant folding of __builtin_bswap*() Luc Van Oostenryck
  2021-02-26 10:38 ` Arnd Bergmann
@ 2021-02-26 12:17 ` Miguel Ojeda
  1 sibling, 0 replies; 3+ messages in thread
From: Miguel Ojeda @ 2021-02-26 12:17 UTC (permalink / raw)
  To: Luc Van Oostenryck; +Cc: Arnd Bergmann, Andrew Morton, linux-kernel

On Fri, Feb 26, 2021 at 10:22 AM Luc Van Oostenryck
<luc.vanoostenryck@gmail.com> wrote:
>
> Sparse can do constant folding of __builtin_bswap*() since 2017.
> Also, a much recent version of Sparse is needed anyway, see
> commit 6ec4476ac825 ("Raise gcc version requirement to 4.9").
>
> So, remove the comment about sparse not being yet able to constant
> fold __builtin_bswap*() and remove the corresponding test of __CHECKER__.
>
> Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>

Acked-by: Miguel Ojeda <ojeda@kernel.org>

Cheers,
Miguel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-02-26 12:19 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-26  9:22 [PATCH] sparse: can do constant folding of __builtin_bswap*() Luc Van Oostenryck
2021-02-26 10:38 ` Arnd Bergmann
2021-02-26 12:17 ` Miguel Ojeda

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.