From nobody Thu Oct 2 02:15:06 2025 Received: from fra-out-010.esa.eu-central-1.outbound.mail-perimeter.amazon.com (fra-out-010.esa.eu-central-1.outbound.mail-perimeter.amazon.com [63.178.143.178]) (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 6C87230DEB1; Mon, 29 Sep 2025 17:18:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=63.178.143.178 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759166317; cv=none; b=PG4Ybrp54CWEeqqCeA84sn+m39uiT6b42Q2Myn2w3grpRNxqJdiEKRbxMD+156Zlv9q2ShT40k+kpY97guItd+0fjpUtGuG8XB049vJ+mKJe/5/3YgO3DEHvgC9eCxXvxu1BQq3NSD3w/Sjr9GqZn3xc/p62umZVMMUY9NaC8A0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1759166317; c=relaxed/simple; bh=20xAuZOYw8I0ufWzB2Ksi4V2Oix+SUEkw1tbLPElVss=; h=From:To:CC:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=ZVW5P9voIM3wMvv8VTN31AnQeJqz2xibyRyG2i8pImDQhUPrtYwRsu7GZUTI5xNYj1dMxsqhwKwq5MxLzHotnEvvY89UXUpswTEskOoECO0Bzc05Z1DRwmRmyPNQSr3tPGG4LQds8ZS3Bk7zrSoy9Owo7tI/U0+TlPxd/a4aiNY= 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=Dr43s6V1; arc=none smtp.client-ip=63.178.143.178 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="Dr43s6V1" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazoncorp2; t=1759166315; x=1790702315; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=OdmfzjzF46YfqPKnSMGZyjhQcZN9I6u6dSg4k1vq8LU=; b=Dr43s6V1tlmdLEPDOzDLVlYU7ieMwrD8EfW5rcYoqsvKX/8Kk/K/uz7c ISQ4mVQ3TlUfpPf5HfDlEQJzerc7KKNAFILi2WbvyNfKabFam1aFAzykE yZME+8Ig44HUKYScbpZ4NA+clxUp+6xZQ8Rs7hvnIZITp2o0NX7ldeL+h /ZeARsJkb1epUDoBqhy7u/zFJSri+l3SwpuUhq2+8n4Qdc9HHZcVIzfG1 WOKxal7yIkaeHS0KdFoPpCaFjmdaIOuku/mSyWR+zT2ej46IO1i23tgwS XYyTTh0VMRWE0Ymg6WjLHfZIUnhBTyS0mKFWodKBwnetIVO00fzFSEqi2 Q==; X-CSE-ConnectionGUID: CNMIemf/Rj+KiZBzB9fIXw== X-CSE-MsgGUID: 1sP7ypjoQgC8eP9cSuPeMA== X-IronPort-AV: E=Sophos;i="6.18,302,1751241600"; d="scan'208";a="2732851" Received: from ip-10-6-11-83.eu-central-1.compute.internal (HELO smtpout.naws.eu-central-1.prod.farcaster.email.amazon.dev) ([10.6.11.83]) by internal-fra-out-010.esa.eu-central-1.outbound.mail-perimeter.amazon.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Sep 2025 17:18:25 +0000 Received: from EX19MTAEUC002.ant.amazon.com [54.240.197.228:1676] by smtpin.naws.eu-central-1.prod.farcaster.email.amazon.dev [10.0.44.161:2525] with esmtp (Farcaster) id e040ec3a-e827-43d6-ae7b-6ea88c9b67c1; Mon, 29 Sep 2025 17:18:24 +0000 (UTC) X-Farcaster-Flow-ID: e040ec3a-e827-43d6-ae7b-6ea88c9b67c1 Received: from EX19D018EUA004.ant.amazon.com (10.252.50.85) by EX19MTAEUC002.ant.amazon.com (10.252.51.245) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA) id 15.2.2562.20; Mon, 29 Sep 2025 17:18:23 +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, 29 Sep 2025 17:18:18 +0000 From: Eliav Farber To: , , , , , , , , CC: Andy Shevchenko , Christoph Hellwig , Dan Carpenter , "Jason A. Donenfeld" , Jens Axboe , Lorenzo Stoakes , Mateusz Guzik , "Matthew Wilcox" , Pedro Falcato Subject: [PATCH v2 06/12 6.6.y] minmax.h: add whitespace around operators and after commas Date: Mon, 29 Sep 2025 17:17:27 +0000 Message-ID: <20250929171733.20671-7-farbere@amazon.com> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20250929171733.20671-1-farbere@amazon.com> References: <20250929171733.20671-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: EX19D040UWA001.ant.amazon.com (10.13.139.22) 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