mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Al Viro <viro@zeniv.linux.org.uk>
Cc: "kernel test robot" <lkp@intel.com>,
	"Eric Dumazet" <edumazet@google.com>,
	oe-kbuild-all@lists.linux.dev, linux-kernel@vger.kernel.org,
	"Jakub Kicinski" <kuba@kernel.org>,
	"Maciej Żenczykowski" <maze@google.com>,
	"Will Deacon" <will@kernel.org>,
	"Paul E. McKenney" <paulmck@kernel.org>
Subject: Re: include/net/sock.h:2100:16: sparse: sparse: cast to non-scalar
Date: Tue, 13 Jan 2026 16:27:05 +0100	[thread overview]
Message-ID: <20260113152705.GX830755@noisy.programming.kicks-ass.net> (raw)
In-Reply-To: <20260112193019.GK3634291@ZenIV>

On Mon, Jan 12, 2026 at 07:30:19PM +0000, Al Viro wrote:

> Sure, but what does that have to do with the final cast in there?  Note
> that generic __READ_ONCE() ends up with __unqual_scalar_typeof(x) for the
> type of result and it seems to be working fine.
> 
> Why would the same type of result be a problem for alpha?  Sure, we need
> a barrier there, so it can't be literal copy of generic __READ_ONCE(),
> but what's the problem with using
> 
> #define __READ_ONCE(x)							\
> ({									\
> 	__unqual_scalar_typeof(x) __x =					\
>  		(*(volatile typeof(__x) *)(&(x)));			\
> 	mb();								\
> 	__x;								\
> })
> 
> there?  What could possibly need those qualifiers added back to the result?
> It is, after all, an r-value, so...

Yeah, I'm not sure about the final cast, that was probably trying to add
'const' back.

  reply	other threads:[~2026-01-13 15:27 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-10 21:06 kernel test robot
2026-01-10 22:15 ` Al Viro
2026-01-10 22:35   ` Al Viro
2026-01-11 10:08     ` Eric Dumazet
2026-01-12 12:33       ` Peter Zijlstra
2026-01-11 18:20     ` Al Viro
2026-01-11 18:51       ` Al Viro
2026-01-12 12:37       ` Peter Zijlstra
2026-01-12 15:02         ` Will Deacon
2026-01-12 19:21         ` Al Viro
2026-01-12 21:16           ` Al Viro
2026-01-12 22:39             ` David Laight
2026-01-13  0:28               ` Al Viro
2026-01-12 12:32     ` Peter Zijlstra
2026-01-12 19:30       ` Al Viro
2026-01-13 15:27         ` Peter Zijlstra [this message]
2026-01-12  0:49   ` Philip Li
  -- strict thread matches above, loose matches on Subject: below --
2025-12-06 10:09 kernel test robot
2025-08-25  4:45 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=20260113152705.GX830755@noisy.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lkp@intel.com \
    --cc=maze@google.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    --cc=paulmck@kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    --cc=will@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

all inboxes | Powered by JetHome®