From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 269A4CCD195 for ; Fri, 17 Oct 2025 08:06:07 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7B2B1940007; Fri, 17 Oct 2025 04:06:06 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 789718E0016; Fri, 17 Oct 2025 04:06:06 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6A31E940007; Fri, 17 Oct 2025 04:06:06 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 573C38E0016 for ; Fri, 17 Oct 2025 04:06:06 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id D933911A6B5 for ; Fri, 17 Oct 2025 08:06:05 +0000 (UTC) X-FDA: 84006873090.21.AFE3C97 Received: from sea.source.kernel.org (sea.source.kernel.org [172.234.252.31]) by imf04.hostedemail.com (Postfix) with ESMTP id 21C3140012 for ; Fri, 17 Oct 2025 08:06:03 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=fail ("body hash did not verify") header.d=linuxfoundation.org header.s=korg header.b=Y6mHGuWQ; spf=pass (imf04.hostedemail.com: domain of gregkh@linuxfoundation.org designates 172.234.252.31 as permitted sender) smtp.mailfrom=gregkh@linuxfoundation.org; dmarc=pass (policy=none) header.from=linuxfoundation.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1760688364; a=rsa-sha256; cv=none; b=LDQklCBZL0n0g5J8NbOZ893fE2PcUcjb08UvZmWCPX/LVBgRMONzyD2AK8/Jz+dT6HsXp3 N2gvf8lWSwymljOVWFOEEFYL8yagm4ROSAQZ69iSDnlyEhBoKjgsAOIWeJnguL/mcm0Fv1 o7L1nROjDcaBi7+sy+R+E2ctfnZ6mYY= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=fail ("body hash did not verify") header.d=linuxfoundation.org header.s=korg header.b=Y6mHGuWQ; spf=pass (imf04.hostedemail.com: domain of gregkh@linuxfoundation.org designates 172.234.252.31 as permitted sender) smtp.mailfrom=gregkh@linuxfoundation.org; dmarc=pass (policy=none) header.from=linuxfoundation.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1760688364; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:dkim-signature; bh=xY4MEbgCHtGFmJWZRsGNyB6dOPi52d3wgALR4029T5s=; b=Q+OeBlzdPdbyoFFjzhXnhtWEmDXzUFh9yVC+rW0I1500sKbxlHD86WX/TWnQzuccPQjmN0 B16XyfSBMt6peVQ9yxr/guoKLSyuxJ+/Hjomtst2ftqXHB0mYRz9mrH3euRwS6fr74FXw7 0kLHvPO0f7ccZPdh3sYlFk8NRHoSLHI= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sea.source.kernel.org (Postfix) with ESMTP id 091BB458E6; Fri, 17 Oct 2025 08:06:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6231CC4CEE7; Fri, 17 Oct 2025 08:06:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1760688362; bh=owzjRvph/NPKp6B8gmKFNGdV0kzZ99gtjp1pFkr8LIQ=; h=Subject:To:Cc:From:Date:In-Reply-To:From; b=Y6mHGuWQZMRZl2kVl62kX1cU/q0pVYspLqG2UNb5HqyurgVahkdof7hOVSxg1Nid8 FDEx/1FA+ICPHmHWL/k/InExPC1F/c2MnJ4AN76f/3pLt/tn9wDx40n4gQl69YXm0K q3btO+UCLJdPLsoy09uWJ5/YKHwe3eP/zmB1rAS8= Subject: Patch "minmax: deduplicate __unconst_integer_typeof()" has been added to the 5.15-stable tree To: David.Laight@ACULAB.COM, adilger.kernel@dilger.ca, agk@redhat.com, airlied@linux.ie, akpm@linux-foundation.org, amd-gfx@lists.freedesktop.org, andriy.shevchenko@linux.intel.com, anton.ivanov@cambridgegreys.com, bp@alien8.de, clm@fb.com, coreteam@netfilter.org, daniel@ffwll.ch, dave.hansen@linux.intel.com, davem@davemloft.net, dm-devel@redhat.com, dmitry.torokhov@gmail.com, dri-devel@lists.freedesktop.org, dsahern@kernel.org, dsterba@suse.com, dushistov@mail.ru, farbere@amazon.com, freedreno@lists.freedesktop.org, fw@strlen.de, gregkh@linuxfoundation.org, hdegoede@redhat.com, herve.codina@bootlin.com, hpa@zytor.com, jack@suse.com, james.morse@arm.com, jdelvare@suse.com, jdike@addtoit.com, jejb@linux.ibm.com, jernej.skrabec@gmail.com, jmaloy@redhat.com, josef@toxicpanda.com, kadlec@netfilter.org, krzysztof.kozlowski@canonical.com, kuba@kernel.org, linus.walleij@linaro.org, linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org, linux-staging@lists.linux.dev, linux-stm32@st-md-mailman.stormreply.com, linux-sunxi@lists.linu, x.dev@kvack.org, linux-um@lists.infradead.org, linux@rasmusvillemoes.dk, linux@roeck-us.net, luc.vanoostenryck@gmail.com, luto@kernel.org, maarten.lankhorst@linux.intel.com, malattia@linux.it, martin.petersen@oracle.com, maz@kernel.org, mcoquelin.stm32@gmail.com, mgross@linux.intel.com, minchan@kernel.org, mingo@redhat.com, mripard@kernel.org, ngupta@vflare.org, pablo@netfilter.org, peterz@infradead.org, pmladek@suse.com, qiuxu.zhuo@intel.com, quic_akhilpo@quicinc.com, richard@nod.at, robdclark@gmail.com, rostedt@goodmis.org, rric@kernel.org, ruanjinjie@huawei.com, sakari.ailus@linux.intel.com, sashal@kernel.org, sean@poorly.run, senozhatsky@chromium.org, shuah@kernel.org, snitzer@redhat.com, tglx@linutronix.de, tipc-discussion@lists.sourceforge.net, tony.luck@intel.com, tytso@mit.edu, tzimmermann@suse.de, wens@csie.org, willy@infradead.org, x86@kernel.org, ying.xue@windriver.com, yoshfuji@linux-ipv6.org Cc: From: Date: Fri, 17 Oct 2025 10:05:10 +0200 In-Reply-To: <20251008152946.29285-4-farbere@amazon.com> Message-ID: <2025101710-lid-subpanel-e05d@gregkh> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit X-stable: commit X-Patchwork-Hint: ignore X-Rspam-User: X-Stat-Signature: bdyfbwqxkkuiwr4e7ms8keuf3sba97we X-Rspamd-Queue-Id: 21C3140012 X-Rspamd-Server: rspam09 X-HE-Tag: 1760688363-131541 X-HE-Meta: U2FsdGVkX19uL6/nA72grbvstQf15aL2IhxGoc8N2N9oAQAjvwzIPXJclhz2CrbOQMkj7kKX2LJk/IwUdktuFV0S+ghMU7vroSaVNEYof4fCO87Yya+rN+LQgZuvFnqL9AcjkrKLez1oeEONEc7FgSDFlc8pm0sTqUoNnCEv50VF3gNW6rppM+Beb2YrpSwnrKWGXFf8CPD4MK6EyBd0ctloc0vQuWqwNrhnJMx3DWWQ33fuL69DHMTUT8oBmhPJ/wrG9fgRskfncjIM5lEO7XQ8IC8PckPcj82l2hWI5ykURqL2mw1wyur8MwkRzpIqttPvtGz9Wk45Eha2AfDQQnPbR10VYOtcOVt/n6vbnTygXqK22bpSumxcziyiGwJrJ4HdcS8Qsl+2zFzU/KNDDUqsJEAbUP3phMvBzx1JeOC/ay7hspoPJSXuqdSoSOca1kYjaASdvEaCKTjaf1nbvlt+KCw16e5E4PWvzzGSgj9IWpw9s77ej0Azl+9enH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uyEWX3g1qHh2PrxKqPpAhI7QbnD95F1dK6AH2+cyAsOX79yzwgJf9vBG9ohMRNKBKYVgASRQph8kK6I58c4DB+ruBDejfCKq+IyhS4ARc2Eh0SwPWiSppWY+KKM6P9TErUfyWoqp73B6Uen89qZOJJ5efBI6V07o+a89xmGhbY52hBz1Mw8B4E99PuMG8emDcwIiTaLIw== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: This is a note to let you know that I've just added the patch titled minmax: deduplicate __unconst_integer_typeof() to the 5.15-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: minmax-deduplicate-__unconst_integer_typeof.patch and it can be found in the queue-5.15 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >From stable+bounces-183615-greg=kroah.com@vger.kernel.org Wed Oct 8 17:32:08 2025 From: Eliav Farber Date: Wed, 8 Oct 2025 15:29:28 +0000 Subject: minmax: deduplicate __unconst_integer_typeof() To: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Message-ID: <20251008152946.29285-4-farbere@amazon.com> From: Andy Shevchenko [ Upstream commit 5e57418a2031cd5e1863efdf3d7447a16a368172 ] It appears that compiler_types.h already have an implementation of the __unconst_integer_typeof() called __unqual_scalar_typeof(). Use it instead of the copy. Link: https://lkml.kernel.org/r/20230911154913.4176033-1-andriy.shevchenko@linux.intel.com Signed-off-by: Andy Shevchenko Acked-by: Herve Codina Signed-off-by: Andrew Morton Signed-off-by: Eliav Farber Signed-off-by: Greg Kroah-Hartman --- include/linux/minmax.h | 25 ++----------------------- 1 file changed, 2 insertions(+), 23 deletions(-) --- a/include/linux/minmax.h +++ b/include/linux/minmax.h @@ -169,27 +169,6 @@ #define max_t(type, x, y) __careful_cmp(max, (type)(x), (type)(y)) /* - * Remove a const qualifier from integer types - * _Generic(foo, type-name: association, ..., default: association) performs a - * comparison against the foo type (not the qualified type). - * Do not use the const keyword in the type-name as it will not match the - * unqualified type of foo. - */ -#define __unconst_integer_type_cases(type) \ - unsigned type: (unsigned type)0, \ - signed type: (signed type)0 - -#define __unconst_integer_typeof(x) typeof( \ - _Generic((x), \ - char: (char)0, \ - __unconst_integer_type_cases(char), \ - __unconst_integer_type_cases(short), \ - __unconst_integer_type_cases(int), \ - __unconst_integer_type_cases(long), \ - __unconst_integer_type_cases(long long), \ - default: (x))) - -/* * Do not check the array parameter using __must_be_array(). * In the following legit use-case where the "array" passed is a simple pointer, * __must_be_array() will return a failure. @@ -203,13 +182,13 @@ * 'int *buff' and 'int buff[N]' types. * * The array can be an array of const items. - * typeof() keeps the const qualifier. Use __unconst_integer_typeof() in order + * typeof() keeps the const qualifier. Use __unqual_scalar_typeof() in order * to discard the const qualifier for the __element variable. */ #define __minmax_array(op, array, len) ({ \ typeof(&(array)[0]) __array = (array); \ typeof(len) __len = (len); \ - __unconst_integer_typeof(__array[0]) __element = __array[--__len]; \ + __unqual_scalar_typeof(__array[0]) __element = __array[--__len];\ while (__len--) \ __element = op(__element, __array[__len]); \ __element; }) Patches currently in stable-queue which might be from farbere@amazon.com are queue-5.15/minmax-fix-indentation-of-__cmp_once-and-__clamp_once.patch queue-5.15/minmax-add-in_range-macro.patch queue-5.15/minmax-deduplicate-__unconst_integer_typeof.patch queue-5.15/minmax-avoid-overly-complicated-constant-expressions-in-vm-code.patch queue-5.15/minmax-introduce-min-max-_array.patch