public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Thomas Gleixner <tglx@kernel.org>
To: Peter Zijlstra <peterz@infradead.org>
Cc: kernel test robot <lkp@intel.com>,
	Ian Rogers <irogers@google.com>,
	oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org,
	x86@kernel.org, sparse@chrisli.org, linux-sparse@vger.kernel.org,
	Marco Elver <elver@google.com>
Subject: Re: [tip:timers/vdso 12/14] net/rds/ib_cm.c:96:35: sparse: sparse: incorrect type in argument 1 (different modifiers)
Date: Fri, 16 Jan 2026 12:25:53 +0100	[thread overview]
Message-ID: <87jyxh3ike.ffs@tglx> (raw)
In-Reply-To: <87ms2e32gw.ffs@tglx>

On Fri, Jan 16 2026 at 00:01, Thomas Gleixner wrote:
> This time I looked deeper and it seems that USE_TYPEOF_UNQUAL is not
> set.
>
> If I force it to be set and use a proper compiler and top of tree
> sparse, everything seems to be happy.
>
> Figuring that out is something for tomorrow...

USE_TYPEOF_UNQUAL is set _after_ the __unqual_scalar muck is
processed...

Updated fix below.

Thanks,

        tglx
---
 include/linux/compiler.h       |   10 ----------
 include/linux/compiler_types.h |   11 +++++++++++
 2 files changed, 11 insertions(+), 10 deletions(-)

--- a/include/linux/compiler.h
+++ b/include/linux/compiler.h
@@ -231,16 +231,6 @@ void ftrace_likely_update(struct ftrace_
 				"must be non-C-string (not 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.
  */
--- a/include/linux/compiler_types.h
+++ b/include/linux/compiler_types.h
@@ -562,6 +562,13 @@ struct ftrace_likely_data {
 #define asm_inline asm
 #endif
 
+/*
+ * Use __typeof_unqual__() when available.
+ */
+#if CC_HAS_TYPEOF_UNQUAL || defined(__CHECKER__)
+# define USE_TYPEOF_UNQUAL 1
+#endif
+
 /* Are two types/vars the same type (ignoring qualifiers)? */
 #define __same_type(a, b) __builtin_types_compatible_p(typeof(a), typeof(b))
 
@@ -569,6 +576,7 @@ struct ftrace_likely_data {
  * __unqual_scalar_typeof(x) - Declare an unqualified scalar type, leaving
  *			       non-scalar types unchanged.
  */
+#ifndef USE_TYPEOF_UNQUAL
 /*
  * Prefer C11 _Generic for better compile-times and simpler code. Note: 'char'
  * is not type-compatible with 'signed char', and we define a separate case.
@@ -586,6 +594,9 @@ struct ftrace_likely_data {
 			 __scalar_type_to_expr_cases(long),		\
 			 __scalar_type_to_expr_cases(long long),	\
 			 default: (x)))
+#else
+#define __unqual_scalar_typeof(x) __typeof_unqual__(x)
+#endif
 
 /* Is this type a native word size -- useful for atomic operations */
 #define __native_word(t) \

  reply	other threads:[~2026-01-16 11:25 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-14 16:36 [tip:timers/vdso 12/14] net/rds/ib_cm.c:96:35: sparse: sparse: incorrect type in argument 1 (different modifiers) kernel test robot
2026-01-14 17:51 ` Ian Rogers
2026-01-14 20:04   ` Thomas Gleixner
2026-01-14 21:03     ` Ian Rogers
2026-01-14 21:27       ` Thomas Gleixner
2026-01-14 21:42         ` Ian Rogers
2026-01-15 19:28 ` Thomas Gleixner
2026-01-15 21:11   ` Peter Zijlstra
2026-01-15 21:19     ` Linus Torvalds
2026-01-15 21:30       ` Peter Zijlstra
2026-01-15 23:03         ` Linus Torvalds
2026-01-16  8:28           ` Peter Zijlstra
2026-01-15 23:01     ` Thomas Gleixner
2026-01-16 11:25       ` Thomas Gleixner [this message]
2026-01-16 18:18         ` [PATCH] compiler: Use __typeof_unqual__() for __unqual_scalar_typeof() Thomas Gleixner
2026-01-17  5:25           ` Ian Rogers
2026-01-17 21:25           ` [tip: timers/vdso] " tip-bot2 for Peter Zijlstra
2026-01-18  9:38           ` tip-bot2 for Peter Zijlstra
2026-02-25  8:15           ` [PATCH] " Dan Carpenter
  -- strict thread matches above, loose matches on Subject: below --
2026-01-14  7:13 [tip:timers/vdso 12/14] net/rds/ib_cm.c:96:35: sparse: sparse: incorrect type in argument 1 (different modifiers) kernel test robot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87jyxh3ike.ffs@tglx \
    --to=tglx@kernel.org \
    --cc=elver@google.com \
    --cc=irogers@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sparse@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=peterz@infradead.org \
    --cc=sparse@chrisli.org \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox