All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Laight <david.laight.linux@gmail.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Peter Anvin <hpa@zytor.com>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	Arnd Bergmann <arnd@kernel.org>,
	Christoph Hellwig <hch@infradead.org>,
	"Jason A . Donenfeld" <Jason@zx2c4.com>,
	Herve Codina <herve.codina@bootlin.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH next] minmax.h: Use auto for variables in __minmax_array()
Date: Sun, 8 Feb 2026 11:33:57 +0000	[thread overview]
Message-ID: <20260208113357.62e769b8@pumpkin> (raw)
In-Reply-To: <20260207182559.2223b2ab166877e80714449f@linux-foundation.org>

On Sat, 7 Feb 2026 18:25:59 -0800
Andrew Morton <akpm@linux-foundation.org> wrote:

> On Sat, 7 Feb 2026 10:25:51 +0000 David Laight <david.laight.linux@gmail.com> wrote:
> 
> > On Fri, 6 Feb 2026 14:41:35 -0800
> > Andrew Morton <akpm@linux-foundation.org> wrote:
> >   
> > > On Fri,  6 Feb 2026 22:25:54 +0000 david.laight.linux@gmail.com wrote:
> > >   
> > > > From: David Laight <david.laight.linux@gmail.com>
> > > > 
> > > > While 'auto __element = _array[--__len]' should remove 'const',
> > > > gcc prior to version 11 are buggy and retain it.    
> > > 
> > > With what effect?  
> > 
> > If you have:
> > int f(const int x)
> > {
> > 	auto y = x;
> > 	y++;
> > 	return y;
> > }
> > gcc prior to 11.0 error that y is const.
> > So in this case the loop can't change __element.  
> 
> Still not undersanding, sorry.  Does this patch fix a build issue with
> any compiler/kernel combination?
> 
> > > I'm not understanding the motivation for this change.  Is there some
> > > compilation issue to be addressed?  
> > 
> > Mainly unqual_scalar_typeof() being horrid.
> > There is an ongoing long thread about its use in the arm64 LTO READ_ONCE().
> > Newer compilers do have a builtin, and there are some shorter alternatives
> > that work in some places.
> > But here is just isn't needed.
> > So one less place to check.  
> 
> OK, so it's a cleanup.
> 
> > I did mean to copy the main contributers to that thread, but forgot.  
> 
> I think a v2 would be good please, to clarify the effects of and
> motivation for the change.

Ok - I always expect to do a v2, the way of the world.

	David



  reply	other threads:[~2026-02-08 11:34 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-06 22:25 [PATCH next] minmax.h: Use auto for variables in __minmax_array() david.laight.linux
2026-02-06 22:41 ` Andrew Morton
2026-02-07 10:25   ` David Laight
2026-02-08  2:25     ` Andrew Morton
2026-02-08 11:33       ` David Laight [this message]
2026-02-07 10:50 ` David Laight
2026-02-10  1:38   ` Marco Elver

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=20260208113357.62e769b8@pumpkin \
    --to=david.laight.linux@gmail.com \
    --cc=Jason@zx2c4.com \
    --cc=akpm@linux-foundation.org \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=arnd@kernel.org \
    --cc=hch@infradead.org \
    --cc=herve.codina@bootlin.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.