From nobody Sun Feb 8 07:07:54 2026 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 34A0A2D8DB9; Mon, 27 Oct 2025 18:42:20 +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=1761590540; cv=none; b=YrhcB9zURYk8WPDIoeuFeasdtS8+lFR+NW8zydxlDVUjhIeGDyjV1fB++xTKcDfXgbYiHZmsUfRSiYe2DdhKM19CY23vcdeoyiyi2gp20bTdEU1SgUaOBl47d3Lt3tGP3pv7m9nlMEQlppzc0nujsH2fD9+Z6JHOQTeenLqYhKg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761590540; c=relaxed/simple; bh=/KBW8Y28oqZl3pWzJPtKbC/ixdq4Sj+umSWS6JCYa/w=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=MsD40a5HrQXn2qE1vTSCaZAGj7r+tAqzlFamg+o57aMSWtHgjqFpYEAmBgCH9PT4pbVqMdfDxb3ORYXXXCql/7Ja3bBHnGjivlxkcmWj/uRxA8hAZePzcID+mulj8nxRHuDEkGwDq1ZMw2qpMVhvmiHmPFZuojRWb2N4xfg8Ads= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0FA6EC4CEFD; Mon, 27 Oct 2025 18:42:10 +0000 (UTC) From: Geert Uytterhoeven To: Michael Turquette , Stephen Boyd , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea , Giovanni Cabiddu , Herbert Xu , David Miller , Linus Walleij , Bartosz Golaszewski , Joel Stanley , Andrew Jeffery , Crt Mori , Jonathan Cameron , Lars-Peter Clausen , Jacky Huang , Shan-Chun Hung , Yury Norov , Rasmus Villemoes , Jaroslav Kysela , Takashi Iwai , Johannes Berg , Jakub Kicinski , Alex Elder , David Laight , Vincent Mailhol , Jason Baron , Borislav Petkov , Tony Luck , Michael Hennerich , Kim Seer Paller , David Lechner , =?UTF-8?q?Nuno=20S=C3=A1?= , Andy Shevchenko , Richard Genoud , Cosmin Tanislav , Biju Das , Jianping Shen Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-renesas-soc@vger.kernel.org, linux-crypto@vger.kernel.org, linux-edac@vger.kernel.org, qat-linux@intel.com, linux-gpio@vger.kernel.org, linux-aspeed@lists.ozlabs.org, linux-iio@vger.kernel.org, linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH v5 01/23] clk: at91: pmc: #undef field_{get,prep}() before definition Date: Mon, 27 Oct 2025 19:41:35 +0100 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: 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" Prepare for the advent of globally available common field_get() and field_prep() macros by undefining the symbols before defining local variants. This prevents redefinition warnings from the C preprocessor when introducing the common macros later. Suggested-by: Yury Norov Signed-off-by: Geert Uytterhoeven -- v5: - New. Acked-by: Alexandre Belloni --- drivers/clk/at91/pmc.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/clk/at91/pmc.h b/drivers/clk/at91/pmc.h index 5daa32c4cf2540d7..78a87d31463e98b0 100644 --- a/drivers/clk/at91/pmc.h +++ b/drivers/clk/at91/pmc.h @@ -117,7 +117,9 @@ struct at91_clk_pms { unsigned int parent; }; =20 +#undef field_get #define field_get(_mask, _reg) (((_reg) & (_mask)) >> (ffs(_mask) - 1)) +#undef field_prep #define field_prep(_mask, _val) (((_val) << (ffs(_mask) - 1)) & (_mask)) =20 #define ndck(a, s) (a[s - 1].id + 1) --=20 2.43.0 From nobody Sun Feb 8 07:07:54 2026 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 7E66831CA7F; Mon, 27 Oct 2025 18:42:29 +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=1761590549; cv=none; b=NJ5cFMYe34+yV9Rdh/Pni4KncKG8IGcakYxEl1bcLjDBPVbPOmkKvKpvSud4ILn/GrOqiMB7ttmFh1+6qE4HBECh16NA5VMZFK/hXgLsrLNULfDS6w1hWWnEHJfbjkhAf3Q1WLqW8jJioVTeWmiabJbIafSZ7pRNLLpNCqpa1qQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761590549; c=relaxed/simple; bh=LvPiIuM54cTLiEzRaIElAbMmKhMg3cEDGYkxbhGtKKU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ShtB4QnI2t/9RShb+e39DAdCG/1z8eEawBOfy/MT1o3zn0z8uHd4Cc/KQOntljg4WrL7tuIXv+Gs2r2ADkYliKv3WWKI4u6aX0RyWvw52dOv7Z9DEQCsc5LH03qTjxSDZdN6LPy8mwFmTKiH5UgkxZnQ/r+XIpPlomF+1g/DKbo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 653D4C113D0; Mon, 27 Oct 2025 18:42:20 +0000 (UTC) From: Geert Uytterhoeven To: Michael Turquette , Stephen Boyd , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea , Giovanni Cabiddu , Herbert Xu , David Miller , Linus Walleij , Bartosz Golaszewski , Joel Stanley , Andrew Jeffery , Crt Mori , Jonathan Cameron , Lars-Peter Clausen , Jacky Huang , Shan-Chun Hung , Yury Norov , Rasmus Villemoes , Jaroslav Kysela , Takashi Iwai , Johannes Berg , Jakub Kicinski , Alex Elder , David Laight , Vincent Mailhol , Jason Baron , Borislav Petkov , Tony Luck , Michael Hennerich , Kim Seer Paller , David Lechner , =?UTF-8?q?Nuno=20S=C3=A1?= , Andy Shevchenko , Richard Genoud , Cosmin Tanislav , Biju Das , Jianping Shen Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-renesas-soc@vger.kernel.org, linux-crypto@vger.kernel.org, linux-edac@vger.kernel.org, qat-linux@intel.com, linux-gpio@vger.kernel.org, linux-aspeed@lists.ozlabs.org, linux-iio@vger.kernel.org, linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH v5 02/23] crypto: qat - #undef field_get() before local definition Date: Mon, 27 Oct 2025 19:41:36 +0100 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: 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" Prepare for the advent of a globally available common field_get() macro by undefining the symbol before defining a local variant. This prevents redefinition warnings from the C preprocessor when introducing the common macro later. Suggested-by: Yury Norov Signed-off-by: Geert Uytterhoeven -- v5: - New. Acked-by: Giovanni Cabiddu --- drivers/crypto/intel/qat/qat_common/adf_pm_dbgfs_utils.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/crypto/intel/qat/qat_common/adf_pm_dbgfs_utils.c b/dri= vers/crypto/intel/qat/qat_common/adf_pm_dbgfs_utils.c index 69295a9ddf0ac92f..6186fafb4a7b0dab 100644 --- a/drivers/crypto/intel/qat/qat_common/adf_pm_dbgfs_utils.c +++ b/drivers/crypto/intel/qat/qat_common/adf_pm_dbgfs_utils.c @@ -11,6 +11,7 @@ * pm_scnprint_table(), making it not compile time constant, so the compile * asserts from FIELD_GET() or u32_get_bits() won't be fulfilled. */ +#undef field_get #define field_get(_mask, _reg) (((_reg) & (_mask)) >> (ffs(_mask) - 1)) =20 #define PM_INFO_MAX_KEY_LEN 21 --=20 2.43.0 From nobody Sun Feb 8 07:07:54 2026 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 D06F731BC85; Mon, 27 Oct 2025 18:42:38 +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=1761590558; cv=none; b=c0+7PS8WEcZtv6KbkYBV/pwp7oXSrz3Uvi6ceWHjBHRPo0ZaUWCuTQ1v/h+c2ilWNtnIv8pE+gds20bbZ+DnFszUlnYW+Zt1oApyulc+T1PY7clwlnHrHaxV+/Nmw1+ky3nV65/IqIBQx34rBBNedtCVpUypBXdghNLZ3U1qMBU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761590558; c=relaxed/simple; bh=W1TD3G04e/xm9feBmVZUQaP2FuzDU/2hAbOrwHAIowg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=EQ0Y6sMcuVWWb+ErWtg05Fd3KY4aBz2JCK9NsgzptsV9CnMLlZpifqBGKyDDEbjRmRJoHlOfSaQxAckT5vbaxX2S5pjVftRPRAHXZCInr1q5P4sZk0lmejK/ic5EWdh/7K/eZYi3n2dA1CUHlbFtCBpPMJVGHPQIOIJDTbzVvF0= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id B6CB5C4CEF1; Mon, 27 Oct 2025 18:42:29 +0000 (UTC) From: Geert Uytterhoeven To: Michael Turquette , Stephen Boyd , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea , Giovanni Cabiddu , Herbert Xu , David Miller , Linus Walleij , Bartosz Golaszewski , Joel Stanley , Andrew Jeffery , Crt Mori , Jonathan Cameron , Lars-Peter Clausen , Jacky Huang , Shan-Chun Hung , Yury Norov , Rasmus Villemoes , Jaroslav Kysela , Takashi Iwai , Johannes Berg , Jakub Kicinski , Alex Elder , David Laight , Vincent Mailhol , Jason Baron , Borislav Petkov , Tony Luck , Michael Hennerich , Kim Seer Paller , David Lechner , =?UTF-8?q?Nuno=20S=C3=A1?= , Andy Shevchenko , Richard Genoud , Cosmin Tanislav , Biju Das , Jianping Shen Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-renesas-soc@vger.kernel.org, linux-crypto@vger.kernel.org, linux-edac@vger.kernel.org, qat-linux@intel.com, linux-gpio@vger.kernel.org, linux-aspeed@lists.ozlabs.org, linux-iio@vger.kernel.org, linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH v5 03/23] EDAC/ie31200: #undef field_get() before local definition Date: Mon, 27 Oct 2025 19:41:37 +0100 Message-ID: <8b53fc6b3e290c1d33cbcb9eff09bb23305814da.1761588465.git.geert+renesas@glider.be> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: 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" Prepare for the advent of a globally available common field_get() macro by undefining the symbol before defining a local variant. This prevents redefinition warnings from the C preprocessor when introducing the common macro later. Suggested-by: Yury Norov Signed-off-by: Geert Uytterhoeven -- v5: - New. --- drivers/edac/ie31200_edac.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/edac/ie31200_edac.c b/drivers/edac/ie31200_edac.c index 5a080ab65476dacf..72290f430126c631 100644 --- a/drivers/edac/ie31200_edac.c +++ b/drivers/edac/ie31200_edac.c @@ -140,6 +140,7 @@ #define IE31200_CAPID0_ECC BIT(1) =20 /* Non-constant mask variant of FIELD_GET() */ +#undef field_get #define field_get(_mask, _reg) (((_reg) & (_mask)) >> (ffs(_mask) - 1)) =20 static int nr_channels; --=20 2.43.0 From nobody Sun Feb 8 07:07:54 2026 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 0ACAF2D8DB9; Mon, 27 Oct 2025 18:42:47 +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=1761590568; cv=none; b=GMvhW4MsjQUW8pKgY3Szi1yIa0GiYPJSIOAHt2yGMqHDy9Fe7SJUphNGo62RSmgiDrbmo32snwoxo2rO2gjXTODy3SDQYkpQ4OfrEtQy/n465NgZ5yMY+gIQ3CRtL3i6jb5OeFUlFfuHIePmg+pjwjBfH3ilg8dBQojmQgiBkDw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761590568; c=relaxed/simple; bh=9sUvldl4I9GDGj87e8lAon13wL0E0Ti3wDhr+GkMhI4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=u3Lq8RSM3ZlSe1FzjrXtLQgaAbRg2boc2bkvyKHSfKzo44CPHw+El7+WG0DkSojitg3aUAeOah0HYivtK/2fm3Z5U4LYHOqYD7xs9ojV4dGx+39A/nbkFRNAhl9f+GrpkvOjPntE/2VMuegrle1SUInmsDB8alwSRzdF+LuUVIo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 08CAEC113D0; Mon, 27 Oct 2025 18:42:38 +0000 (UTC) From: Geert Uytterhoeven To: Michael Turquette , Stephen Boyd , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea , Giovanni Cabiddu , Herbert Xu , David Miller , Linus Walleij , Bartosz Golaszewski , Joel Stanley , Andrew Jeffery , Crt Mori , Jonathan Cameron , Lars-Peter Clausen , Jacky Huang , Shan-Chun Hung , Yury Norov , Rasmus Villemoes , Jaroslav Kysela , Takashi Iwai , Johannes Berg , Jakub Kicinski , Alex Elder , David Laight , Vincent Mailhol , Jason Baron , Borislav Petkov , Tony Luck , Michael Hennerich , Kim Seer Paller , David Lechner , =?UTF-8?q?Nuno=20S=C3=A1?= , Andy Shevchenko , Richard Genoud , Cosmin Tanislav , Biju Das , Jianping Shen Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-renesas-soc@vger.kernel.org, linux-crypto@vger.kernel.org, linux-edac@vger.kernel.org, qat-linux@intel.com, linux-gpio@vger.kernel.org, linux-aspeed@lists.ozlabs.org, linux-iio@vger.kernel.org, linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH v5 04/23] gpio: aspeed: #undef field_{get,prep}() before local definition Date: Mon, 27 Oct 2025 19:41:38 +0100 Message-ID: <76ac5587c5ff3aae3c23f7b41e2f3eacb32ebd21.1761588465.git.geert+renesas@glider.be> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: 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" Prepare for the advent of globally available common field_get() and field_prep() macros by undefining the symbols before defining local variants. This prevents redefinition warnings from the C preprocessor when introducing the common macros later. Suggested-by: Yury Norov Signed-off-by: Geert Uytterhoeven -- v5: - New. Acked-by: Bartosz Golaszewski --- drivers/gpio/gpio-aspeed.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpio/gpio-aspeed.c b/drivers/gpio/gpio-aspeed.c index 7953a9c4e36d7550..ef4ccaf74a5b379e 100644 --- a/drivers/gpio/gpio-aspeed.c +++ b/drivers/gpio/gpio-aspeed.c @@ -32,7 +32,9 @@ #include "gpiolib.h" =20 /* Non-constant mask variant of FIELD_GET() and FIELD_PREP() */ +#undef field_get #define field_get(_mask, _reg) (((_reg) & (_mask)) >> (ffs(_mask) - 1)) +#undef field_prep #define field_prep(_mask, _val) (((_val) << (ffs(_mask) - 1)) & (_mask)) =20 #define GPIO_G7_IRQ_STS_BASE 0x100 --=20 2.43.0 From nobody Sun Feb 8 07:07:54 2026 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 5B22231D377; Mon, 27 Oct 2025 18:42:57 +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=1761590577; cv=none; b=qi7qMrUXszmBncAjo5yDeoitXaGBTW0Qj08sLM7u+FrJjvo30cXi3zp3MzNfjijQCYGJEwJu144Z55ED9vjUxnQNldEcH0E6Pf/p3D4CzOVwwPu6Vm39HbGMgcQMhL3o9oHtxhX9dy6HQT9dOx3GZt3d5S8ZqPZyATk46ucf/Nk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761590577; c=relaxed/simple; bh=OiPw6OwxTW6/kP765ObyavE5QOlo+ZlK7oE3bZfimrA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=iFP0Lm6SUD18Hn7Q0LKnvbkN9oP2/+waEItsz/JPHwvj19rvdHA6Zlz2h7z9mfR/ulRrAB73MFGNNd8ocTN4TF2ZPnWcV8JG/ixxW72+rx4ODFoptPrB+ZwKtemvyy/8WeMylpcJF+zREc4W4UhzDLo8zXouiwv6sLTpiClMTF4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 41A54C4CEFD; Mon, 27 Oct 2025 18:42:48 +0000 (UTC) From: Geert Uytterhoeven To: Michael Turquette , Stephen Boyd , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea , Giovanni Cabiddu , Herbert Xu , David Miller , Linus Walleij , Bartosz Golaszewski , Joel Stanley , Andrew Jeffery , Crt Mori , Jonathan Cameron , Lars-Peter Clausen , Jacky Huang , Shan-Chun Hung , Yury Norov , Rasmus Villemoes , Jaroslav Kysela , Takashi Iwai , Johannes Berg , Jakub Kicinski , Alex Elder , David Laight , Vincent Mailhol , Jason Baron , Borislav Petkov , Tony Luck , Michael Hennerich , Kim Seer Paller , David Lechner , =?UTF-8?q?Nuno=20S=C3=A1?= , Andy Shevchenko , Richard Genoud , Cosmin Tanislav , Biju Das , Jianping Shen Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-renesas-soc@vger.kernel.org, linux-crypto@vger.kernel.org, linux-edac@vger.kernel.org, qat-linux@intel.com, linux-gpio@vger.kernel.org, linux-aspeed@lists.ozlabs.org, linux-iio@vger.kernel.org, linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH v5 05/23] iio: dac: ad3530r: #undef field_prep() before local definition Date: Mon, 27 Oct 2025 19:41:39 +0100 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: 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" Prepare for the advent of a globally available common field_prep() macro by undefining the symbol before defining a local variant. This prevents redefinition warnings from the C preprocessor when introducing the common macro later. Suggested-by: Yury Norov Signed-off-by: Geert Uytterhoeven -- v5: - New. --- drivers/iio/dac/ad3530r.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/iio/dac/ad3530r.c b/drivers/iio/dac/ad3530r.c index 6134613777b8e1d4..5684d11137f29948 100644 --- a/drivers/iio/dac/ad3530r.c +++ b/drivers/iio/dac/ad3530r.c @@ -54,6 +54,7 @@ #define AD3531R_MAX_CHANNELS 4 =20 /* Non-constant mask variant of FIELD_PREP() */ +#undef field_prep #define field_prep(_mask, _val) (((_val) << (ffs(_mask) - 1)) & (_mask)) =20 enum ad3530r_mode { --=20 2.43.0 From nobody Sun Feb 8 07:07:54 2026 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 9BC9931D72A; Mon, 27 Oct 2025 18:43:06 +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=1761590587; cv=none; b=jLRF4+c0EKjnqwEXQXjQstOa/zKZQHqyEL95lfdl2c6dAISFTDC2HNHVWHWL9/GZY9v5ess2PUyRuLcyfbor+Ryx76E7GXt6VkTAKrYOQRbYMuZ2uweDLySzXqPCEkIRfF1qqeUL1OQCeho1FNi/3Xui0SBrYimQCRm/s5ni9hs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761590587; c=relaxed/simple; bh=OEcjZyeNzLajp8FfJqjN9/trUR9Pyk9ncfoMAVIuIvA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=XTISBmyc/AePQYonfwLmo98wuv+Q+cIttVSFCsEe4IpN8jsU/ltgdAN6AO9Mio16t397A/OYLHyAg3otVOnfLoy68S1im83uhOZAv85mKMy9wTD4sODlGkgozTBVNPT4Y+t1M3N98uCbeKYNdZm6C+a2CpjUCV49RP0x3o4/VSg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 86FBDC116D0; Mon, 27 Oct 2025 18:42:57 +0000 (UTC) From: Geert Uytterhoeven To: Michael Turquette , Stephen Boyd , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea , Giovanni Cabiddu , Herbert Xu , David Miller , Linus Walleij , Bartosz Golaszewski , Joel Stanley , Andrew Jeffery , Crt Mori , Jonathan Cameron , Lars-Peter Clausen , Jacky Huang , Shan-Chun Hung , Yury Norov , Rasmus Villemoes , Jaroslav Kysela , Takashi Iwai , Johannes Berg , Jakub Kicinski , Alex Elder , David Laight , Vincent Mailhol , Jason Baron , Borislav Petkov , Tony Luck , Michael Hennerich , Kim Seer Paller , David Lechner , =?UTF-8?q?Nuno=20S=C3=A1?= , Andy Shevchenko , Richard Genoud , Cosmin Tanislav , Biju Das , Jianping Shen Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-renesas-soc@vger.kernel.org, linux-crypto@vger.kernel.org, linux-edac@vger.kernel.org, qat-linux@intel.com, linux-gpio@vger.kernel.org, linux-aspeed@lists.ozlabs.org, linux-iio@vger.kernel.org, linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH v5 06/23] iio: mlx90614: #undef field_{get,prep}() before local definition Date: Mon, 27 Oct 2025 19:41:40 +0100 Message-ID: <6e8068f7c5cb2ca349264c2befc70b1b62f9b85d.1761588465.git.geert+renesas@glider.be> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: 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" Prepare for the advent of globally available common field_get() and field_prep() macros by undefining the symbols before defining local variants. This prevents redefinition warnings from the C preprocessor when introducing the common macros later. Suggested-by: Yury Norov Signed-off-by: Geert Uytterhoeven -- v5: - New. --- drivers/iio/temperature/mlx90614.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/iio/temperature/mlx90614.c b/drivers/iio/temperature/m= lx90614.c index 8a44a00bfd5ece38..de5615fdb396aa3c 100644 --- a/drivers/iio/temperature/mlx90614.c +++ b/drivers/iio/temperature/mlx90614.c @@ -69,7 +69,9 @@ #define MLX90614_CONST_FIR 0x7 /* Fixed value for FIR part of low pass fil= ter */ =20 /* Non-constant mask variant of FIELD_GET() and FIELD_PREP() */ +#undef field_get #define field_get(_mask, _reg) (((_reg) & (_mask)) >> (ffs(_mask) - 1)) +#undef field_prep #define field_prep(_mask, _val) (((_val) << (ffs(_mask) - 1)) & (_mask)) =20 struct mlx_chip_info { --=20 2.43.0 From nobody Sun Feb 8 07:07:54 2026 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 2B7CF317711; Mon, 27 Oct 2025 18:43:15 +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=1761590597; cv=none; b=S0d+BH+eRCJCfDJnVlxspVQXAd1JoBGW+ERmDYFmbw1tnO9ivYfds0qdmdeVbGR5uxcaNcGqhxaoRzKPoxlcmhusNhN5S8mri6trBXct6RZ/1tk7GqZGa621PMHVqVAv64282i1KU9pOmX3wlXu3za7y9zGrdHiZstAqfpaBoaY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761590597; c=relaxed/simple; bh=YxrLr8ynqDegUA8ULydlWJ04Wk6I4oRUFrBwiMNXFRM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=EY7KIWzTNDYH8npjqXLSLqj6FiHqki0/lpJaoulctNEfD0sPqc9+nR09kSXmz8ivUDHPdWFiAGcoQCCM7j6eTNs3pbH+fhcSu1JUBpvlTu8/ZFY3+YttAz9yzLJn711dx+s36T24HUP8VpOBcuULPxA1l9Wm/j4gRh78z3kOZns= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id D1EA8C116C6; Mon, 27 Oct 2025 18:43:06 +0000 (UTC) From: Geert Uytterhoeven To: Michael Turquette , Stephen Boyd , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea , Giovanni Cabiddu , Herbert Xu , David Miller , Linus Walleij , Bartosz Golaszewski , Joel Stanley , Andrew Jeffery , Crt Mori , Jonathan Cameron , Lars-Peter Clausen , Jacky Huang , Shan-Chun Hung , Yury Norov , Rasmus Villemoes , Jaroslav Kysela , Takashi Iwai , Johannes Berg , Jakub Kicinski , Alex Elder , David Laight , Vincent Mailhol , Jason Baron , Borislav Petkov , Tony Luck , Michael Hennerich , Kim Seer Paller , David Lechner , =?UTF-8?q?Nuno=20S=C3=A1?= , Andy Shevchenko , Richard Genoud , Cosmin Tanislav , Biju Das , Jianping Shen Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-renesas-soc@vger.kernel.org, linux-crypto@vger.kernel.org, linux-edac@vger.kernel.org, qat-linux@intel.com, linux-gpio@vger.kernel.org, linux-aspeed@lists.ozlabs.org, linux-iio@vger.kernel.org, linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH v5 07/23] pinctrl: ma35: #undef field_{get,prep}() before local definition Date: Mon, 27 Oct 2025 19:41:41 +0100 Message-ID: <03a492c8af84a41e47b33c9a974559805d070d8d.1761588465.git.geert+renesas@glider.be> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: 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" Prepare for the advent of globally available common field_get() and field_prep() macros by undefining the symbols before defining local variants. This prevents redefinition warnings from the C preprocessor when introducing the common macros later. Suggested-by: Yury Norov Signed-off-by: Geert Uytterhoeven -- v5: - New. Acked-by: Linus Walleij --- drivers/pinctrl/nuvoton/pinctrl-ma35.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/pinctrl/nuvoton/pinctrl-ma35.c b/drivers/pinctrl/nuvot= on/pinctrl-ma35.c index cdad01d68a37e365..925dd717c9deead5 100644 --- a/drivers/pinctrl/nuvoton/pinctrl-ma35.c +++ b/drivers/pinctrl/nuvoton/pinctrl-ma35.c @@ -82,7 +82,9 @@ #define MVOLT_3300 1 =20 /* Non-constant mask variant of FIELD_GET() and FIELD_PREP() */ +#undef field_get #define field_get(_mask, _reg) (((_reg) & (_mask)) >> (ffs(_mask) - 1)) +#undef field_prep #define field_prep(_mask, _val) (((_val) << (ffs(_mask) - 1)) & (_mask)) =20 static const char * const gpio_group_name[] =3D { --=20 2.43.0 From nobody Sun Feb 8 07:07:54 2026 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 6454231DD81; Mon, 27 Oct 2025 18:43:25 +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=1761590605; cv=none; b=hXsYOyvR//SLz26kzhjt3o//ju/ILJvokHOW5f1jmIUe91Bw4tRcNaYSXwPSt+DaasZcgfvxMPDJGC+zns3Dltj1+4ixDcMiZkyTUas2eZg9P2qLwUXjkUdhAKZWJRtYW+Z3+/0bF49UrdBKYhDXqIEJRteSlCWeI9pzmliRfoQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761590605; c=relaxed/simple; bh=k5Cetgp9FkfC6CLT7mVdI9b4Oryz9B0EZ2SI0HjaTvE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hjmfJ2wBMeu4BIWx/dJoWazvcGGdbkSgnc6Sl5G6cqxhKh4vuJgYgB6IfXduLdDkJjOjPyNCwq0oBPwSBl63G4uDcR+VD11BTAPz/qQ8NATcAnm7s8dMmiX5IfeZDOy5iW3cRwyFqnnLLaHjuwwSZMFUfRmqXDeybmPn+dXSM44= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 235CEC4CEFD; Mon, 27 Oct 2025 18:43:15 +0000 (UTC) From: Geert Uytterhoeven To: Michael Turquette , Stephen Boyd , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea , Giovanni Cabiddu , Herbert Xu , David Miller , Linus Walleij , Bartosz Golaszewski , Joel Stanley , Andrew Jeffery , Crt Mori , Jonathan Cameron , Lars-Peter Clausen , Jacky Huang , Shan-Chun Hung , Yury Norov , Rasmus Villemoes , Jaroslav Kysela , Takashi Iwai , Johannes Berg , Jakub Kicinski , Alex Elder , David Laight , Vincent Mailhol , Jason Baron , Borislav Petkov , Tony Luck , Michael Hennerich , Kim Seer Paller , David Lechner , =?UTF-8?q?Nuno=20S=C3=A1?= , Andy Shevchenko , Richard Genoud , Cosmin Tanislav , Biju Das , Jianping Shen Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-renesas-soc@vger.kernel.org, linux-crypto@vger.kernel.org, linux-edac@vger.kernel.org, qat-linux@intel.com, linux-gpio@vger.kernel.org, linux-aspeed@lists.ozlabs.org, linux-iio@vger.kernel.org, linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH v5 08/23] soc: renesas: rz-sysc: #undef field_get() before local definition Date: Mon, 27 Oct 2025 19:41:42 +0100 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: 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" Prepare for the advent of a globally available common field_get() macro by undefining the symbol before defining a local variant. This prevents redefinition warnings from the C preprocessor when introducing the common macro later. Suggested-by: Yury Norov Signed-off-by: Geert Uytterhoeven -- v5: - New. --- drivers/soc/renesas/rz-sysc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/soc/renesas/rz-sysc.c b/drivers/soc/renesas/rz-sysc.c index 9f79e299e6f41641..b9880085d3634065 100644 --- a/drivers/soc/renesas/rz-sysc.c +++ b/drivers/soc/renesas/rz-sysc.c @@ -16,6 +16,7 @@ =20 #include "rz-sysc.h" =20 +#undef field_get #define field_get(_mask, _reg) (((_reg) & (_mask)) >> (ffs(_mask) - 1)) =20 /** --=20 2.43.0 From nobody Sun Feb 8 07:07:54 2026 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 0A05F31C584; Mon, 27 Oct 2025 18:43:35 +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=1761590615; cv=none; b=ao+T1T/ktz4aX3qbKelOqlYvBkd5A4vzOlyH+AjlaF1VLQz293yh4RRk3JVENP/vX2lk1eY/ytK/6Pprr38COc2cLvSa9gO3Kr9sl03PnzEVG2n843lW5PF0aB7OSeOetckizKlO3Bdpk3FrmeK39/LFkftfi+YcbhpNkm2MKSQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761590615; c=relaxed/simple; bh=9AtmaxAE5P6FLHZHWPVLhE0KnmeKCJv4vA8112RwR48=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=PRgu/j63BFCi7/A+Y/3toIXOA90BjGgC6e1DSbf7W8AecNkUsAwuuY7Hfq84O8D59m8ErpzFqDP+zM/NoVsUfBMjLx/IgaSge8Tkj+U4HG+4LsJgbJCErQrWJSHy3IdYHvjdsBeejmE0Tjt79L8J5q/0NIwHFa3A44n3SrQ+rCo= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id B2490C113D0; Mon, 27 Oct 2025 18:43:25 +0000 (UTC) From: Geert Uytterhoeven To: Michael Turquette , Stephen Boyd , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea , Giovanni Cabiddu , Herbert Xu , David Miller , Linus Walleij , Bartosz Golaszewski , Joel Stanley , Andrew Jeffery , Crt Mori , Jonathan Cameron , Lars-Peter Clausen , Jacky Huang , Shan-Chun Hung , Yury Norov , Rasmus Villemoes , Jaroslav Kysela , Takashi Iwai , Johannes Berg , Jakub Kicinski , Alex Elder , David Laight , Vincent Mailhol , Jason Baron , Borislav Petkov , Tony Luck , Michael Hennerich , Kim Seer Paller , David Lechner , =?UTF-8?q?Nuno=20S=C3=A1?= , Andy Shevchenko , Richard Genoud , Cosmin Tanislav , Biju Das , Jianping Shen Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-renesas-soc@vger.kernel.org, linux-crypto@vger.kernel.org, linux-edac@vger.kernel.org, qat-linux@intel.com, linux-gpio@vger.kernel.org, linux-aspeed@lists.ozlabs.org, linux-iio@vger.kernel.org, linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH v5 09/23] ALSA: usb-audio: #undef field_{get,prep}() before local definition Date: Mon, 27 Oct 2025 19:41:43 +0100 Message-ID: <8f19d783dd783df5510408ffe9664dc6ef0d9434.1761588465.git.geert+renesas@glider.be> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: 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" Prepare for the advent of globally available common field_get() and field_prep() macros by undefining the symbols before defining local variants. This prevents redefinition warnings from the C preprocessor when introducing the common macros later. Suggested-by: Yury Norov Signed-off-by: Geert Uytterhoeven -- v5: - New. Acked-by: Takashi Iwai --- sound/usb/mixer_quirks.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sound/usb/mixer_quirks.c b/sound/usb/mixer_quirks.c index 828af3095b86ee0a..713a8498b975e1ac 100644 --- a/sound/usb/mixer_quirks.c +++ b/sound/usb/mixer_quirks.c @@ -3312,7 +3312,9 @@ static int snd_bbfpro_controls_create(struct usb_mixe= r_interface *mixer) #define RME_DIGIFACE_INVERT BIT(31) =20 /* Nonconst helpers */ +#undef field_get #define field_get(_mask, _reg) (((_reg) & (_mask)) >> (ffs(_mask) - 1)) +#undef field_prep #define field_prep(_mask, _val) (((_val) << (ffs(_mask) - 1)) & (_mask)) =20 static int snd_rme_digiface_write_reg(struct snd_kcontrol *kcontrol, int i= tem, u16 mask, u16 val) --=20 2.43.0 From nobody Sun Feb 8 07:07:54 2026 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 600AA2BD033; Mon, 27 Oct 2025 18:43:44 +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=1761590624; cv=none; b=ghvr26W05ENSfyZ/Vuj9Xq6fir54JJ2XOieblabm2p3WnnYUdMyFVwgspM2uJovLeqN3K4oXwyzoOkT2cqPBjAjemHzoS8OWNGwSC3UWOAnX16l2R67F5292+rarmUJzRKdaQCthyDT18FKbh64DDqmdc/x904IzQX9sM1v31VI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761590624; c=relaxed/simple; bh=wo/YyHUnh4dUlne/6NyxVlSHFCYUWrwUefK13E/NdZg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=KmvkkZFWvwEBxcLPjaWdw0rQtS93kkAow0PAXueHVxHoEWLwJlXHHGJ3NYTtTikztHMWHxOZ9hQzbrKibUAGK4aBx2EyF1aqXsAosaP1KSbEd1z8QIc4Hhl2iXLO2cbPbdD+y0nJ/m+2ipakZifF/3e/AYoae4rGsxUNgVcSSt4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 56D73C116C6; Mon, 27 Oct 2025 18:43:35 +0000 (UTC) From: Geert Uytterhoeven To: Michael Turquette , Stephen Boyd , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea , Giovanni Cabiddu , Herbert Xu , David Miller , Linus Walleij , Bartosz Golaszewski , Joel Stanley , Andrew Jeffery , Crt Mori , Jonathan Cameron , Lars-Peter Clausen , Jacky Huang , Shan-Chun Hung , Yury Norov , Rasmus Villemoes , Jaroslav Kysela , Takashi Iwai , Johannes Berg , Jakub Kicinski , Alex Elder , David Laight , Vincent Mailhol , Jason Baron , Borislav Petkov , Tony Luck , Michael Hennerich , Kim Seer Paller , David Lechner , =?UTF-8?q?Nuno=20S=C3=A1?= , Andy Shevchenko , Richard Genoud , Cosmin Tanislav , Biju Das , Jianping Shen Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-renesas-soc@vger.kernel.org, linux-crypto@vger.kernel.org, linux-edac@vger.kernel.org, qat-linux@intel.com, linux-gpio@vger.kernel.org, linux-aspeed@lists.ozlabs.org, linux-iio@vger.kernel.org, linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH -next v5 10/23] iio: imu: smi330: #undef field_{get,prep}() before definition Date: Mon, 27 Oct 2025 19:41:44 +0100 Message-ID: <97549838f28a1bb7861cfb42ee687f832942b13a.1761588465.git.geert+renesas@glider.be> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: 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" Prepare for the advent of globally available common field_get() and field_prep() macros by undefining the symbols before defining local variants. This prevents redefinition warnings from the C preprocessor when introducing the common macros later. Suggested-by: Yury Norov Signed-off-by: Geert Uytterhoeven -- v5: - New. --- drivers/iio/imu/smi330/smi330_core.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/iio/imu/smi330/smi330_core.c b/drivers/iio/imu/smi330/= smi330_core.c index d9178725ade3da83..a79964fe68fadf47 100644 --- a/drivers/iio/imu/smi330/smi330_core.c +++ b/drivers/iio/imu/smi330/smi330_core.c @@ -68,7 +68,9 @@ #define SMI330_SOFT_RESET_DELAY 2000 =20 /* Non-constant mask variant of FIELD_GET() and FIELD_PREP() */ +#undef field_get #define field_get(_mask, _reg) (((_reg) & (_mask)) >> (ffs(_mask) - 1)) +#undef field_prep #define field_prep(_mask, _val) (((_val) << (ffs(_mask) - 1)) & (_mask)) =20 #define SMI330_ACCEL_CHANNEL(_axis) { \ --=20 2.43.0 From nobody Sun Feb 8 07:07:54 2026 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 F25D0320A32; Mon, 27 Oct 2025 18:43:53 +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=1761590634; cv=none; b=kxf3QWRF+d1bznHw9lx2tzOjWmm737KKLXyKoWQl/48kGT0d98Fd+SK+z6IOIWIhGfvAXTVSgvwLAcCF2luDh3TQg92EBkPskFck7WpwH8K2lhxzelOj74af1vElVYyOazHemIrKnP6esAackphDQZInwvMb+Brc2+jJtMUpLX8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761590634; c=relaxed/simple; bh=6KuO5yktm/803PSE7WiPRpg+MPVlzj4p7xX7X4g7rQA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=BDGwEHfiu7dYEUTyqejVtdN4FzuKumkycrI0R6WKgGTlCjG3FirNp1lFcROHE0GZAYzmWvrQvfSXmejbCt0SPB2DuQm4Hl2cwepGO9xPj1iHsmctuzQXsvz6/yOiG2ytdS+JBVOU7VRgOqWaWIugHwwSbBC8YFiGtyohNSSGUDQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 91008C4CEFD; Mon, 27 Oct 2025 18:43:44 +0000 (UTC) From: Geert Uytterhoeven To: Michael Turquette , Stephen Boyd , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea , Giovanni Cabiddu , Herbert Xu , David Miller , Linus Walleij , Bartosz Golaszewski , Joel Stanley , Andrew Jeffery , Crt Mori , Jonathan Cameron , Lars-Peter Clausen , Jacky Huang , Shan-Chun Hung , Yury Norov , Rasmus Villemoes , Jaroslav Kysela , Takashi Iwai , Johannes Berg , Jakub Kicinski , Alex Elder , David Laight , Vincent Mailhol , Jason Baron , Borislav Petkov , Tony Luck , Michael Hennerich , Kim Seer Paller , David Lechner , =?UTF-8?q?Nuno=20S=C3=A1?= , Andy Shevchenko , Richard Genoud , Cosmin Tanislav , Biju Das , Jianping Shen Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-renesas-soc@vger.kernel.org, linux-crypto@vger.kernel.org, linux-edac@vger.kernel.org, qat-linux@intel.com, linux-gpio@vger.kernel.org, linux-aspeed@lists.ozlabs.org, linux-iio@vger.kernel.org, linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven , Jonathan Cameron Subject: [PATCH v5 11/23] bitfield: Add non-constant field_{prep,get}() helpers Date: Mon, 27 Oct 2025 19:41:45 +0100 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: 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="utf-8" Content-Transfer-Encoding: quoted-printable The existing FIELD_{GET,PREP}() macros are limited to compile-time constants. However, it is very common to prepare or extract bitfield elements where the bitfield mask is not a compile-time constant. To avoid this limitation, the AT91 clock driver and several other drivers already have their own non-const field_{prep,get}() macros. Make them available for general use by adding them to , and improve them slightly: 1. Avoid evaluating macro parameters more than once, 2. Replace "ffs() - 1" by "__ffs()", 3. Support 64-bit use on 32-bit architectures, 4. Wire field_{get,prep}() to FIELD_{GET,PREP}() when mask is actually constant. This is deliberately not merged into the existing FIELD_{GET,PREP}() macros, as people expressed the desire to keep stricter variants for increased safety, or for performance critical paths. Signed-off-by: Geert Uytterhoeven Acked-by: Alexandre Belloni Acked-by: Jonathan Cameron Acked-by: Crt Mori Acked-by: Nuno S=C3=A1 Acked-by: Richard Genoud Reviewed-by: Andy Shevchenko --- v5: - Add Acked-by, - Split off changes outside , - Document that mask must be non-zero, - Document typical usage pattern, - Recommend using FIELD_{PREP,GET}() directly to ensure compile-time constant masks, - Check BITS_PER_TYPE(mask) instead of sizeof(mask), - Wire field_{get,prep}() to FIELD_{GET,PREP}() when mask is constant, to improve type checking. v4: - Add Acked-by, - Rebase on top of commit 7c68005a46108ffa ("crypto: qat - relocate power management debugfs helper APIs") in v6.17-rc1, - Convert more recently introduced upstream copies: - drivers/edac/ie31200_edac.c - drivers/iio/dac/ad3530r.c v3: - Add Acked-by, - Drop underscores from macro parameters, - Use __auto_type where possible, - Correctly cast reg to the mask type, - Introduces __val and __reg intermediates to simplify the actual operation, - Drop unneeded parentheses, - Clarify having both FIELD_{GET,PREP}() and field_{get,prep}(), v2: - Cast val resp. reg to the mask type, - Fix 64-bit use on 32-bit architectures, - Convert new upstream users: - drivers/crypto/intel/qat/qat_common/adf_gen4_pm_debugfs.c - drivers/gpio/gpio-aspeed.c - drivers/iio/temperature/mlx90614.c - drivers/pinctrl/nuvoton/pinctrl-ma35.c - sound/usb/mixer_quirks.c - Convert new user queued in renesas-devel for v6.15: - drivers/soc/renesas/rz-sysc.c --- include/linux/bitfield.h | 54 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 54 insertions(+) diff --git a/include/linux/bitfield.h b/include/linux/bitfield.h index 5355f8f806a97974..d220790fd068305c 100644 --- a/include/linux/bitfield.h +++ b/include/linux/bitfield.h @@ -220,4 +220,58 @@ __MAKE_OP(64) #undef __MAKE_OP #undef ____MAKE_OP =20 +#define __field_prep(mask, val) \ + ({ \ + __auto_type __mask =3D (mask); \ + typeof(mask) __val =3D (val); \ + unsigned int __shift =3D BITS_PER_TYPE(mask) <=3D 32 ? \ + __ffs(__mask) : __ffs64(__mask); \ + (__val << __shift) & __mask; \ + }) + +#define __field_get(mask, reg) \ + ({ \ + __auto_type __mask =3D (mask); \ + typeof(mask) __reg =3D (reg); \ + unsigned int __shift =3D BITS_PER_TYPE(mask) <=3D 32 ? \ + __ffs(__mask) : __ffs64(__mask); \ + (__reg & __mask) >> __shift; \ + }) + +/** + * field_prep() - prepare a bitfield element + * @mask: shifted mask defining the field's length and position, must be + * non-zero + * @val: value to put in the field + * + * field_prep() masks and shifts up the value. The result should be + * combined with other fields of the bitfield using logical OR. + * Unlike FIELD_PREP(), @mask is not limited to a compile-time constant. + * Typical usage patterns are a value stored in a table, or calculated by + * shifting a constant by a variable number of bits. + * If you want to ensure that @mask is a compile-time constant, please use + * FIELD_PREP() directly instead. + */ +#define field_prep(mask, val) \ + (__builtin_constant_p(mask) ? FIELD_PREP(mask, val) \ + : __field_prep(mask, val)) + +/** + * field_get() - extract a bitfield element + * @mask: shifted mask defining the field's length and position, must be + * non-zero + * @reg: value of entire bitfield + * + * field_get() extracts the field specified by @mask from the + * bitfield passed in as @reg by masking and shifting it down. + * Unlike FIELD_GET(), @mask is not limited to a compile-time constant. + * Typical usage patterns are a value stored in a table, or calculated by + * shifting a constant by a variable number of bits. + * If you want to ensure that @mask is a compile-time constant, please use + * FIELD_GET() directly instead. + */ +#define field_get(mask, reg) \ + (__builtin_constant_p(mask) ? FIELD_GET(mask, reg) \ + : __field_get(mask, reg)) + #endif --=20 2.43.0 From nobody Sun Feb 8 07:07:54 2026 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 E716E31B82B; Mon, 27 Oct 2025 18:44:02 +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=1761590643; cv=none; b=u+ZPbb7PEVBh4OMNZrDCI48/9hXb+ctvrYclmD5NFb1bjNaKNsNaLo/3rqnH0aAhabztiXVvTx3XkORFuT5Iu+hvRqPx1L63eR/xiq2cY9vIRYMqQVcBwiPvJUjZIIr86lH5YdcJMBhKiqeaBK12JPd5WuL4R7sa1Xlgpml1cCs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761590643; c=relaxed/simple; bh=OKpMmsozqeIKresQAJh95tpDvLKC9IZhdrU7X029S/M=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=YyOGoc5Avm1mGfF80yAn7QnQsU/hGjN6HKvT62JMbDgRZHMNMVOjx6OW6ZngkQAe6UTMj/0BBOz7amvLMrL1PkSfiKYVahi6JGobmm7nouiscLbKLTPY5rynsra8sqwtcW7i0qIX4f7VpadoBIM+mr6MhT/oxb1ag/gUql9M9JA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 02AC5C116B1; Mon, 27 Oct 2025 18:43:53 +0000 (UTC) From: Geert Uytterhoeven To: Michael Turquette , Stephen Boyd , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea , Giovanni Cabiddu , Herbert Xu , David Miller , Linus Walleij , Bartosz Golaszewski , Joel Stanley , Andrew Jeffery , Crt Mori , Jonathan Cameron , Lars-Peter Clausen , Jacky Huang , Shan-Chun Hung , Yury Norov , Rasmus Villemoes , Jaroslav Kysela , Takashi Iwai , Johannes Berg , Jakub Kicinski , Alex Elder , David Laight , Vincent Mailhol , Jason Baron , Borislav Petkov , Tony Luck , Michael Hennerich , Kim Seer Paller , David Lechner , =?UTF-8?q?Nuno=20S=C3=A1?= , Andy Shevchenko , Richard Genoud , Cosmin Tanislav , Biju Das , Jianping Shen Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-renesas-soc@vger.kernel.org, linux-crypto@vger.kernel.org, linux-edac@vger.kernel.org, qat-linux@intel.com, linux-gpio@vger.kernel.org, linux-aspeed@lists.ozlabs.org, linux-iio@vger.kernel.org, linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH v5 12/23] clk: at91: Convert to common field_{get,prep}() helpers Date: Mon, 27 Oct 2025 19:41:46 +0100 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: 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" Drop the driver-specific field_get() and field_prep() macros, in favor of the globally available variants from . Signed-off-by: Geert Uytterhoeven Acked-by: Alexandre Belloni --- v5: - Extracted from "bitfield: Add non-constant field_{prep,get}() helpers". --- drivers/clk/at91/clk-peripheral.c | 1 + drivers/clk/at91/pmc.h | 5 ----- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/drivers/clk/at91/clk-peripheral.c b/drivers/clk/at91/clk-perip= heral.c index e700f40fd87f9327..e7208c47268b6397 100644 --- a/drivers/clk/at91/clk-peripheral.c +++ b/drivers/clk/at91/clk-peripheral.c @@ -3,6 +3,7 @@ * Copyright (C) 2013 Boris BREZILLON */ =20 +#include #include #include #include diff --git a/drivers/clk/at91/pmc.h b/drivers/clk/at91/pmc.h index 78a87d31463e98b0..543d7aee8d248cdb 100644 --- a/drivers/clk/at91/pmc.h +++ b/drivers/clk/at91/pmc.h @@ -117,11 +117,6 @@ struct at91_clk_pms { unsigned int parent; }; =20 -#undef field_get -#define field_get(_mask, _reg) (((_reg) & (_mask)) >> (ffs(_mask) - 1)) -#undef field_prep -#define field_prep(_mask, _val) (((_val) << (ffs(_mask) - 1)) & (_mask)) - #define ndck(a, s) (a[s - 1].id + 1) #define nck(a) (a[ARRAY_SIZE(a) - 1].id + 1) =20 --=20 2.43.0 From nobody Sun Feb 8 07:07:54 2026 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 8E98031B82B; Mon, 27 Oct 2025 18:44:12 +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=1761590652; cv=none; b=XqRPTNNSHQm8zpgGCaCqNxh3FfEMVFVN0V1ldTW9glGrlrnZNv+eMrVUyP33bI5gglkK3+wNinSsrTf/8mc8+/P54lzGQY++IfPoNljVkrZQDcRsqJzmrGNdjtdyfc1sVjO7CkfpiGLibkU7g8aBu0MScLXsUwcBNM+5/Os9Ktw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761590652; c=relaxed/simple; bh=PXVmPOn6yY5UfKE+4qxrNiI7L/NaK9gQJ/rTNzxB6Mc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=S4CqgxEeUfvOxWawi5d0bwTMRK6mkDCEEAK9s7zoADr5Ww9U8cVVNVlrsdkCWMS7QO/cHWhpCMtsZ3phymUFk79R6Mw/+iNGfD8ByMh9DwxdMTfcsib/C98nW6Je7x0keCXxwuMuxF46z7LREGb8eqM/sEZNar3fhsnRwHhWXbI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3C14BC4CEF1; Mon, 27 Oct 2025 18:44:03 +0000 (UTC) From: Geert Uytterhoeven To: Michael Turquette , Stephen Boyd , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea , Giovanni Cabiddu , Herbert Xu , David Miller , Linus Walleij , Bartosz Golaszewski , Joel Stanley , Andrew Jeffery , Crt Mori , Jonathan Cameron , Lars-Peter Clausen , Jacky Huang , Shan-Chun Hung , Yury Norov , Rasmus Villemoes , Jaroslav Kysela , Takashi Iwai , Johannes Berg , Jakub Kicinski , Alex Elder , David Laight , Vincent Mailhol , Jason Baron , Borislav Petkov , Tony Luck , Michael Hennerich , Kim Seer Paller , David Lechner , =?UTF-8?q?Nuno=20S=C3=A1?= , Andy Shevchenko , Richard Genoud , Cosmin Tanislav , Biju Das , Jianping Shen Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-renesas-soc@vger.kernel.org, linux-crypto@vger.kernel.org, linux-edac@vger.kernel.org, qat-linux@intel.com, linux-gpio@vger.kernel.org, linux-aspeed@lists.ozlabs.org, linux-iio@vger.kernel.org, linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH v5 13/23] crypto: qat - convert to common field_get() helper Date: Mon, 27 Oct 2025 19:41:47 +0100 Message-ID: <2556adf9d1dca0077d03785bef1f7592936c16c8.1761588465.git.geert+renesas@glider.be> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: 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" Drop the driver-specific field_get() macro, in favor of the globally available variant from . Signed-off-by: Geert Uytterhoeven Acked-by: Giovanni Cabiddu --- v5: - Extracted from "bitfield: Add non-constant field_{prep,get}() helpers". --- drivers/crypto/intel/qat/qat_common/adf_pm_dbgfs_utils.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/crypto/intel/qat/qat_common/adf_pm_dbgfs_utils.c b/dri= vers/crypto/intel/qat/qat_common/adf_pm_dbgfs_utils.c index 6186fafb4a7b0dab..4ccc94ed9493a64c 100644 --- a/drivers/crypto/intel/qat/qat_common/adf_pm_dbgfs_utils.c +++ b/drivers/crypto/intel/qat/qat_common/adf_pm_dbgfs_utils.c @@ -1,19 +1,12 @@ // SPDX-License-Identifier: GPL-2.0-only /* Copyright(c) 2025 Intel Corporation */ +#include #include #include #include =20 #include "adf_pm_dbgfs_utils.h" =20 -/* - * This is needed because a variable is used to index the mask at - * pm_scnprint_table(), making it not compile time constant, so the compile - * asserts from FIELD_GET() or u32_get_bits() won't be fulfilled. - */ -#undef field_get -#define field_get(_mask, _reg) (((_reg) & (_mask)) >> (ffs(_mask) - 1)) - #define PM_INFO_MAX_KEY_LEN 21 =20 static int pm_scnprint_table(char *buff, const struct pm_status_row *table, --=20 2.43.0 From nobody Sun Feb 8 07:07:54 2026 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 3A279322547; Mon, 27 Oct 2025 18:44:21 +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=1761590662; cv=none; b=o5RYZvWBbF/v6NaayaEdiIMHiYgvZ7yC2TRPBjC4qY0dHZAI/6jXGxOBlMCc1GxGiDyDWML7+yj7dHQArL9XWWqlTzLVT7CQWx+ndQrn3MCHn/bGVmwkL04jc2RcgE1gFzvjYgU4Qx+kdpWRDCRriIIfwXPnx+y8lD5EmmUWPuo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761590662; c=relaxed/simple; bh=djsl8gZFK6qpER1LSMni2llD9PGhKs8OQ6YHDRA4Uio=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=og8ku/OeOxS+Rn7Zb17TAj1CiRcttLvqiIpbyB0AD2jF8hNSJxowNkvFOeES+J4diNCgAcuy+AgIaym6Bv6Rb+4fwTCr3cD06rICRaqvIgsTcL7wT1FIKiTPDGC/PhpOXwSOQ4xUiZ9majA4f6I18IpcwmgtMROL5tOSm7nS/E8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 88213C4CEFD; Mon, 27 Oct 2025 18:44:12 +0000 (UTC) From: Geert Uytterhoeven To: Michael Turquette , Stephen Boyd , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea , Giovanni Cabiddu , Herbert Xu , David Miller , Linus Walleij , Bartosz Golaszewski , Joel Stanley , Andrew Jeffery , Crt Mori , Jonathan Cameron , Lars-Peter Clausen , Jacky Huang , Shan-Chun Hung , Yury Norov , Rasmus Villemoes , Jaroslav Kysela , Takashi Iwai , Johannes Berg , Jakub Kicinski , Alex Elder , David Laight , Vincent Mailhol , Jason Baron , Borislav Petkov , Tony Luck , Michael Hennerich , Kim Seer Paller , David Lechner , =?UTF-8?q?Nuno=20S=C3=A1?= , Andy Shevchenko , Richard Genoud , Cosmin Tanislav , Biju Das , Jianping Shen Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-renesas-soc@vger.kernel.org, linux-crypto@vger.kernel.org, linux-edac@vger.kernel.org, qat-linux@intel.com, linux-gpio@vger.kernel.org, linux-aspeed@lists.ozlabs.org, linux-iio@vger.kernel.org, linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH v5 14/23] EDAC/ie31200: Convert to common field_get() helper Date: Mon, 27 Oct 2025 19:41:48 +0100 Message-ID: <73dc9c3cd24bc368eaa42a045e8b4a2c37d661eb.1761588465.git.geert+renesas@glider.be> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: 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" Drop the driver-specific field_get() macro, in favor of the globally available variant from . Signed-off-by: Geert Uytterhoeven --- v5: - Extracted from "bitfield: Add non-constant field_{prep,get}() helpers". --- drivers/edac/ie31200_edac.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/edac/ie31200_edac.c b/drivers/edac/ie31200_edac.c index 72290f430126c631..dfc9a9cecd74207d 100644 --- a/drivers/edac/ie31200_edac.c +++ b/drivers/edac/ie31200_edac.c @@ -44,6 +44,7 @@ * but lo_hi_readq() ensures that we are safe across all e3-1200 processor= s. */ =20 +#include #include #include #include @@ -139,10 +140,6 @@ #define IE31200_CAPID0_DDPCD BIT(6) #define IE31200_CAPID0_ECC BIT(1) =20 -/* Non-constant mask variant of FIELD_GET() */ -#undef field_get -#define field_get(_mask, _reg) (((_reg) & (_mask)) >> (ffs(_mask) - 1)) - static int nr_channels; static struct pci_dev *mci_pdev; static int ie31200_registered =3D 1; --=20 2.43.0 From nobody Sun Feb 8 07:07:54 2026 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 1963631D38B; Mon, 27 Oct 2025 18:44:31 +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=1761590671; cv=none; b=pndbuNc53Kk9BsmQfBafv4cjcj7TKZpvuqqfp8iYnl+yYjxNfAwWOBV4NEFNZi2ur1crm47dUuXyVgEMZyhLJJNP6QrcQzHKn3g8MQeR2wNwDmi8aRwdxnQ6dWiDsN5ss8UX/VevE7KyHEb/8XfiajbK2VyycXAnhAoFO4CEhzs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761590671; c=relaxed/simple; bh=umv/qhdrDzWIvCo6MFMcY2LgT2iryrN6deUWKd28zDI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DsR0ATMzefU8p2rwfw22Fys5SdbwGfwOOQ1H5ppxyISajNkuIx/hpfuR/RR1RlhW8GefbHhB6WI1RU9P0wfmjxJ/A2+WYCAMDo2erZVRv/hnG61hQhO4XCfiYKLshWmFOlG7py36MMNB4Hdaxx67mWAQY/nHjTuqWTWzw/aN9YU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2B709C113D0; Mon, 27 Oct 2025 18:44:22 +0000 (UTC) From: Geert Uytterhoeven To: Michael Turquette , Stephen Boyd , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea , Giovanni Cabiddu , Herbert Xu , David Miller , Linus Walleij , Bartosz Golaszewski , Joel Stanley , Andrew Jeffery , Crt Mori , Jonathan Cameron , Lars-Peter Clausen , Jacky Huang , Shan-Chun Hung , Yury Norov , Rasmus Villemoes , Jaroslav Kysela , Takashi Iwai , Johannes Berg , Jakub Kicinski , Alex Elder , David Laight , Vincent Mailhol , Jason Baron , Borislav Petkov , Tony Luck , Michael Hennerich , Kim Seer Paller , David Lechner , =?UTF-8?q?Nuno=20S=C3=A1?= , Andy Shevchenko , Richard Genoud , Cosmin Tanislav , Biju Das , Jianping Shen Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-renesas-soc@vger.kernel.org, linux-crypto@vger.kernel.org, linux-edac@vger.kernel.org, qat-linux@intel.com, linux-gpio@vger.kernel.org, linux-aspeed@lists.ozlabs.org, linux-iio@vger.kernel.org, linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH v5 15/23] gpio: aspeed: Convert to common field_{get,prep}() helpers Date: Mon, 27 Oct 2025 19:41:49 +0100 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: 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" Drop the driver-specific field_get() and field_prep() macros, in favor of the globally available variants from . Signed-off-by: Geert Uytterhoeven --- v5: - Extracted from "bitfield: Add non-constant field_{prep,get}() helpers". --- drivers/gpio/gpio-aspeed.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/gpio/gpio-aspeed.c b/drivers/gpio/gpio-aspeed.c index ef4ccaf74a5b379e..3da999334971d501 100644 --- a/drivers/gpio/gpio-aspeed.c +++ b/drivers/gpio/gpio-aspeed.c @@ -5,6 +5,7 @@ * Joel Stanley */ =20 +#include #include #include #include @@ -31,12 +32,6 @@ #include #include "gpiolib.h" =20 -/* Non-constant mask variant of FIELD_GET() and FIELD_PREP() */ -#undef field_get -#define field_get(_mask, _reg) (((_reg) & (_mask)) >> (ffs(_mask) - 1)) -#undef field_prep -#define field_prep(_mask, _val) (((_val) << (ffs(_mask) - 1)) & (_mask)) - #define GPIO_G7_IRQ_STS_BASE 0x100 #define GPIO_G7_IRQ_STS_OFFSET(x) (GPIO_G7_IRQ_STS_BASE + (x) * 0x4) #define GPIO_G7_CTRL_REG_BASE 0x180 --=20 2.43.0 From nobody Sun Feb 8 07:07:54 2026 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 9F9B331D740; Mon, 27 Oct 2025 18:44:40 +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=1761590680; cv=none; b=k5OOOp3D2qLYaSywUyUUJsnIQiwwkvBSztwZp70409n7eRA1/nnrrmiwYVvuBO9Fch0QApSxGXQ0uFmHk8zRCnIElqW3s+cfA83a2KdnGV5GaOqazVsaeBIbh7ikHn2+iVSnAwkbYX/gEcGEyBbfj3Lk7pyVxjG2cPrXIK2Q4Bk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761590680; c=relaxed/simple; bh=3Z0yKqYQt4n1/UTlKBhtwL5QwbFq00B6dzUNU0SmWuI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=FJJtSKtbKyItFUzfqtm7l22vjvSGzDmoax0Xg1mnJxWjRD7Wgt571SYosS2Swh/K2ZlM9sVwr2P/iQya1l8cqc22KRV16n7dipLkNItXu3TqHzEN2cMXa7gPJsEZsHwFHCYQYSHZJzZ1Nm0/ngiHgSNBhO/bxUkcLDdJV3yaTvA= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6544CC4CEF1; Mon, 27 Oct 2025 18:44:31 +0000 (UTC) From: Geert Uytterhoeven To: Michael Turquette , Stephen Boyd , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea , Giovanni Cabiddu , Herbert Xu , David Miller , Linus Walleij , Bartosz Golaszewski , Joel Stanley , Andrew Jeffery , Crt Mori , Jonathan Cameron , Lars-Peter Clausen , Jacky Huang , Shan-Chun Hung , Yury Norov , Rasmus Villemoes , Jaroslav Kysela , Takashi Iwai , Johannes Berg , Jakub Kicinski , Alex Elder , David Laight , Vincent Mailhol , Jason Baron , Borislav Petkov , Tony Luck , Michael Hennerich , Kim Seer Paller , David Lechner , =?UTF-8?q?Nuno=20S=C3=A1?= , Andy Shevchenko , Richard Genoud , Cosmin Tanislav , Biju Das , Jianping Shen Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-renesas-soc@vger.kernel.org, linux-crypto@vger.kernel.org, linux-edac@vger.kernel.org, qat-linux@intel.com, linux-gpio@vger.kernel.org, linux-aspeed@lists.ozlabs.org, linux-iio@vger.kernel.org, linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven , Jonathan Cameron Subject: [PATCH v5 16/23] iio: dac: Convert to common field_prep() helper Date: Mon, 27 Oct 2025 19:41:50 +0100 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: 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" Drop the driver-specific field_prep() macro, in favor of the globally available variant from . Signed-off-by: Geert Uytterhoeven Acked-by: Jonathan Cameron --- v5: - Extracted from "bitfield: Add non-constant field_{prep,get}() helpers". --- drivers/iio/dac/ad3530r.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/iio/dac/ad3530r.c b/drivers/iio/dac/ad3530r.c index 5684d11137f29948..b97b46090d808ee7 100644 --- a/drivers/iio/dac/ad3530r.c +++ b/drivers/iio/dac/ad3530r.c @@ -53,10 +53,6 @@ #define AD3530R_MAX_CHANNELS 8 #define AD3531R_MAX_CHANNELS 4 =20 -/* Non-constant mask variant of FIELD_PREP() */ -#undef field_prep -#define field_prep(_mask, _val) (((_val) << (ffs(_mask) - 1)) & (_mask)) - enum ad3530r_mode { AD3530R_NORMAL_OP, AD3530R_POWERDOWN_1K, --=20 2.43.0 From nobody Sun Feb 8 07:07:54 2026 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 1858931B116; Mon, 27 Oct 2025 18:44:49 +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=1761590690; cv=none; b=ltkPXAMi4YKye/QSINh7WzDbEhIs6OfgbnXFIoHvS8UDjqrA5WZ642+KOf16Yhuv/3cIkai3tiakefQha1mYGL8fCW2EdzmaK/V7816E6rG9qUVE6A4Ih46e8PKklbCKlxGrVyar+/phH9SgXdB9erJ4wHkvv+/mmoroB3q7kPo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761590690; c=relaxed/simple; bh=2ky2KyWaqUYFHGiNsTK5hSKy1YE3+/sn+2WpwYCtaAI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fA+uE8hygGsQVHmkQft+9q3Mq8DFwlKcsK+pUPc6/VrAQw73BC5LJvBNxD1go7cKIYHaq9dTJSlmWz9D9PEufQ4v36AH2s83JLyFmv8Z+uqGyDygVzMn3UfeEpyfR2cHIaQdStawoU6P8S5L0K7TX+qf/Mb1rYNZDG3bSTU3k1U= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id C7643C4CEF1; Mon, 27 Oct 2025 18:44:40 +0000 (UTC) From: Geert Uytterhoeven To: Michael Turquette , Stephen Boyd , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea , Giovanni Cabiddu , Herbert Xu , David Miller , Linus Walleij , Bartosz Golaszewski , Joel Stanley , Andrew Jeffery , Crt Mori , Jonathan Cameron , Lars-Peter Clausen , Jacky Huang , Shan-Chun Hung , Yury Norov , Rasmus Villemoes , Jaroslav Kysela , Takashi Iwai , Johannes Berg , Jakub Kicinski , Alex Elder , David Laight , Vincent Mailhol , Jason Baron , Borislav Petkov , Tony Luck , Michael Hennerich , Kim Seer Paller , David Lechner , =?UTF-8?q?Nuno=20S=C3=A1?= , Andy Shevchenko , Richard Genoud , Cosmin Tanislav , Biju Das , Jianping Shen Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-renesas-soc@vger.kernel.org, linux-crypto@vger.kernel.org, linux-edac@vger.kernel.org, qat-linux@intel.com, linux-gpio@vger.kernel.org, linux-aspeed@lists.ozlabs.org, linux-iio@vger.kernel.org, linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven , Jonathan Cameron Subject: [PATCH v5 17/23] iio: mlx90614: Convert to common field_{get,prep}() helpers Date: Mon, 27 Oct 2025 19:41:51 +0100 Message-ID: <8ea8d9d6c33d9589e8761f6000639546f1bd5148.1761588465.git.geert+renesas@glider.be> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: 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" Drop the driver-specific field_get() and field_prep() macros, in favor of the globally available variants from . Signed-off-by: Geert Uytterhoeven Acked-by: Jonathan Cameron Acked-by: Crt Mori --- v5: - Extracted from "bitfield: Add non-constant field_{prep,get}() helpers". --- drivers/iio/temperature/mlx90614.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/drivers/iio/temperature/mlx90614.c b/drivers/iio/temperature/m= lx90614.c index de5615fdb396aa3c..1ad21b73e1b44cb0 100644 --- a/drivers/iio/temperature/mlx90614.c +++ b/drivers/iio/temperature/mlx90614.c @@ -22,6 +22,7 @@ * the "wakeup" GPIO is not given, power management will be disabled. */ =20 +#include #include #include #include @@ -68,12 +69,6 @@ #define MLX90614_CONST_SCALE 20 /* Scale in milliKelvin (0.02 * 1000) */ #define MLX90614_CONST_FIR 0x7 /* Fixed value for FIR part of low pass fil= ter */ =20 -/* Non-constant mask variant of FIELD_GET() and FIELD_PREP() */ -#undef field_get -#define field_get(_mask, _reg) (((_reg) & (_mask)) >> (ffs(_mask) - 1)) -#undef field_prep -#define field_prep(_mask, _val) (((_val) << (ffs(_mask) - 1)) & (_mask)) - struct mlx_chip_info { /* EEPROM offsets with 16-bit data, MSB first */ /* emissivity correction coefficient */ --=20 2.43.0 From nobody Sun Feb 8 07:07:54 2026 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 0AEFF31B830; Mon, 27 Oct 2025 18:44:58 +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=1761590699; cv=none; b=Y0ZFutC9z9SpSPzu0tako/24U2NOY5rfyE7HM2uxlfIYd3tj/i60cdP+UQ/mWcyDF+gV8dCZYGqLnOPf6OBhW5gHBAr3QRFCRDktAgGNhONZEe+bAgwpWZo5Pvz3OKGhMnVXR3+yTcO90EhKEFEeLE2fa+J/Smow41RWDCHJz7I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761590699; c=relaxed/simple; bh=bTPQPo2EZR+fBg73DOlsz07knIP/3wWrrgP8tYueYIE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=QTgrV9mbZD/MsSrj/bfUaPb/Rp//NoBjqJe1DVv3W2dXvSL/2zfUFglEWpS0zKvoggbv6XKTf16SIK+zpeOhS3l8dDEdhAVci90n7CRWd7Iz1JykMjfneXKTFx6zcNZ11w53q3x8vWWviB2IOw/zphbFcvuFPVenb7xw3IOBBsU= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2AD4CC113D0; Mon, 27 Oct 2025 18:44:50 +0000 (UTC) From: Geert Uytterhoeven To: Michael Turquette , Stephen Boyd , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea , Giovanni Cabiddu , Herbert Xu , David Miller , Linus Walleij , Bartosz Golaszewski , Joel Stanley , Andrew Jeffery , Crt Mori , Jonathan Cameron , Lars-Peter Clausen , Jacky Huang , Shan-Chun Hung , Yury Norov , Rasmus Villemoes , Jaroslav Kysela , Takashi Iwai , Johannes Berg , Jakub Kicinski , Alex Elder , David Laight , Vincent Mailhol , Jason Baron , Borislav Petkov , Tony Luck , Michael Hennerich , Kim Seer Paller , David Lechner , =?UTF-8?q?Nuno=20S=C3=A1?= , Andy Shevchenko , Richard Genoud , Cosmin Tanislav , Biju Das , Jianping Shen Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-renesas-soc@vger.kernel.org, linux-crypto@vger.kernel.org, linux-edac@vger.kernel.org, qat-linux@intel.com, linux-gpio@vger.kernel.org, linux-aspeed@lists.ozlabs.org, linux-iio@vger.kernel.org, linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH v5 18/23] pinctrl: ma35: Convert to common field_{get,prep}() helpers Date: Mon, 27 Oct 2025 19:41:52 +0100 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: 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" Drop the driver-specific field_get() and field_prep() macros, in favor of the globally available variants from . Signed-off-by: Geert Uytterhoeven Reviewed-by: Linus Walleij --- v5: - Extracted from "bitfield: Add non-constant field_{prep,get}() helpers". --- drivers/pinctrl/nuvoton/pinctrl-ma35.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/drivers/pinctrl/nuvoton/pinctrl-ma35.c b/drivers/pinctrl/nuvot= on/pinctrl-ma35.c index 925dd717c9deead5..8d71dc53cc1de1f8 100644 --- a/drivers/pinctrl/nuvoton/pinctrl-ma35.c +++ b/drivers/pinctrl/nuvoton/pinctrl-ma35.c @@ -81,12 +81,6 @@ #define MVOLT_1800 0 #define MVOLT_3300 1 =20 -/* Non-constant mask variant of FIELD_GET() and FIELD_PREP() */ -#undef field_get -#define field_get(_mask, _reg) (((_reg) & (_mask)) >> (ffs(_mask) - 1)) -#undef field_prep -#define field_prep(_mask, _val) (((_val) << (ffs(_mask) - 1)) & (_mask)) - static const char * const gpio_group_name[] =3D { "gpioa", "gpiob", "gpioc", "gpiod", "gpioe", "gpiof", "gpiog", "gpioh", "gpioi", "gpioj", "gpiok", "gpiol", "gpiom", "gpion", --=20 2.43.0 From nobody Sun Feb 8 07:07:54 2026 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 34CEA32E13F; Mon, 27 Oct 2025 18:45:08 +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=1761590708; cv=none; b=UvN30cRXf0IaCoMUsKH8iEDLbZpYifOfy0NqFvxp9Z648UHrUic1mtbF/I/sDJEnmhXWhz2T9ln/5YTW1mDTbJgf+82jNiHrrvsQfCIju+w644hoTxZiZk4UrWnKPEXLOOrvAt1+mUXHBLonzQEEK2eU6NUNrj0HaCQZlX/z6aA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761590708; c=relaxed/simple; bh=v+sQfluB1xzcTuPN5tDocRIzwHGhrbFIE1ukWWWoATs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uPw1VkDVZN0yORJxMFgXNiEntvlxjM3uoDwLfQNdX1uFi8324NQZpATdkT0eqLKLuwIq/3s/dtKyUnqvOdK0MEAo6xdKhsPQmZGwpodt2Kj3oNZ3/aQ994tBysMYV5j4HsB3pXMEU/Q7cugc0qfA9cL1oYTB/JuD6OP//wuiMbQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4A559C4CEFD; Mon, 27 Oct 2025 18:44:59 +0000 (UTC) From: Geert Uytterhoeven To: Michael Turquette , Stephen Boyd , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea , Giovanni Cabiddu , Herbert Xu , David Miller , Linus Walleij , Bartosz Golaszewski , Joel Stanley , Andrew Jeffery , Crt Mori , Jonathan Cameron , Lars-Peter Clausen , Jacky Huang , Shan-Chun Hung , Yury Norov , Rasmus Villemoes , Jaroslav Kysela , Takashi Iwai , Johannes Berg , Jakub Kicinski , Alex Elder , David Laight , Vincent Mailhol , Jason Baron , Borislav Petkov , Tony Luck , Michael Hennerich , Kim Seer Paller , David Lechner , =?UTF-8?q?Nuno=20S=C3=A1?= , Andy Shevchenko , Richard Genoud , Cosmin Tanislav , Biju Das , Jianping Shen Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-renesas-soc@vger.kernel.org, linux-crypto@vger.kernel.org, linux-edac@vger.kernel.org, qat-linux@intel.com, linux-gpio@vger.kernel.org, linux-aspeed@lists.ozlabs.org, linux-iio@vger.kernel.org, linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH v5 19/23] soc: renesas: rz-sysc: Convert to common field_get() helper Date: Mon, 27 Oct 2025 19:41:53 +0100 Message-ID: <3cfbe44e26e2253ad1fb82d86fffbd5fb35251a5.1761588465.git.geert+renesas@glider.be> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: 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" Drop the driver-specific field_get() macro, in favor of the globally available variant from . Signed-off-by: Geert Uytterhoeven --- v5: - Extracted from "bitfield: Add non-constant field_{prep,get}() helpers". --- drivers/soc/renesas/rz-sysc.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/soc/renesas/rz-sysc.c b/drivers/soc/renesas/rz-sysc.c index b9880085d3634065..73eaf8b9d69f7208 100644 --- a/drivers/soc/renesas/rz-sysc.c +++ b/drivers/soc/renesas/rz-sysc.c @@ -5,6 +5,7 @@ * Copyright (C) 2024 Renesas Electronics Corp. */ =20 +#include #include #include #include @@ -16,9 +17,6 @@ =20 #include "rz-sysc.h" =20 -#undef field_get -#define field_get(_mask, _reg) (((_reg) & (_mask)) >> (ffs(_mask) - 1)) - /** * struct rz_sysc - RZ SYSC private data structure * @base: SYSC base address --=20 2.43.0 From nobody Sun Feb 8 07:07:54 2026 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 5ED1724E4A8; Mon, 27 Oct 2025 18:45:17 +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=1761590717; cv=none; b=Hh8nGIdVjgNkLS+51lOJiE3tGXs4cW8YG24LHGFFkbRCVGLlwnauDo5xNbOVaBCQ/DzzMzxR/vdqjy5jNxev8aUarGiJlBHgz4KHRcfdV7bU11Plra2SM/jfwJg7f/sAbPdtNosHuRshzsm/QsBfT9umrL41VBjODlgToCMzmpA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761590717; c=relaxed/simple; bh=LSx1HtwZrH0dsMKwJzP92Z2ihwH3DOa7M4lsdOfMulQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=EsDnWrFwkaqISIIL6iz9OEobCwCEVl2tiA5OvUyPSldpwX12PtjSCUZN7DOMKQ4ipD5ItFNSFI2/YuXGORdhceSrNci9W+uXcw5cfTW6kOBet7PlsCGvFbE2T0oDzshSML+4rkNk+oik0ohJLqz+rKinAHKjHsQb/hK2ErRkelg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7F736C113D0; Mon, 27 Oct 2025 18:45:08 +0000 (UTC) From: Geert Uytterhoeven To: Michael Turquette , Stephen Boyd , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea , Giovanni Cabiddu , Herbert Xu , David Miller , Linus Walleij , Bartosz Golaszewski , Joel Stanley , Andrew Jeffery , Crt Mori , Jonathan Cameron , Lars-Peter Clausen , Jacky Huang , Shan-Chun Hung , Yury Norov , Rasmus Villemoes , Jaroslav Kysela , Takashi Iwai , Johannes Berg , Jakub Kicinski , Alex Elder , David Laight , Vincent Mailhol , Jason Baron , Borislav Petkov , Tony Luck , Michael Hennerich , Kim Seer Paller , David Lechner , =?UTF-8?q?Nuno=20S=C3=A1?= , Andy Shevchenko , Richard Genoud , Cosmin Tanislav , Biju Das , Jianping Shen Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-renesas-soc@vger.kernel.org, linux-crypto@vger.kernel.org, linux-edac@vger.kernel.org, qat-linux@intel.com, linux-gpio@vger.kernel.org, linux-aspeed@lists.ozlabs.org, linux-iio@vger.kernel.org, linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH v5 20/23] ALSA: usb-audio: Convert to common field_{get,prep}() helpers Date: Mon, 27 Oct 2025 19:41:54 +0100 Message-ID: <91f957d8857d64df9eae33824203cc770b0182b3.1761588465.git.geert+renesas@glider.be> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: 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" Drop the driver-specific field_get() and field_prep() macros, in favor of the globally available variants from . Signed-off-by: Geert Uytterhoeven Acked-by: Takashi Iwai --- v5: - Extracted from "bitfield: Add non-constant field_{prep,get}() helpers". --- sound/usb/mixer_quirks.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/sound/usb/mixer_quirks.c b/sound/usb/mixer_quirks.c index 713a8498b975e1ac..6eee89cbc0867f2b 100644 --- a/sound/usb/mixer_quirks.c +++ b/sound/usb/mixer_quirks.c @@ -3311,12 +3311,6 @@ static int snd_bbfpro_controls_create(struct usb_mix= er_interface *mixer) #define RME_DIGIFACE_REGISTER(reg, mask) (((reg) << 16) | (mask)) #define RME_DIGIFACE_INVERT BIT(31) =20 -/* Nonconst helpers */ -#undef field_get -#define field_get(_mask, _reg) (((_reg) & (_mask)) >> (ffs(_mask) - 1)) -#undef field_prep -#define field_prep(_mask, _val) (((_val) << (ffs(_mask) - 1)) & (_mask)) - static int snd_rme_digiface_write_reg(struct snd_kcontrol *kcontrol, int i= tem, u16 mask, u16 val) { struct usb_mixer_elem_list *list =3D snd_kcontrol_chip(kcontrol); --=20 2.43.0 From nobody Sun Feb 8 07:07:54 2026 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 93761317711; Mon, 27 Oct 2025 18:45:26 +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=1761590726; cv=none; b=ee965hpeYgoXv2StjzT9B2IgQGlYtRMqcKO/AwQSzgd0m8ufeD3IA7+BmF2nuQxTn1L7ML336JFOPjcVP56k75AvhFoGSCZIvNKBtkuszMxXvkhpBmai3aO4L2/cVMxztR4lMCWLxE+JHd75FswSlBuwL+tkH2l0pIQ69o3tT7o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761590726; c=relaxed/simple; bh=P7bX1PDZYqbzvyJxyuZ/d54zgR6Myun/JBHkpVMbSGw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Ood6pkgZrRkFVGbbLSVJicY8W9kaW6Sax2aqVCwUCjWssGwvhBuT/KgN7pcmyL+I+lAOc5WbsuxrEFfdTezUnwihn3joeMJV7Bif9qO35VYLNiqiaFd/btv53XCX7GY230L3XdMLdQGGf6CrEK9Pqar4bu6zPfZHNkHLOJlKUNM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id AA0ACC4CEF1; Mon, 27 Oct 2025 18:45:17 +0000 (UTC) From: Geert Uytterhoeven To: Michael Turquette , Stephen Boyd , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea , Giovanni Cabiddu , Herbert Xu , David Miller , Linus Walleij , Bartosz Golaszewski , Joel Stanley , Andrew Jeffery , Crt Mori , Jonathan Cameron , Lars-Peter Clausen , Jacky Huang , Shan-Chun Hung , Yury Norov , Rasmus Villemoes , Jaroslav Kysela , Takashi Iwai , Johannes Berg , Jakub Kicinski , Alex Elder , David Laight , Vincent Mailhol , Jason Baron , Borislav Petkov , Tony Luck , Michael Hennerich , Kim Seer Paller , David Lechner , =?UTF-8?q?Nuno=20S=C3=A1?= , Andy Shevchenko , Richard Genoud , Cosmin Tanislav , Biju Das , Jianping Shen Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-renesas-soc@vger.kernel.org, linux-crypto@vger.kernel.org, linux-edac@vger.kernel.org, qat-linux@intel.com, linux-gpio@vger.kernel.org, linux-aspeed@lists.ozlabs.org, linux-iio@vger.kernel.org, linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH -next v5 21/23] iio: imu: smi330: Convert to common field_{get,prep}() helpers Date: Mon, 27 Oct 2025 19:41:55 +0100 Message-ID: <79c392bcd9c1127e9a7fa977780335795f0b99af.1761588465.git.geert+renesas@glider.be> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: 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" Drop the driver-specific field_get() and field_prep() macros, in favor of the globally available variants from . Signed-off-by: Geert Uytterhoeven --- v5: - New. --- drivers/iio/imu/smi330/smi330_core.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/drivers/iio/imu/smi330/smi330_core.c b/drivers/iio/imu/smi330/= smi330_core.c index a79964fe68fadf47..83e0dff5d973d046 100644 --- a/drivers/iio/imu/smi330/smi330_core.c +++ b/drivers/iio/imu/smi330/smi330_core.c @@ -67,12 +67,6 @@ #define SMI330_CHIP_ID 0x42 #define SMI330_SOFT_RESET_DELAY 2000 =20 -/* Non-constant mask variant of FIELD_GET() and FIELD_PREP() */ -#undef field_get -#define field_get(_mask, _reg) (((_reg) & (_mask)) >> (ffs(_mask) - 1)) -#undef field_prep -#define field_prep(_mask, _val) (((_val) << (ffs(_mask) - 1)) & (_mask)) - #define SMI330_ACCEL_CHANNEL(_axis) { \ .type =3D IIO_ACCEL, \ .modified =3D 1, \ --=20 2.43.0 From nobody Sun Feb 8 07:07:54 2026 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 E448831DDBD; Mon, 27 Oct 2025 18:45:35 +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=1761590736; cv=none; b=SVitQIyhHFeFYJHGlS4mk5xROtysVuT1QXvh5UuGqzWWQemRA1HXYc92LY6eZbXl5ECIrF+n7FjbXE/PZtT3oGtbulwNxOxJ021zZdLsjIF8N0AcA+KpbKbRoRzrnLJkDEYnTHtTcS6om1iu7K7nsHSQJJHj30sifGxAsPCcMyU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761590736; c=relaxed/simple; bh=YxC1ZEm87oCyf+XvjDFW3H2bStOPO3EAmv2hz/JTnlg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=tMqRsZN/tPnA2WpX5F+0CRir3YY89S5wqbcWfBr8GW2r2+/HlkcLDtAQg9zQIR768hN0C37ckYJvkGDFPDBrfzoVSXbJdI0TOKrMKsTcVz6TloMJgvOTU9V6q2VKGVte7/9ci1OTV8BQNrI2GU07Wntway8vCdjM9627wcX1PhE= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id DAD0FC4CEFD; Mon, 27 Oct 2025 18:45:26 +0000 (UTC) From: Geert Uytterhoeven To: Michael Turquette , Stephen Boyd , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea , Giovanni Cabiddu , Herbert Xu , David Miller , Linus Walleij , Bartosz Golaszewski , Joel Stanley , Andrew Jeffery , Crt Mori , Jonathan Cameron , Lars-Peter Clausen , Jacky Huang , Shan-Chun Hung , Yury Norov , Rasmus Villemoes , Jaroslav Kysela , Takashi Iwai , Johannes Berg , Jakub Kicinski , Alex Elder , David Laight , Vincent Mailhol , Jason Baron , Borislav Petkov , Tony Luck , Michael Hennerich , Kim Seer Paller , David Lechner , =?UTF-8?q?Nuno=20S=C3=A1?= , Andy Shevchenko , Richard Genoud , Cosmin Tanislav , Biju Das , Jianping Shen Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-renesas-soc@vger.kernel.org, linux-crypto@vger.kernel.org, linux-edac@vger.kernel.org, qat-linux@intel.com, linux-gpio@vger.kernel.org, linux-aspeed@lists.ozlabs.org, linux-iio@vger.kernel.org, linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH v5 22/23] clk: renesas: Use bitfield helpers Date: Mon, 27 Oct 2025 19:41:56 +0100 Message-ID: <362ca57b994141c4747596d9da432057e09e7713.1761588465.git.geert+renesas@glider.be> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: 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" Use the FIELD_{GET,PREP}() and field_{get,prep}() helpers for const respective non-const bitfields, instead of open-coding the same operations. Signed-off-by: Geert Uytterhoeven --- v5: - No changes, v4: - No changes, v3: - No changes, v2: - Rebase on top of commit 470e3f0d0b1529ab ("clk: renesas: rcar-gen4: Introduce R-Car Gen4 CPG driver"). --- drivers/clk/renesas/clk-div6.c | 6 +++--- drivers/clk/renesas/rcar-gen3-cpg.c | 15 +++++---------- drivers/clk/renesas/rcar-gen4-cpg.c | 9 +++------ 3 files changed, 11 insertions(+), 19 deletions(-) diff --git a/drivers/clk/renesas/clk-div6.c b/drivers/clk/renesas/clk-div6.c index 3abd6e5400aded6a..f7b827b5e9b2dd32 100644 --- a/drivers/clk/renesas/clk-div6.c +++ b/drivers/clk/renesas/clk-div6.c @@ -7,6 +7,7 @@ * Contact: Laurent Pinchart */ =20 +#include #include #include #include @@ -171,8 +172,7 @@ static u8 cpg_div6_clock_get_parent(struct clk_hw *hw) if (clock->src_mask =3D=3D 0) return 0; =20 - hw_index =3D (readl(clock->reg) & clock->src_mask) >> - __ffs(clock->src_mask); + hw_index =3D field_get(clock->src_mask, readl(clock->reg)); for (i =3D 0; i < clk_hw_get_num_parents(hw); i++) { if (clock->parents[i] =3D=3D hw_index) return i; @@ -191,7 +191,7 @@ static int cpg_div6_clock_set_parent(struct clk_hw *hw,= u8 index) if (index >=3D clk_hw_get_num_parents(hw)) return -EINVAL; =20 - src =3D clock->parents[index] << __ffs(clock->src_mask); + src =3D field_prep(clock->src_mask, clock->parents[index]); writel((readl(clock->reg) & ~clock->src_mask) | src, clock->reg); return 0; } diff --git a/drivers/clk/renesas/rcar-gen3-cpg.c b/drivers/clk/renesas/rcar= -gen3-cpg.c index 10ae20489df9abd8..b954278ddd9d8aa8 100644 --- a/drivers/clk/renesas/rcar-gen3-cpg.c +++ b/drivers/clk/renesas/rcar-gen3-cpg.c @@ -54,10 +54,8 @@ static unsigned long cpg_pll_clk_recalc_rate(struct clk_= hw *hw, { struct cpg_pll_clk *pll_clk =3D to_pll_clk(hw); unsigned int mult; - u32 val; =20 - val =3D readl(pll_clk->pllcr_reg) & CPG_PLLnCR_STC_MASK; - mult =3D (val >> __ffs(CPG_PLLnCR_STC_MASK)) + 1; + mult =3D FIELD_GET(CPG_PLLnCR_STC_MASK, readl(pll_clk->pllcr_reg)) + 1; =20 return parent_rate * mult * pll_clk->fixed_mult; } @@ -94,7 +92,7 @@ static int cpg_pll_clk_set_rate(struct clk_hw *hw, unsign= ed long rate, =20 val =3D readl(pll_clk->pllcr_reg); val &=3D ~CPG_PLLnCR_STC_MASK; - val |=3D (mult - 1) << __ffs(CPG_PLLnCR_STC_MASK); + val |=3D FIELD_PREP(CPG_PLLnCR_STC_MASK, mult - 1); writel(val, pll_clk->pllcr_reg); =20 for (i =3D 1000; i; i--) { @@ -176,11 +174,7 @@ static unsigned long cpg_z_clk_recalc_rate(struct clk_= hw *hw, unsigned long parent_rate) { struct cpg_z_clk *zclk =3D to_z_clk(hw); - unsigned int mult; - u32 val; - - val =3D readl(zclk->reg) & zclk->mask; - mult =3D 32 - (val >> __ffs(zclk->mask)); + unsigned int mult =3D 32 - field_get(zclk->mask, readl(zclk->reg)); =20 return DIV_ROUND_CLOSEST_ULL((u64)parent_rate * mult, 32 * zclk->fixed_div); @@ -231,7 +225,8 @@ static int cpg_z_clk_set_rate(struct clk_hw *hw, unsign= ed long rate, if (readl(zclk->kick_reg) & CPG_FRQCRB_KICK) return -EBUSY; =20 - cpg_reg_modify(zclk->reg, zclk->mask, (32 - mult) << __ffs(zclk->mask)); + cpg_reg_modify(zclk->reg, zclk->mask, + field_prep(zclk->mask, 32 - mult)); =20 /* * Set KICK bit in FRQCRB to update hardware setting and wait for diff --git a/drivers/clk/renesas/rcar-gen4-cpg.c b/drivers/clk/renesas/rcar= -gen4-cpg.c index fb9a876aaba5cbcd..db3a0b8ef2b936bb 100644 --- a/drivers/clk/renesas/rcar-gen4-cpg.c +++ b/drivers/clk/renesas/rcar-gen4-cpg.c @@ -279,11 +279,7 @@ static unsigned long cpg_z_clk_recalc_rate(struct clk_= hw *hw, unsigned long parent_rate) { struct cpg_z_clk *zclk =3D to_z_clk(hw); - unsigned int mult; - u32 val; - - val =3D readl(zclk->reg) & zclk->mask; - mult =3D 32 - (val >> __ffs(zclk->mask)); + unsigned int mult =3D 32 - field_get(zclk->mask, readl(zclk->reg)); =20 return DIV_ROUND_CLOSEST_ULL((u64)parent_rate * mult, 32 * zclk->fixed_div); @@ -334,7 +330,8 @@ static int cpg_z_clk_set_rate(struct clk_hw *hw, unsign= ed long rate, if (readl(zclk->kick_reg) & CPG_FRQCRB_KICK) return -EBUSY; =20 - cpg_reg_modify(zclk->reg, zclk->mask, (32 - mult) << __ffs(zclk->mask)); + cpg_reg_modify(zclk->reg, zclk->mask, + field_prep(zclk->mask, 32 - mult)); =20 /* * Set KICK bit in FRQCRB to update hardware setting and wait for --=20 2.43.0 From nobody Sun Feb 8 07:07:54 2026 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 6F50E326D74; Mon, 27 Oct 2025 18:45:45 +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=1761590745; cv=none; b=uqbbbk5o8wLp/IfrkseYhTj9Gh4OIrYrQ7SkCYjeP1Wyp4K/AbWuz3Knj/UAb8cs66K2iq1WNWjRnKAi2tt6mOLwTtgshBdPIcosnR47PIebZT+REMAIXjHwENt94CaMi+cjrl+7addzmEXeY5W5p5R5Qd1uOuqnTUCZ4ASguZo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761590745; c=relaxed/simple; bh=l+k3T8WhLZTpDb7CbRpBhiGt+Z826lr9zR8apoxyAS8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=FXP3SppS/Vt306GfL9WiCUbaMA/n0mm33Hc6xJ3anbSmMkBzEhm/2liwH47C2ELbGICr7+vKEwZeOsiEh1VRy7aWTm1q2IFGUjF9f7XorLdeUbMWNnjyTEpncns3+Wuon1nMzeRyjcPiR5bQMqwHtlA/FX2RTqppE3PszjSLq+s= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 24E1DC4CEF1; Mon, 27 Oct 2025 18:45:35 +0000 (UTC) From: Geert Uytterhoeven To: Michael Turquette , Stephen Boyd , Nicolas Ferre , Alexandre Belloni , Claudiu Beznea , Giovanni Cabiddu , Herbert Xu , David Miller , Linus Walleij , Bartosz Golaszewski , Joel Stanley , Andrew Jeffery , Crt Mori , Jonathan Cameron , Lars-Peter Clausen , Jacky Huang , Shan-Chun Hung , Yury Norov , Rasmus Villemoes , Jaroslav Kysela , Takashi Iwai , Johannes Berg , Jakub Kicinski , Alex Elder , David Laight , Vincent Mailhol , Jason Baron , Borislav Petkov , Tony Luck , Michael Hennerich , Kim Seer Paller , David Lechner , =?UTF-8?q?Nuno=20S=C3=A1?= , Andy Shevchenko , Richard Genoud , Cosmin Tanislav , Biju Das , Jianping Shen Cc: linux-clk@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-renesas-soc@vger.kernel.org, linux-crypto@vger.kernel.org, linux-edac@vger.kernel.org, qat-linux@intel.com, linux-gpio@vger.kernel.org, linux-aspeed@lists.ozlabs.org, linux-iio@vger.kernel.org, linux-sound@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH v5 23/23] soc: renesas: Use bitfield helpers Date: Mon, 27 Oct 2025 19:41:57 +0100 Message-ID: X-Mailer: git-send-email 2.43.0 In-Reply-To: References: 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" Use the field_get() helper, instead of open-coding the same operation. Signed-off-by: Geert Uytterhoeven --- v5: - No changes, v4: - No changes, v3: - No changes, v2: - Drop RFC, as a dependency was applied. --- drivers/soc/renesas/renesas-soc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/soc/renesas/renesas-soc.c b/drivers/soc/renesas/renesa= s-soc.c index 1eb52356b996bdd7..ee4f17bb4db45db7 100644 --- a/drivers/soc/renesas/renesas-soc.c +++ b/drivers/soc/renesas/renesas-soc.c @@ -5,6 +5,7 @@ * Copyright (C) 2014-2016 Glider bvba */ =20 +#include #include #include #include @@ -524,8 +525,7 @@ static int __init renesas_soc_init(void) eshi, eslo); } =20 - if (soc->id && - ((product & id->mask) >> __ffs(id->mask)) !=3D soc->id) { + if (soc->id && field_get(id->mask, product) !=3D soc->id) { pr_warn("SoC mismatch (product =3D 0x%x)\n", product); ret =3D -ENODEV; goto free_soc_dev_attr; --=20 2.43.0