From nobody Mon Sep 28 21:03:57 2026 Received: from mail-pj1-f52.google.com (mail-pj1-f52.google.com [209.85.216.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4CAFC3B9DA6 for ; Mon, 17 Aug 2026 12:16:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.52 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786968983; cv=none; b=Xnp47SAonVUHZOLFzAmI0pyWzrWnoStbcrhOBLxtUMsODVMKBXivVVHN5Bl1a3i8/VBZOysoxyxPpWqDywCDiKetf3A6RPu2V7a1k0lWODTXZ7PQeP61tACIjkVhOZKJAzcm13wpD5naX0iAhbjIQaYq5OhKsge0rs/bNFiHbbc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786968983; c=relaxed/simple; bh=Od3Z+D9QKNkwA7Ra3Tjhekjp3B+mFMhJJ1xUBWh2m7U=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=XCYpPZz9bCibENKDiihH2qXhghIf59uLksfhz18xif73ksEJnfTDanKs4mAPd+BMMx2jx4PFVblQqGGdPWpaqu9ZZEN2HKZ7+gfdLK8M2ZYpm/8t8SiIK6pgkJQISlAR8Waqw2lCRRXhy4wzPT9tZocqjd0/WsTgYHrihYWpBUc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=MdDY2Glj; arc=none smtp.client-ip=209.85.216.52 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="MdDY2Glj" Received: by mail-pj1-f52.google.com with SMTP id 98e67ed59e1d1-38dfe910e9dso3157986a91.3 for ; Mon, 17 Aug 2026 05:16:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1786968981; x=1787573781; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=yeKNe5WwWbuFbQEI6vcp797V21/Fc+mOSVTIqlTiIBo=; b=MdDY2GljzMbh5Ah3m1mlpUQuI+iw2zk2Q2g2LZa4wdTmC1yFZ4adzVcDd3uZG+CEyu 9qirnCeCBsFqMWCQPEMk3fqp3o1XMS6fxgMSMrxaZ8+pG+jS9K4+orG5x3SWd4ryStcv ltco/w1zB7aCpRrdZHz9riZk1aMdF65srDpR0chTPmQYkGQ442DHgwf7GGOoEfngRMUa ZFvyNUCkm34LFPU04LUrmEkcgWl+0oVnfBXPdsIsvZkuBOGY5eEGDcy14gFFIMThihjo CEgrtQR/ZujJ2TnQxFNvCPhABT5+RVn8prJVxTH4mEnd6TfS0ExVZXA1BAQRrx6GJ0li 3+SA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786968981; x=1787573781; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=yeKNe5WwWbuFbQEI6vcp797V21/Fc+mOSVTIqlTiIBo=; b=DdLP7tW1sO1i7UxnwEzQX4VViuVTzV+1R9c5DcX2b8e6wuHdTy7/By+B9hlHxTN60F KJ4M3k9f9DjZWnhZznGpQkWbP6lzlVgrZFT+CQMvtUDgu1RYFWKJS9XNPrfhOUcKpMzu LAF/+Rd6jaohgcfrkm2wswBGNdIvJRaNCK8cr/WDcWcu1TaHdE0u1ojvpZQjqcJg8N/0 o4DF1oBgvs6hRrZnfUmWqGueXktFUBk5O+HI45DyHqq6MfSlxpwg95F9ZUqjsFQwhpa0 mJsoQuP0WcZ0LMdM4OjpjUw0WVsTPOtgzlaK6+bpE4RlHF/IZC/7Pk7GPofc9/197YWu YZRg== X-Forwarded-Encrypted: i=1; AHgh+Rq/mYGt8tWgm0MkUnIzePxGdZV0EON06mmBrEYDfsywE6704Zw8+lPsmYIA5lvfYjrnLLRhvMChcMq9L+A=@vger.kernel.org X-Gm-Message-State: AOJu0Yx1/dbz6JTgZuaWgZxu2dYRdMLLwUYcNKGAPr7QEztll2kgQ/NZ NBmkj7pQ9EpMzxYtyu58Hbl5CoUU4rRJwRMQygm9OrKjmdwr8YFMih2m X-Gm-Gg: AR+sD11p3/H0LjYubVJ9JJWgW1rVCUomFOUndO8RkQnCyUQxb9HeGqlFzI1DxjPkn68 6OfmmdTBnSYWsRoNn4Bukl437W9W8NRSD9w0nloNwrT791LmqdbXkpee4LrI/hH9Gj0teqvn+3p HNTRuxqWyE2YNrWXG5vEVfM0zoUeR6Ed5KpBN1vKOkD1PzaiOvFVQ5Ng1xJ9AiSPvqb+1PzEBBW kQJtah2V5kRzc4UMEJ/bHzZ572fUTEv8QFjeN3VB1ob+KSY9nbbA/J8mT6D/CFp0PX4rbKt8/g+ tH1I+GJBXcbsAZD3tWhdkT+lThzmoMdXPVXAGE58clfS84egoLlCc/CH2JmsdZhdW+9qcnP0rti T/YXcmob2cnausubLW1ZJB/v8XiIAsXiQk7O8DhtF0r4rdZw/YPfccX4G2ZKEmI32yZyMbJ1fZ7 eVKy73CGNjlNfxJ08oX74FvEPRw39gxbpn4LoWoendbMO8qHF+A9mvJdd9j4ajF0srUJk0mYlE X-Received: by 2002:a17:90b:4986:b0:380:83fc:4315 with SMTP id 98e67ed59e1d1-3955ab8e14emr218859a91.21.1786968980984; Mon, 17 Aug 2026 05:16:20 -0700 (PDT) Received: from osman.mioffice.cn ([43.224.245.178]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3954d38bfa0sm2122652a91.10.2026.08.17.05.16.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Aug 2026 05:16:20 -0700 (PDT) From: Zhan Xusheng X-Google-Original-From: Zhan Xusheng To: David Laight , Andrew Morton Cc: "H . Peter Anvin" , zhanxusheng@xiaomi.com, linux-kernel@vger.kernel.org, Zhan Xusheng Subject: [PATCH] minmax.h: update the stale 'x' versus 'ux' comment Date: Mon, 17 Aug 2026 20:16:13 +0800 Message-ID: <20260817121613.3846511-1-zhanxusheng@xiaomi.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Zhan Xusheng From: Zhan Xusheng Commit b280bb27a9f7 ("minmax.h: reduce the #define expansion of min(), max() and clamp()") made __sign_use(), __is_nonneg() and __types_ok() take only 'ux', and commit a5743f32baec ("minmax.h: use BUILD_BUG_ON_MSG() for the lo < hi test in clamp()") did the same for the clamp() limit test. The comment describing the old split was added one patch earlier and was never updated. 'ux' now carries the value check too, since __is_nonneg() tests it rather than the original expression, and nothing here looks at the value of 'x' any more: it is expanded only to initialise 'ux' and in the error message, as the first of those changes intended. Signed-off-by: Zhan Xusheng --- include/linux/minmax.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/linux/minmax.h b/include/linux/minmax.h index a0158db54a04..5ef4d58c0c42 100644 --- a/include/linux/minmax.h +++ b/include/linux/minmax.h @@ -38,9 +38,9 @@ * Note that 'x' is the original expression, and 'ux' is the unique variab= le * that contains the value. * - * We use 'ux' for pure type checking, and 'x' for when we need to look at= the - * value (but without evaluating it for side effects! - * Careful to only ever evaluate it with sizeof() or __builtin_constant_p(= ) etc). + * We use 'ux' for both the type and the value checks, so 'x' itself is on= ly + * expanded twice: once to initialise 'ux', and once quoted in the error + * message. * * Pointers end up being checked by the normal C type rules at the actual * comparison, and these expressions only need to be careful to not cause --=20 2.43.0