linux-next: manual merge of the mm tree with Linus' tree

Stephen Rothwell
2025-02-09T22:39:37Z

[-- Attachment #1: Type: text/plain, Size: 2518 bytes --]

Hi all,

Today's linux-next merge of the mm tree got a conflict in:

include/linux/compiler.h

between commits:

cb7380de9e4c ("compiler.h: Move C string helpers into C-only kernel section")
20e5cc26e56d ("compiler.h: Introduce __must_be_byte_array()")

from Linus' tree and commit:

a7d395568dd3 ("compiler.h: introduce TYPEOF_UNQUAL() macro")

from the mm-unstable branch of the mm tree.

I fixed it up (see below) and can carry the fix as necessary. This
is now fixed as far as linux-next is concerned, but any non trivial
conflicts should be mentioned to your upstream maintainer when your tree
is submitted for merging. You may also want to consider cooperating
with the maintainer of the conflicting tree to minimise any particularly
complex conflicts.

--
Cheers,
Stephen Rothwell

diff --cc include/linux/compiler.h
index 200fd3c5bc70,a892c89ac28a..000000000000
--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@@ -191,25 -191,26 +191,45 @@@ void ftrace_likely_update(struct ftrace
__v; \
})

+#ifdef __CHECKER__
+#define __BUILD_BUG_ON_ZERO_MSG(e, msg) (0)
+#else /* __CHECKER__ */
+#define __BUILD_BUG_ON_ZERO_MSG(e, msg) ((int)sizeof(struct {_Static_assert(!(e), msg);}))
+#endif /* __CHECKER__ */
+
+/* &a[0] degrades to a pointer: a different type from an array */
+#define __is_array(a) (!__same_type((a), &(a)[0]))
+#define __must_be_array(a) __BUILD_BUG_ON_ZERO_MSG(!__is_array(a), \
+ "must be array")
+
+#define __is_byte_array(a) (__is_array(a) && sizeof((a)[0]) == 1)
+#define __must_be_byte_array(a) __BUILD_BUG_ON_ZERO_MSG(!__is_byte_array(a), \
+ "must be byte array")
+
+/* Require C Strings (i.e. NUL-terminated) lack the "nonstring" attribute. */
+#define __must_be_cstr(p) \
+ __BUILD_BUG_ON_ZERO_MSG(__annotated(p, nonstring), "must be cstr (NUL-terminated)")
+
+ /*
+ * Use __typeof_unqual__() when available.
+ *
+ * XXX: Remove test for __CHECKER__ once
+ * sparse learns about __typeof_unqual__().
+ */
+ #if CC_HAS_TYPEOF_UNQUAL && !defined(__CHECKER__)
+ # define USE_TYPEOF_UNQUAL 1
+ #endif
+
+ /*
+ * Define TYPEOF_UNQUAL() to use __typeof_unqual__() as typeof
+ * operator when available, to return an unqualified type of the exp.
+ */
+ #if defined(USE_TYPEOF_UNQUAL)
+ # define TYPEOF_UNQUAL(exp) __typeof_unqual__(exp)
+ #else
+ # define TYPEOF_UNQUAL(exp) __typeof__(exp)
+ #endif
+
#endif /* __KERNEL__ */

/**

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]