From nobody Thu Oct 2 06:16:47 2025 Received: from fra-out-012.esa.eu-central-1.outbound.mail-perimeter.amazon.com (fra-out-012.esa.eu-central-1.outbound.mail-perimeter.amazon.com [52.57.120.243]) (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 95D322FF650; Mon, 22 Sep 2025 10:38:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=52.57.120.243 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758537506; cv=none; b=FmKHct4IOD+2cTu1TfMYtAxitkw8r5p76Rry060fibeTR/zL8JuyuSlynF99rYPj01v9azDiEoBDtCxEpgVKdWNcA6K5U0VAqHSVDicPQ9rLm9jBXQwGPVer5s783GeOO69mXmyGiSxczVJknmFFEBqo167zDq64xGbpjODwG5U= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1758537506; c=relaxed/simple; bh=20xAuZOYw8I0ufWzB2Ksi4V2Oix+SUEkw1tbLPElVss=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=jyYrqmpzfOBVIT3xym//vm2MHbk1VPnEVLWZmn/0R4dxZFD55L7a6Ru4tJBgOm1cDZbEfgLynZj6Ibv7SR9Me7xG6bm9UaP0c5MeBt0DY05TTBHobbX3HRtbfvYiuquGV3+gX1u19x/jgCvd9rjsVzUeHAkhk2DpsFe8nYyM8nQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amazon.com; spf=pass smtp.mailfrom=amazon.com; dkim=pass (2048-bit key) header.d=amazon.com header.i=@amazon.com header.b=JX8Xgm1V; arc=none smtp.client-ip=52.57.120.243 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=amazon.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=amazon.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=amazon.com header.i=@amazon.com header.b="JX8Xgm1V" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazoncorp2; t=1758537504; x=1790073504; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=OdmfzjzF46YfqPKnSMGZyjhQcZN9I6u6dSg4k1vq8LU=; b=JX8Xgm1VXqP77beLgyIOgpB6xYYUm0UuogpAI8qmDCvFA2kpt+YDlOyk OMkVYpNV9+/Bt1HXZ8t3cZ+lrRLBOoQA/dsy8MQPt1k3KeFWdfHyA7zf+ y1awNy/mtPFwT7GM0Xc86Ex6+i6Q4SCQc/g4vGbEEJZNx7ZFwI/GGGT61 kKnaww9P0b7W7m7lyuHTl2njB9ry0gp9bm63NTbx35tK1w37oKvS8KUnP X1dEkqNXgUc9yaWLfuFvMXCTHUEFHL6/xuU/N78z++e79TnD417COx7U/ Lq43yM6pG6xo36MNPc+AY9cZooFMDcqcbmR//YR416XRHPuo28l97zwcl g==; X-CSE-ConnectionGUID: VxD2L9QmSRKftLbRtlXCBQ== X-CSE-MsgGUID: uuvVt1i1TAeI+VJw7UWbHg== X-IronPort-AV: E=Sophos;i="6.18,285,1751241600"; d="scan'208";a="2375252" Received: from ip-10-6-6-97.eu-central-1.compute.internal (HELO smtpout.naws.eu-central-1.prod.farcaster.email.amazon.dev) ([10.6.6.97]) by internal-fra-out-012.esa.eu-central-1.outbound.mail-perimeter.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 Sep 2025 10:38:01 +0000 Received: from EX19MTAEUC001.ant.amazon.com [54.240.197.225:16102] by smtpin.naws.eu-central-1.prod.farcaster.email.amazon.dev [10.0.1.3:2525] with esmtp (Farcaster) id 9f52a6de-5c14-41ff-98ae-8549e737ee90; Mon, 22 Sep 2025 10:38:01 +0000 (UTC) X-Farcaster-Flow-ID: 9f52a6de-5c14-41ff-98ae-8549e737ee90 Received: from EX19D018EUA004.ant.amazon.com (10.252.50.85) by EX19MTAEUC001.ant.amazon.com (10.252.51.155) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA) id 15.2.2562.20; Mon, 22 Sep 2025 10:37:58 +0000 Received: from dev-dsk-farbere-1a-46ecabed.eu-west-1.amazon.com (172.19.116.181) by EX19D018EUA004.ant.amazon.com (10.252.50.85) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA) id 15.2.2562.20; Mon, 22 Sep 2025 10:37:31 +0000 From: Eliav Farber To: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , CC: Christoph Hellwig , Dan Carpenter , "Jason A. Donenfeld" , "Jens Axboe" , Lorenzo Stoakes , Mateusz Guzik , Matthew Wilcox , Pedro Falcato Subject: [PATCH 09/15 6.6.y] minmax.h: add whitespace around operators and after commas Date: Mon, 22 Sep 2025 10:32:35 +0000 Message-ID: <20250922103241.16213-10-farbere@amazon.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20250922103241.16213-1-farbere@amazon.com> References: <20250922103241.16213-1-farbere@amazon.com> 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 X-ClientProxiedBy: EX19D033UWA003.ant.amazon.com (10.13.139.42) To EX19D018EUA004.ant.amazon.com (10.252.50.85) Content-Type: text/plain; charset="utf-8" From: David Laight [ Upstream commit 71ee9b16251ea4bf7c1fe222517c82bdb3220acc ] Patch series "minmax.h: Cleanups and minor optimisations". Some tidyups and minor changes to minmax.h. This patch (of 7): Link: https://lkml.kernel.org/r/c50365d214e04f9ba256d417c8bebbc0@AcuMS.acul= ab.com Link: https://lkml.kernel.org/r/f04b2e1310244f62826267346fde0553@AcuMS.acul= ab.com Signed-off-by: David Laight Cc: Andy Shevchenko Cc: Arnd Bergmann Cc: Christoph Hellwig Cc: Dan Carpenter Cc: Jason A. Donenfeld Cc: Jens Axboe Cc: Lorenzo Stoakes Cc: Mateusz Guzik Cc: Matthew Wilcox Cc: Pedro Falcato Signed-off-by: Andrew Morton Signed-off-by: Eliav Farber --- include/linux/minmax.h | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/include/linux/minmax.h b/include/linux/minmax.h index 98008dd92153..51b0d988e322 100644 --- a/include/linux/minmax.h +++ b/include/linux/minmax.h @@ -51,10 +51,10 @@ * only need to be careful to not cause warnings for * pointer use. */ -#define __signed_type_use(x,ux) (2+__is_nonneg(x,ux)) -#define __unsigned_type_use(x,ux) (1+2*(sizeof(ux)<4)) -#define __sign_use(x,ux) (is_signed_type(typeof(ux))? \ - __signed_type_use(x,ux):__unsigned_type_use(x,ux)) +#define __signed_type_use(x, ux) (2 + __is_nonneg(x, ux)) +#define __unsigned_type_use(x, ux) (1 + 2 * (sizeof(ux) < 4)) +#define __sign_use(x, ux) (is_signed_type(typeof(ux)) ? \ + __signed_type_use(x, ux) : __unsigned_type_use(x, ux)) =20 /* * To avoid warnings about casting pointers to integers @@ -74,15 +74,15 @@ #ifdef CONFIG_64BIT #define __signed_type(ux) long #else - #define __signed_type(ux) typeof(__builtin_choose_expr(sizeof(ux)>4,1LL,= 1L)) + #define __signed_type(ux) typeof(__builtin_choose_expr(sizeof(ux) > 4, 1= LL, 1L)) #endif -#define __is_nonneg(x,ux) statically_true((__signed_type(ux))(x)>=3D0) +#define __is_nonneg(x, ux) statically_true((__signed_type(ux))(x) >=3D 0) =20 -#define __types_ok(x,y,ux,uy) \ - (__sign_use(x,ux) & __sign_use(y,uy)) +#define __types_ok(x, y, ux, uy) \ + (__sign_use(x, ux) & __sign_use(y, uy)) =20 -#define __types_ok3(x,y,z,ux,uy,uz) \ - (__sign_use(x,ux) & __sign_use(y,uy) & __sign_use(z,uz)) +#define __types_ok3(x, y, z, ux, uy, uz) \ + (__sign_use(x, ux) & __sign_use(y, uy) & __sign_use(z, uz)) =20 #define __cmp_op_min < #define __cmp_op_max > @@ -97,7 +97,7 @@ =20 #define __careful_cmp_once(op, x, y, ux, uy) ({ \ __auto_type ux =3D (x); __auto_type uy =3D (y); \ - BUILD_BUG_ON_MSG(!__types_ok(x,y,ux,uy), \ + BUILD_BUG_ON_MSG(!__types_ok(x, y, ux, uy), \ #op"("#x", "#y") signedness error"); \ __cmp(op, ux, uy); }) =20 @@ -114,7 +114,7 @@ static_assert(__builtin_choose_expr(__is_constexpr((lo) > (hi)), \ (lo) <=3D (hi), true), \ "clamp() low limit " #lo " greater than high limit " #hi); \ - BUILD_BUG_ON_MSG(!__types_ok3(val,lo,hi,uval,ulo,uhi), \ + BUILD_BUG_ON_MSG(!__types_ok3(val, lo, hi, uval, ulo, uhi), \ "clamp("#val", "#lo", "#hi") signedness error"); \ __clamp(uval, ulo, uhi); }) =20 @@ -154,7 +154,7 @@ =20 #define __careful_op3(op, x, y, z, ux, uy, uz) ({ \ __auto_type ux =3D (x); __auto_type uy =3D (y);__auto_type uz =3D (z);\ - BUILD_BUG_ON_MSG(!__types_ok3(x,y,z,ux,uy,uz), \ + BUILD_BUG_ON_MSG(!__types_ok3(x, y, z, ux, uy, uz), \ #op"3("#x", "#y", "#z") signedness error"); \ __cmp(op, ux, __cmp(op, uy, uz)); }) =20 @@ -326,9 +326,9 @@ static inline bool in_range32(u32 val, u32 start, u32 l= en) * Use these carefully: no type checking, and uses the arguments * multiple times. Use for obvious constants only. */ -#define MIN(a,b) __cmp(min,a,b) -#define MAX(a,b) __cmp(max,a,b) -#define MIN_T(type,a,b) __cmp(min,(type)(a),(type)(b)) -#define MAX_T(type,a,b) __cmp(max,(type)(a),(type)(b)) +#define MIN(a, b) __cmp(min, a, b) +#define MAX(a, b) __cmp(max, a, b) +#define MIN_T(type, a, b) __cmp(min, (type)(a), (type)(b)) +#define MAX_T(type, a, b) __cmp(max, (type)(a), (type)(b)) =20 #endif /* _LINUX_MINMAX_H */ --=20 2.47.3