linux-sparse.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Farber, Eliav" <farbere@amazon.com>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: "luc.vanoostenryck@gmail.com" <luc.vanoostenryck@gmail.com>,
	"rostedt@goodmis.org" <rostedt@goodmis.org>,
	"mingo@redhat.com" <mingo@redhat.com>,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
	"sj@kernel.org" <sj@kernel.org>,
	"David.Laight@aculab.com" <David.Laight@aculab.com>,
	"Jason@zx2c4.com" <Jason@zx2c4.com>,
	"andriy.shevchenko@linux.intel.com"
	<andriy.shevchenko@linux.intel.com>,
	"bvanassche@acm.org" <bvanassche@acm.org>,
	"keescook@chromium.org" <keescook@chromium.org>,
	"linux-sparse@vger.kernel.org" <linux-sparse@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Chocron, Jonathan" <jonnyc@amazon.com>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>,
	Rasmus Villemoes <linux@rasmusvillemoes.dk>,
	"Farber, Eliav" <farbere@amazon.com>
Subject: RE: [PATCH 1/7 5.10.y] tracing: Define the is_signed_type() macro once
Date: Wed, 17 Sep 2025 10:37:31 +0000	[thread overview]
Message-ID: <91da8ce3e4fb4a8991876a3ed130a873@amazon.com> (raw)
In-Reply-To: <2025091717-snowflake-subtract-40f7@gregkh>

> On Tue, Sep 16, 2025 at 09:22:53PM +0000, Eliav Farber wrote:
> > From: Bart Van Assche <bvanassche@acm.org>
> >
> > commit 92d23c6e94157739b997cacce151586a0d07bb8a upstream.
>
> This is only in 6.1, and not other trees, why is it needed here?

It exists also in 5.15:
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/include/linux/overflow.h?h=v5.15.193&id=ed6e37e30826b12572636c6bbfe6319233690c90

Without this change, I get many compilation errors when backporting
commit d53b5d862acd ("minmax: allow min()/max()/clamp() if the
arguments have the same signedness.")

  CALL    scripts/atomic/check-atomics.sh
  CC      arch/arm64/kernel/asm-offsets.s
In file included from ./include/linux/bits.h:22,
                 from ./include/linux/ioport.h:15,
                 from ./include/linux/acpi.h:12,
                 from ./include/acpi/apei.h:9,
                 from ./include/acpi/ghes.h:5,
                 from ./include/linux/arm_sdei.h:8,
                 from arch/arm64/kernel/asm-offsets.c:10:
./include/linux/nodemask.h: In function '__first_node':
./include/linux/minmax.h:30:39: error: implicit declaration of function 'is_signed_type' [-Werror=implicit-function-declaration]
   30 |  __builtin_choose_expr(__is_constexpr(is_signed_type(typeof(x))), \
      |                                       ^~~~~~~~~~~~~~
./include/linux/build_bug.h:78:56: note: in definition of macro '__static_assert'
   78 | #define __static_assert(expr, msg, ...) _Static_assert(expr, msg)
      |                                                        ^~~~
./include/linux/minmax.h:50:3: note: in expansion of macro 'static_assert'
   50 |   static_assert(__types_ok(x, y),  \
      |   ^~~~~~~~~~~~~
./include/linux/minmax.h:30:24: note: in expansion of macro '__is_constexpr'
   30 |  __builtin_choose_expr(__is_constexpr(is_signed_type(typeof(x))), \
      |                        ^~~~~~~~~~~~~~
./include/linux/minmax.h:38:3: note: in expansion of macro '__is_signed'
   38 |  (__is_signed(x) == __is_signed(y) ||   \
      |   ^~~~~~~~~~~
./include/linux/minmax.h:50:17: note: in expansion of macro '__types_ok'
   50 |   static_assert(__types_ok(x, y),  \
      |                 ^~~~~~~~~~
./include/linux/minmax.h:57:3: note: in expansion of macro '__cmp_once'
   57 |   __cmp_once(op, x, y, __UNIQUE_ID(__x), __UNIQUE_ID(__y)))
      |   ^~~~~~~~~~
./include/linux/minmax.h:160:27: note: in expansion of macro '__careful_cmp'
  160 | #define min_t(type, x, y) __careful_cmp(min, (type)(x), (type)(y))
      |                           ^~~~~~~~~~~~~
./include/linux/nodemask.h:265:9: note: in expansion of macro 'min_t'
  265 |  return min_t(unsigned int, MAX_NUMNODES, find_first_bit(srcp->bits, MAX_NUMNODES));
      |         ^~~~~
./include/linux/minmax.h:30:54: error: expected expression before 'typeof'
   30 |  __builtin_choose_expr(__is_constexpr(is_signed_type(typeof(x))), \
      |                                                      ^~~~~~
./include/linux/build_bug.h:78:56: note: in definition of macro '__static_assert'
...


> > Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> (cherry 
> > picked from commit a49a64b5bf195381c09202c524f0f84b5f3e816f)
>
> This is not a valid git id in the tree at all.

I will fix the mismatch here and above, but please notice that this
hash appears in the link I shared.

---
Regards, Eliav

  reply	other threads:[~2025-09-17 10:37 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-09-16 21:22 [PATCH 0/7 5.10.y] Cherry pick of minmax.h commits from 5.15.y Eliav Farber
2025-09-16 21:22 ` [PATCH 1/7 5.10.y] tracing: Define the is_signed_type() macro once Eliav Farber
2025-09-17  8:40   ` Greg KH
2025-09-17 10:37     ` Farber, Eliav [this message]
2025-09-21 17:30       ` Greg KH
2025-09-16 21:22 ` [PATCH 2/7 5.10.y] minmax: sanity check constant bounds when clamping Eliav Farber
2025-09-16 21:22 ` [PATCH 3/7 5.10.y] minmax: clamp more efficiently by avoiding extra comparison Eliav Farber
2025-09-16 21:22 ` [PATCH 4/7 5.10.y] minmax: fix header inclusions Eliav Farber
2025-09-18 21:01 ` [PATCH 0/7 5.10.y] Cherry pick of minmax.h commits from 5.15.y David Laight
2025-09-19 10:41   ` Farber, Eliav

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=91da8ce3e4fb4a8991876a3ed130a873@amazon.com \
    --to=farbere@amazon.com \
    --cc=David.Laight@aculab.com \
    --cc=Jason@zx2c4.com \
    --cc=akpm@linux-foundation.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=bvanassche@acm.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jonnyc@amazon.com \
    --cc=keescook@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sparse@vger.kernel.org \
    --cc=linux@rasmusvillemoes.dk \
    --cc=luc.vanoostenryck@gmail.com \
    --cc=mingo@redhat.com \
    --cc=rostedt@goodmis.org \
    --cc=sj@kernel.org \
    --cc=stable@vger.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;
as well as URLs for NNTP newsgroup(s).