From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4EEDB17A2E8 for ; Sun, 8 Feb 2026 02:26:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770517561; cv=none; b=o5xox6OLRMfb+kwj5bB3FRN3HHU6dFlNqTujDCSZM/EqR+AAmusHsCrxd4dNZm36KEm3nwRp3KMtW+Vg3kmufuYUEk4WkDMODWQlffQXVpSngIDC6MfUUdx1/om9HycihDeEfiYQfIbItcigQLXiavGfsd7e1PhyRTlaEaJcZ3o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770517561; c=relaxed/simple; bh=KUy+MMwui6xFR0PvqQZmoo7MLlHp6mma+5KGPXAHRIw=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=LkkSTZEQ1E3k44HM3jsRM3ZFGllnq/rvSq/NyBX97at9lEqd+gxscNFHFo7JAoYBdXHNEU1JFRhxM+pymDzF79FN8SzUE/IesnlUXxHvDJ86Pb1MQMv4DozIVhglbaV90Ig8KHz5gM8JBdI2NZyCAuIQ3J9rZDDAU0GHD8DWiHk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=v8QgsoOj; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="v8QgsoOj" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6E843C116D0; Sun, 8 Feb 2026 02:26:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1770517560; bh=KUy+MMwui6xFR0PvqQZmoo7MLlHp6mma+5KGPXAHRIw=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=v8QgsoOjXxOSPsdvYsaiL4mKKf3ukfav+6+OnUcqj3MafOwl/socHzRLcVALsZ0RI wq1Zue0zjsEpXmb9awP3t00rUBasXy7vJZhDcju9xuZ1EvhwkzHX5x3djHxMNXsqWu 6D96m5JCe+3Jgn4tEAwT00l/J4Dayf9cf8+dWI8E= Date: Sat, 7 Feb 2026 18:25:59 -0800 From: Andrew Morton To: David Laight Cc: Peter Anvin , Andy Shevchenko , Arnd Bergmann , Christoph Hellwig , "Jason A . Donenfeld" , Herve Codina , Linus Torvalds , linux-kernel@vger.kernel.org Subject: Re: [PATCH next] minmax.h: Use auto for variables in __minmax_array() Message-Id: <20260207182559.2223b2ab166877e80714449f@linux-foundation.org> In-Reply-To: <20260207102551.74a42680@pumpkin> References: <20260206222554.676171-1-david.laight.linux@gmail.com> <20260206144135.89b1edb4f25fed21b7a1ccc9@linux-foundation.org> <20260207102551.74a42680@pumpkin> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Sat, 7 Feb 2026 10:25:51 +0000 David Laight wrote: > On Fri, 6 Feb 2026 14:41:35 -0800 > Andrew Morton wrote: > > > On Fri, 6 Feb 2026 22:25:54 +0000 david.laight.linux@gmail.com wrote: > > > > > From: David Laight > > > > > > 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.