All of lore.kernel.org
 help / color / mirror / Atom feed
* [failures] compilerh-move-__is_constexpr-to-compilerh.patch removed from -mm tree
@ 2023-10-03 23:42 Andrew Morton
  2023-10-04  8:14 ` David Laight
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Morton @ 2023-10-03 23:42 UTC (permalink / raw)
  To: mm-commits, torvalds, rostedt, ndesaulniers, nathan, linux,
	keescook, david.laight, bvanassche, arnd, David.Laight, akpm


The quilt patch titled
     Subject: compiler.h: move __is_constexpr() to compiler.h
has been removed from the -mm tree.  Its filename was
     compilerh-move-__is_constexpr-to-compilerh.patch

This patch was dropped because it had testing failures

------------------------------------------------------
From: David Laight <David.Laight@ACULAB.COM>
Subject: compiler.h: move __is_constexpr() to compiler.h
Date: Mon, 2 Oct 2023 14:34:05 +0000

Prior to f747e6667ebb2 __is_constexpr() was in its only user minmax.h. 
That commit moved it to const.h - but that file just defined ULL(x) and
UL(x) so that constants can be defined for .S and .c files.

So apart from the word 'const' it wasn't really a good location.  Instead
move the definition to compiler.h just before the similar

  is_signed_type() and is_unsigned_type().

(Which were moved there by dcf8e5633e2e6) This may not be a good long-term
home, but the three definitions belong together.

This makes it possible to use __is_constexpr() inside is_signed_type() so
that the result is constant integer expression for pointer types.  In
particular (void *)1 isn't constant enough.

Link: https://lkml.kernel.org/r/6d2b584e26544ee6a0810e494352d432@AcuMS.aculab.com
Signed-off-by: David Laight <david.laight@aculab.com>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: Bart Van Assche <bvanassche@acm.org>
Cc: Kees Cook <keescook@chromium.org>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Nathan Chancellor <nathan@kernel.org>
Cc: Nick Desaulniers <ndesaulniers@google.com>
Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Cc: Steven Rostedt (Google) <rostedt@goodmis.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 include/linux/compiler.h    |    8 ++++++++
 include/linux/const.h       |    8 --------
 tools/include/linux/const.h |    8 --------
 3 files changed, 8 insertions(+), 16 deletions(-)

--- a/include/linux/compiler.h~compilerh-move-__is_constexpr-to-compilerh
+++ a/include/linux/compiler.h
@@ -228,6 +228,14 @@ static inline void *offset_to_ptr(const
 #define __must_be_array(a)	BUILD_BUG_ON_ZERO(__same_type((a), &(a)[0]))
 
 /*
+ * This returns a constant expression while determining if an argument is
+ * a constant expression, most importantly without evaluating the argument.
+ * Glory to Martin Uecker <Martin.Uecker@med.uni-goettingen.de>
+ */
+#define __is_constexpr(x) \
+	(sizeof(int) == sizeof(*(8 ? ((void *)((long)(x) * 0l)) : (int *)8)))
+
+/*
  * Whether 'type' is a signed type or an unsigned type. Supports scalar types,
  * bool and also pointer types.
  */
--- a/include/linux/const.h~compilerh-move-__is_constexpr-to-compilerh
+++ a/include/linux/const.h
@@ -3,12 +3,4 @@
 
 #include <vdso/const.h>
 
-/*
- * This returns a constant expression while determining if an argument is
- * a constant expression, most importantly without evaluating the argument.
- * Glory to Martin Uecker <Martin.Uecker@med.uni-goettingen.de>
- */
-#define __is_constexpr(x) \
-	(sizeof(int) == sizeof(*(8 ? ((void *)((long)(x) * 0l)) : (int *)8)))
-
 #endif /* _LINUX_CONST_H */
--- a/tools/include/linux/const.h~compilerh-move-__is_constexpr-to-compilerh
+++ a/tools/include/linux/const.h
@@ -3,12 +3,4 @@
 
 #include <vdso/const.h>
 
-/*
- * This returns a constant expression while determining if an argument is
- * a constant expression, most importantly without evaluating the argument.
- * Glory to Martin Uecker <Martin.Uecker@med.uni-goettingen.de>
- */
-#define __is_constexpr(x) \
-	(sizeof(int) == sizeof(*(8 ? ((void *)((long)(x) * 0l)) : (int *)8)))
-
 #endif /* _LINUX_CONST_H */
_

Patches currently in -mm which might be from David.Laight@ACULAB.COM are

minmax-add-umina-b-and-umaxa-b.patch
minmax-allow-min-max-clamp-if-the-arguments-have-the-same-signedness.patch
minmax-fix-indentation-of-__cmp_once-and-__clamp_once.patch
minmax-allow-comparisons-of-int-against-unsigned-char-short.patch
minmax-relax-check-to-allow-comparison-between-unsigned-arguments-and-signed-constants.patch


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

* RE: [failures] compilerh-move-__is_constexpr-to-compilerh.patch removed from -mm tree
  2023-10-03 23:42 [failures] compilerh-move-__is_constexpr-to-compilerh.patch removed from -mm tree Andrew Morton
@ 2023-10-04  8:14 ` David Laight
  2023-10-04 15:08   ` Nathan Chancellor
  0 siblings, 1 reply; 3+ messages in thread
From: David Laight @ 2023-10-04  8:14 UTC (permalink / raw)
  To: 'Andrew Morton', mm-commits@vger.kernel.org,
	torvalds@linux-foundation.org, rostedt@goodmis.org,
	ndesaulniers@google.com, nathan@kernel.org,
	linux@rasmusvillemoes.dk, keescook@chromium.org,
	bvanassche@acm.org, arnd@arndb.de

From: Andrew Morton
> Sent: 04 October 2023 00:42
> 
> 
> The quilt patch titled
>      Subject: compiler.h: move __is_constexpr() to compiler.h
> has been removed from the -mm tree.  Its filename was
>      compilerh-move-__is_constexpr-to-compilerh.patch
> 
> This patch was dropped because it had testing failures

Any hint as to where?

	David

-
Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK
Registration No: 1397386 (Wales)


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

* Re: [failures] compilerh-move-__is_constexpr-to-compilerh.patch removed from -mm tree
  2023-10-04  8:14 ` David Laight
@ 2023-10-04 15:08   ` Nathan Chancellor
  0 siblings, 0 replies; 3+ messages in thread
From: Nathan Chancellor @ 2023-10-04 15:08 UTC (permalink / raw)
  To: David Laight
  Cc: 'Andrew Morton', mm-commits@vger.kernel.org,
	torvalds@linux-foundation.org, rostedt@goodmis.org,
	ndesaulniers@google.com, linux@rasmusvillemoes.dk,
	keescook@chromium.org, bvanassche@acm.org, arnd@arndb.de

On Wed, Oct 04, 2023 at 08:14:53AM +0000, David Laight wrote:
> From: Andrew Morton
> > Sent: 04 October 2023 00:42
> > 
> > 
> > The quilt patch titled
> >      Subject: compiler.h: move __is_constexpr() to compiler.h
> > has been removed from the -mm tree.  Its filename was
> >      compilerh-move-__is_constexpr-to-compilerh.patch
> > 
> > This patch was dropped because it had testing failures
> 
> Any hint as to where?

You were CC'd on the report it seems:

https://lore.kernel.org/20231004095058.392f8c17@canb.auug.org.au/

Cheers,
Nathan

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

end of thread, other threads:[~2023-10-04 15:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-03 23:42 [failures] compilerh-move-__is_constexpr-to-compilerh.patch removed from -mm tree Andrew Morton
2023-10-04  8:14 ` David Laight
2023-10-04 15:08   ` Nathan Chancellor

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.