From: David Laight <david.laight.linux@gmail.com>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Bart Van Assche <bvanassche@acm.org>,
Steven Rostedt <rostedt@goodmis.org>,
linux-kernel@vger.kernel.org, Christoph Hellwig <hch@lst.de>
Subject: Re: [PATCH] compiler.h: Support 64-bit bitwise types in is_signed_type()
Date: Thu, 19 Nov 2026 23:14:39 +0000 [thread overview]
Message-ID: <20261119231439.64cc05af@pumpkin> (raw)
In-Reply-To: <CAHk-=wg_njGtSQ3qCmPW1P2OWOc-74zt7G0BxOB2s1+4SnAgTQ@mail.gmail.com>
On Thu, 19 Nov 2026 10:27:38 -0800
Linus Torvalds <torvalds@linux-foundation.org> wrote:
> On Wed, 18 Nov 2026 at 04:13, David Laight <david.laight.linux@gmail.com> wrote:
> >
> > The fields ought to be u64 - since that is how they are printed.
>
> ... but then the actual tracing side would be worse and either require
> a stupid and incorrect cast, or actual work to turn it into host byte
> order.
>
> So clearly the printing side doesn't understand about byte order, but
> that's a printing side issue (that nobody really cares abnout:
> big-endian is dead, and good riddance).
>
> That said: I think the right fix might actually be to just allow sign
> extension of the constants 0/-1 inside sparse for bitwise types.
>
> So the sparse warning "cast to restricted __le64" should just be
> suppressed for the values that bitwise types already accept (all ones
> and all zeroes).
I guess if sparse is going to allow the cast at all, it should sign
extend the -1 first - the same as the compiler does.
David
> Because all ones and all zeroes are by definition fine in bitwise
> types. Bit orderign and meaning doesn't matter when all bits are
> equal.
>
> Linus
prev parent reply other threads:[~2026-11-19 23:14 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-16 22:26 Bart Van Assche
2026-11-17 8:06 ` David Laight
2026-11-17 16:32 ` Bart Van Assche
2026-11-18 12:13 ` David Laight
2026-11-19 18:27 ` Linus Torvalds
2026-11-19 23:14 ` David Laight [this message]
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=20261119231439.64cc05af@pumpkin \
--to=david.laight.linux@gmail.com \
--cc=bvanassche@acm.org \
--cc=hch@lst.de \
--cc=linux-kernel@vger.kernel.org \
--cc=rostedt@goodmis.org \
--cc=torvalds@linux-foundation.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
all inboxes | Powered by JetHome®