From nobody Thu Dec 18 21:45:12 2025 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 37BA6332EA8; Thu, 6 Nov 2025 13:34:42 +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=1762436083; cv=none; b=F/eZbo63IS2ZDKorN2p9O/dt5+scPb2vCt5JKl+vvLbcJLhXC+CFtwgeIZ/lLnbKxGX5B4jZ17xRpnNGuAAsY3NSl4LK9dfzsibFvn1BITtSgnLMdk01bFp4bHgXfguEHBGZoy2dn1r1X6lIXbgBBJwOq9bwVjTMB15aF0rN5Ig= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762436083; c=relaxed/simple; bh=VvNmR++yh7WAnYFx+zWDkYTT93AZwSa+4wC/ospG4vo=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=TSOizJyhC7ZlmGohOe8dl4bTrqym0OrnLVQx3N3COwxHIpyQ26UvbuWYUsh4SJV24DKhv4+WDH7cFIBJCmo6HHw3KbOrjS+AiHwgGqh7BXEIPbPwfgMff4GezIciMSu6YGCTzyhdBL8m99NmpzbXHw0A3ltBS7yfDJRhyYxvlhM= 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 70790C4CEF7; Thu, 6 Nov 2025 13:34:32 +0000 (UTC) From: Geert Uytterhoeven To: Yury Norov , 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 , 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 , Nathan Chancellor , Nick Desaulniers , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra 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-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH v6 01/26] clk: at91: pmc: #undef field_{get,prep}() before definition Date: Thu, 6 Nov 2025 14:33:49 +0100 Message-ID: <939d8c6da1f468026b1bb201413ba08b1d0751fd.1762435376.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 Acked-by: Alexandre Belloni Acked-by: Claudiu Beznea Acked-by: Stephen Boyd --- v6: - Add Acked-by, v5: - New. --- 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 Thu Dec 18 21:45:12 2025 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 7D3DA1EE033; Thu, 6 Nov 2025 13:34: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=1762436093; cv=none; b=KQNmX52sbKuRHxYniKJAqPrulvAKn/w07X8z1hoLVD5fuN3DCY5AdhPEV/VoZUFmhcG/hXc2/LRzxUiZJDgt2npC0cB+ZBHDARy33B2zyGqnU8B1cxow6bOl6DWx1bcOxwzLACm7RCDW4/AhZDUqcCr8XfweZnLGcKTtbeLUDwU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762436093; c=relaxed/simple; bh=uGBDiyrqhQYv3NwrbZoipHgQxTMWyoIkzyUfHSZ0wQY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=j/qRqwdu4/8CskFmEpcakW207KhSGCwWdh+hkY3FK2ZXPkf4JMAVd8a3baNc1WBCdD0tkG7+E+MhBWJ78PVqT/5meilMfAl/3gSgs6G3ip386HOp7EwqRHdmmmyTyUPEmVjEn40lLctDuYGf1VJ98owThg+tLh4XbAhsNJP/ktA= 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 36DD8C4CEFB; Thu, 6 Nov 2025 13:34:43 +0000 (UTC) From: Geert Uytterhoeven To: Yury Norov , 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 , 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 , Nathan Chancellor , Nick Desaulniers , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra 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-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH v6 02/26] crypto: qat - #undef field_get() before local definition Date: Thu, 6 Nov 2025 14:33:50 +0100 Message-ID: <9300ac4c91dc565dcc81f002306e74399f5d4090.1762435376.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 Acked-by: Giovanni Cabiddu --- v6: - Add Acked-by, v5: - New. --- 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 Thu Dec 18 21:45:12 2025 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 0941C1E0DD9; Thu, 6 Nov 2025 13:35:03 +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=1762436104; cv=none; b=XtO4d4XxfF3kzNaLOjFI59mA3u38sg8EoHkEhd1AXpF8lUxTA6nkZSbBnevxRkGNrLfM7FTAEf5WEk1cSK35i3D7Xzz3BoNa5BSXXse6zToi7lVUkRor/npCKrQg4f17tdrHqbTdJaP2Nnz/sEWzLsQFzRqeoWm3fxDjbwPAjXM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762436104; c=relaxed/simple; bh=XBQh3ZOE3ZvB/Zk43wZnlsrRGx5O16aPdjp43+4LOaY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Y9YWGgdhsv1GLalytAgl767fP3sNTls/SZol3XBGarLp0sVnA17LXIG1wPmA65kOac4zqOLT8Kb+sNVJrc3fkD5iYWKBgY4Hzh4yOQsJR7xr0+dAXRWdR8KUkSPeKUYIozu3N8d+BN9cwxxY4/kItYoEKb9k6qhL9VkVbWlcPYg= 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 7FCF9C19424; Thu, 6 Nov 2025 13:34:53 +0000 (UTC) From: Geert Uytterhoeven To: Yury Norov , 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 , 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 , Nathan Chancellor , Nick Desaulniers , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra 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-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH v6 03/26] EDAC/ie31200: #undef field_get() before local definition Date: Thu, 6 Nov 2025 14:33:51 +0100 Message-ID: <581bca4d109242bb5acb3be49dbf1bde780f2884.1762435376.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 Reviewed-by: Qiuxu Zhuo --- v6: - No changes, 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 Thu Dec 18 21:45:12 2025 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 60D7A22D4E9; Thu, 6 Nov 2025 13:35:14 +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=1762436114; cv=none; b=TUnlbuT50iGv0JJzMcSmHnqqwIdolQaqlLxG826mSOZJiHf8HEv4tKLMQ6sjPAdRKdlO+Bvm3sCeSOasOwQzhWkR5bvJX6fTa8xvv+ycVnz88+iu9vwxgsilanGGD1w55SrXz1Jz5KTAXPTDQ4/KCIcTjMoOWqCyPO351VuCcb0= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762436114; c=relaxed/simple; bh=lZzkKR5s+uRAPjDMYU3Tgg7kF3xAcA5usORbjtYvJE8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bP/2FRT3LV66NaWYt1rmew1eeRofXlomHpDioP50TeKiJca5y04RVwfpW8DJ8vX7rvxWOR+AdXK+wcAxhbDNmlGNYWvicCLkUnXcHu0es7vQqHLBPxsVG3w9tijH8XVkeSoZeKRyojUnAk7FOScXOPGShkrxtpnTwKzVLJaRMnc= 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 EBD19C4CEFB; Thu, 6 Nov 2025 13:35:03 +0000 (UTC) From: Geert Uytterhoeven To: Yury Norov , 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 , 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 , Nathan Chancellor , Nick Desaulniers , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra 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-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven , Bartosz Golaszewski Subject: [PATCH v6 04/26] gpio: aspeed: #undef field_{get,prep}() before local definition Date: Thu, 6 Nov 2025 14:33: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" 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 Acked-by: Bartosz Golaszewski --- v6: - Add Acked-by, v5: - New. --- 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 Thu Dec 18 21:45:12 2025 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 61DF622D4E9; Thu, 6 Nov 2025 13:35:24 +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=1762436124; cv=none; b=izLE1jZuLD8omcOhAtQPFJZwCpJEM1/oB/5JmiA3V6ELuKU2SzVp5EuEBPwx3BuQ0BxzNN1PUL7yaQ8ioCI/75Ixe9UxnaDwivjokcZW4xt3PrRD6F25NI1XiP437vlMBcpw904FaaCw14sn1esxLRLMcl3joye4D8W2vp/NjdM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762436124; c=relaxed/simple; bh=nDP0lFBvNYEkrAQEUlWtlqBdBdUwZbGNoXfDDRPBZhY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Xh4Jy6GiyQKAQ+rzdt10Aji+I5XM1kYONpd7zTkXEGxCLTra2NllHauY5wlqM+jVS2k3H4ANLqOZoy2+T3jGtRvGY+usOAH2+m/pATV+erXLzAtNDtJSKmi7v4WfCeJAg3+83o7lCrvq/gGZJ9qp71xxLursuXk6thIgnHq2saU= 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 62A4DC116D0; Thu, 6 Nov 2025 13:35:14 +0000 (UTC) From: Geert Uytterhoeven To: Yury Norov , 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 , 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 , Nathan Chancellor , Nick Desaulniers , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra 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-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH v6 05/26] iio: dac: ad3530r: #undef field_prep() before local definition Date: Thu, 6 Nov 2025 14:33:53 +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 Acked-by: Jonathan Cameron --- v6: - No changes, 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 Thu Dec 18 21:45:12 2025 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 B2A6D3321C7; Thu, 6 Nov 2025 13:35:34 +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=1762436134; cv=none; b=G3ZkoyKfx1ZdKN1ixtwEZ/glDgChPmwmr//A2sQtqpuT9SY9/ndqViWuOkSnTwoMYnF6PEM8ElPwY+MGwnKjaE/idJJjVFW01lpdSzQyKpgi7flB4o/VBSXucE31Mjzmt2EHlMLgzpHiLLItKmHYt6YpoI7I874vK4PMPwog//k= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762436134; c=relaxed/simple; bh=nyoHlA473M6VG5eO6lu/v0dCC77k1DZuDUpkBW3EzaE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mIjq+wKYU3Kc/sQ9tpum2VrvtERZkuhV82ID+FIi89M217n6ZO0XBQQ/4cns2Ps8uZGzK6siAgJOkcRuyoemTxZoTM//d2kEc0FxZlH/KZWGFp7CmY0kCuu7+xv0DxZfV4oYDzdw/bEnwOORswV9T4/1WnKRUMbF/4ODpGmxALo= 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 AB744C4CEF7; Thu, 6 Nov 2025 13:35:24 +0000 (UTC) From: Geert Uytterhoeven To: Yury Norov , 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 , 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 , Nathan Chancellor , Nick Desaulniers , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra 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-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH v6 06/26] iio: mlx90614: #undef field_{get,prep}() before local definition Date: Thu, 6 Nov 2025 14:33:54 +0100 Message-ID: <6c773f03da99ccc081a33d2363879957ac96ce33.1762435376.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 Acked-by: Jonathan Cameron --- v6: - No changes, 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 Thu Dec 18 21:45:12 2025 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 1420D32ED3C; Thu, 6 Nov 2025 13:35: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=1762436145; cv=none; b=oE0AH1PF9NWMgMrAghYWJz8dpXB59x85NQ8D6mXmKp2frsiCSguFtzGe0fsARpOpsP4A5yAxCCWoYm1+DjSrp2QF74/amIwUZUnvFzXQA3sgPQgz3Ab+xxlJWj8A3IIF3vxPLJyElXc6GH6hWABHPeuh1fVWEi/WNQcBK44N5co= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762436145; c=relaxed/simple; bh=9r86/JplIKDdH4R3eIMxMSbLT+0SyyMkl4WwR+PV4w0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=jv4J6Iqold1M7rZOFSQc/9GBoCgdtys4w5Ao4pxZsl+rOR24V5q83MicpbVwtM/88H6VnR20k3qMlXJQvZKhf1H8cyvl0gDJYI7D8+zcQOjcjbngFG4sdzp/nKasiWe9Iwznlvtco3x2KeONf2iajLzGxOEjM7Q/v8g101qXesc= 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 0913AC4CEFB; Thu, 6 Nov 2025 13:35:34 +0000 (UTC) From: Geert Uytterhoeven To: Yury Norov , 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 , 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 , Nathan Chancellor , Nick Desaulniers , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra 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-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH v6 07/26] pinctrl: ma35: #undef field_{get,prep}() before local definition Date: Thu, 6 Nov 2025 14:33:55 +0100 Message-ID: <0840ef3c986f6474a980c1e3e5e95aea803a3581.1762435376.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 Acked-by: Linus Walleij --- v6: - Add Acked-by, v5: - New. --- 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 Thu Dec 18 21:45:12 2025 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 955FA339B34; Thu, 6 Nov 2025 13:35:55 +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=1762436155; cv=none; b=E+22M/vt+rhorWdzXUeW1iVaeZT+HPMNNkaT2PZITJplx+H/B2QskBXFAM+8c/8kHMsgr94tyX3G2gLVXWYE47zeBqw7HZwUQRnY0fycfqESMF4u4UVTQ1O75Xg3l04IZmj0lc1ZEIYZ3jxz+O7BHj+cyekSvxaBqX6fzhjukqI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762436155; c=relaxed/simple; bh=T6wmM16PxIZU4x9VVRCAk33xF0JNROV4eNP3HBAIm8k=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mELePjxmfBwTMt1si2Er/Iq+O4Jxw55ltoby0SZLaKP0G16qfu4ZxI6gYeCxz8691BYCCTGcbfUjex3oIdESGYt9LfwhPq4w6vwBTnciGrBfB32X9b7hzmSbNanVkaRDQQpZOFwJtQQlfXZiniQRYuKbUHLnYk5s9Fr01w0I+xE= 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 55176C116C6; Thu, 6 Nov 2025 13:35:45 +0000 (UTC) From: Geert Uytterhoeven To: Yury Norov , 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 , 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 , Nathan Chancellor , Nick Desaulniers , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra 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-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH v6 08/26] soc: renesas: rz-sysc: #undef field_get() before local definition Date: Thu, 6 Nov 2025 14:33:56 +0100 Message-ID: <7feec8e9cf823dd365d6e0f21004f943964e52a0.1762435376.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 Reviewed-by: Claudiu Beznea --- v6: - No changes, 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 Thu Dec 18 21:45:12 2025 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 3626E2D6E53; Thu, 6 Nov 2025 13:36:05 +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=1762436168; cv=none; b=M+3bEkjIu79zhYJfGoK3SQnpYCHPQws8Ku1T+EXjy1dZiQjbMwl1Gzx5c3WqbcDT8Tf5ZL35wTAmD3Wcd069S3CFI3J/UhsjL1PrUuiWYo1bcJlWGh96leRWgJkqnPSihEAhb6C9mYy49f+s7OyJUjBrTUnWtE+aZSEtcDlhj2Y= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762436168; c=relaxed/simple; bh=vMt78jObvHH7kPWJbiQKe6Q3XYYoFMvl2O250d/oGhk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=DB0enzzHRF/74NwcSg86CP8ZXwRTslnHbEhlw7hE+vJR/SfSe8F1YPxH4Q/0fGD88hTgdugGkHOs0L7G1Mlk8rzCDtJK7odA9ohtFMewzFjYjnNxccPwyNsBAKM9u/cEkYoO8ZhlFaeMWwSjeEjbB/jbtMLaUYq48ij8CWWvkwg= 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 97896C4CEFB; Thu, 6 Nov 2025 13:35:55 +0000 (UTC) From: Geert Uytterhoeven To: Yury Norov , 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 , 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 , Nathan Chancellor , Nick Desaulniers , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra 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-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven , Takashi Iwai Subject: [PATCH v6 09/26] ALSA: usb-audio: #undef field_{get,prep}() before local definition Date: Thu, 6 Nov 2025 14:33:57 +0100 Message-ID: <57114f0f4fcd3fcf8bbbcb5eaa2c0b4d22e9075c.1762435376.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 Acked-by: Takashi Iwai --- v6: - Add Acked-by, v5: - New. --- 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 Thu Dec 18 21:45:12 2025 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 20A933328FB; Thu, 6 Nov 2025 13:36:16 +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=1762436176; cv=none; b=UwykNBCU1T9+ntCzg9gynnYaMflFMNsv546ZoCiy72XoGQtfpkcLK7SDoshOgjGsVGu/H8eXp9OcA0tmxeSz7DQl93N/HKfR7PIIPRMcxeLhqgi0wMrn//5ap/u7A+BE3yx3HmDzM72pLTkbKnYWgWSjXEncuSuMtqDd/Y9e26c= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762436176; c=relaxed/simple; bh=NVO8rjAKtS1X+XIlE/vArk6VKL6+WzY8w6gLXSLIiQA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Wmtmp6woT6KJ+2twWWkxUwo4JSezhUObXU/NoDLMWAl3t9iPIU+LFvGHv2pYU11ibzI0tPUuuTRSbclX7bucIFJdlaQzHDksgjCZoo5DmISLvoNvF8b63u1p1e7C8HxU9aXDlqH0c27uZX+457gl2jlgJ07q7mAfQkK6ZPKoByA= 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 1E416C116C6; Thu, 6 Nov 2025 13:36:05 +0000 (UTC) From: Geert Uytterhoeven To: Yury Norov , 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 , 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 , Nathan Chancellor , Nick Desaulniers , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra 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-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH -next v6 10/26] iio: imu: smi330: #undef field_{get,prep}() before definition Date: Thu, 6 Nov 2025 14:33:58 +0100 Message-ID: <54c739d05673e512d091bf78e54cd00e3655d7d4.1762435376.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 --- v6: - No changes, 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 Thu Dec 18 21:45:12 2025 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 B977D332915; Thu, 6 Nov 2025 13:36: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=1762436186; cv=none; b=X6HKXLD53DaOxpyVnZz92zsSnVdVCf+fT9d38edWEt97K+03+iCNUgNbXT7pznAPh06qKSm3IHHQhdYAVZdlwSLpSjc/VxIt7/whUN/WOsZPTAy4MkKJmlbe+8uoFnfuWHysq+9KcBGX4cY22LGz5JiD+OxyARUkS7YQwEnhdgw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762436186; c=relaxed/simple; bh=fu5du/iEUOZRZQmn3i4mkxhiGI17sTX7Zm4LyjqaCiw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=RwN7cTA5rFo3fk/FggJaTxjqwq4UNDLfpFa69/THhP+jcoInQ960eZWk2cGNHs6d82U+4u85ReRf65Ljz0iVFrQjDMEW2nn5BTSXdWFxn7y8x/ykenX8+2vJgj9p4WTSDtRVRgnRpN+AxLn+9IhPzJ+nUZpL/4lK2O/3RAXGx2M= 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 629E3C4CEFB; Thu, 6 Nov 2025 13:36:16 +0000 (UTC) From: Geert Uytterhoeven To: Yury Norov , 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 , 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 , Nathan Chancellor , Nick Desaulniers , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra 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-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH -next v6 11/26] mtd: rawnand: sunxi: #undef field_{get,prep}() before local definition Date: Thu, 6 Nov 2025 14:33:59 +0100 Message-ID: <703d7eec56074148daed4ea45b637f8a83f15305.1762435376.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 --- v6: - New. --- drivers/mtd/nand/raw/sunxi_nand.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/mtd/nand/raw/sunxi_nand.c b/drivers/mtd/nand/raw/sunxi= _nand.c index 031ab651c5a83b74..9dcdc93734cbff39 100644 --- a/drivers/mtd/nand/raw/sunxi_nand.c +++ b/drivers/mtd/nand/raw/sunxi_nand.c @@ -30,7 +30,9 @@ #include =20 /* non compile-time field get/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 NFC_REG_CTL 0x0000 --=20 2.43.0 From nobody Thu Dec 18 21:45:12 2025 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 10E4130EF66; Thu, 6 Nov 2025 13:36:36 +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=1762436197; cv=none; b=mTBrofMH97Dtsdj1eS3nGi/DC9PTQlTldt7Oh2lDFCQayOKoqt5O4lx5PfEEM9WBQHS8GoXM8y/sB+WpoHijIPOvAsOI84rMKg2Z/n3PiVDDkanARzERSks538vrjYXYAk3WV7yhbk5ixJ3VKq0qKRyyWq1wlzMMUrGZI1Ge+uQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762436197; c=relaxed/simple; bh=1U/6drmVbxGUGiuIVxJQJCv1DC8ZLFr9ZVvvvABITjM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=uQFlOE+91JP5IgGQ+ff80rRPrSO8klLIeq8D5BMVRrzDZTaasoif5A7z33GJL0cvSVEo3Bb7l19pkqAMTq2h6GeclUoPc0nozjMAhr00TCu9yqA60AraUJyOiSU0jUMGH/Fw/7r+hmKX5JK6oYOWtHmn9f11RxJladewOFwnxGA= 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 B23EDC116D0; Thu, 6 Nov 2025 13:36:26 +0000 (UTC) From: Geert Uytterhoeven To: Yury Norov , 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 , 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 , Nathan Chancellor , Nick Desaulniers , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra 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-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH v6 12/26] bitfield: Add less-checking __FIELD_{GET,PREP}() Date: Thu, 6 Nov 2025 14:34:00 +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" The BUILD_BUG_ON_MSG() check against "~0ull" works only with "unsigned (long) long" _mask types. For constant masks, that condition is usually met, as GENMASK() yields an UL value. The few places where the constant mask is stored in an intermediate variable were fixed by changing the variable type to u64 (see e.g. [1] and [2]). However, for non-constant masks, smaller unsigned types should be valid, too, but currently lead to "result of comparison of constant 18446744073709551615 with expression of type ... is always false"-warnings with clang and W=3D1. Hence refactor the __BF_FIELD_CHECK() helper, and factor out __FIELD_{GET,PREP}(). The later lack the single problematic check, but are otherwise identical to FIELD_{GET,PREP}(), and are intended to be used in the fully non-const variants later. [1] commit 5c667d5a5a3ec166 ("clk: sp7021: Adjust width of _m in HWM_FIELD_PREP()") [2] commit cfd6fb45cfaf46fa ("crypto: ccree - avoid out-of-range warnings from clang") Signed-off-by: Geert Uytterhoeven --- v6: - New. Alternatively, FIELD_{GET,PREP}() could be duplicated, with the second parameter of __BF_FIELD_CHECK() changed from "0ULL" resp. "_reg" to "_mask": #define __FIELD_PREP(_mask, _val) \ ({ \ __BF_FIELD_CHECK(_mask, _mask, _val, "__FIELD_PREP: "); \ ((typeof(_mask))(_val) << __bf_shf(_mask)) & (_mask); \ }) #define __FIELD_GET(_mask, _reg) \ ({ \ __BF_FIELD_CHECK(_mask, _mask, 0U, "__FIELD_GET: "); \ (typeof(_mask))(((_reg) & (_mask)) >> __bf_shf(_mask)); \ }) But I think that is less intuitive, and prevents defining FIELD_{GET,PREP}() using __FIELD_{GET,PREP}(). --- include/linux/bitfield.h | 36 ++++++++++++++++++++++++++++-------- 1 file changed, 28 insertions(+), 8 deletions(-) diff --git a/include/linux/bitfield.h b/include/linux/bitfield.h index 5355f8f806a97974..bf8e0ae4b5b41038 100644 --- a/include/linux/bitfield.h +++ b/include/linux/bitfield.h @@ -60,7 +60,7 @@ =20 #define __bf_cast_unsigned(type, x) ((__unsigned_scalar_typeof(type))(x)) =20 -#define __BF_FIELD_CHECK(_mask, _reg, _val, _pfx) \ +#define __BF_FIELD_CHECK_MASK(_mask, _val, _pfx) \ ({ \ BUILD_BUG_ON_MSG(!__builtin_constant_p(_mask), \ _pfx "mask is not constant"); \ @@ -69,13 +69,33 @@ ~((_mask) >> __bf_shf(_mask)) & \ (0 + (_val)) : 0, \ _pfx "value too large for the field"); \ - BUILD_BUG_ON_MSG(__bf_cast_unsigned(_mask, _mask) > \ - __bf_cast_unsigned(_reg, ~0ull), \ - _pfx "type of reg too small for mask"); \ __BUILD_BUG_ON_NOT_POWER_OF_2((_mask) + \ (1ULL << __bf_shf(_mask))); \ }) =20 +#define __BF_FIELD_CHECK_REG(mask, reg, pfx) \ + BUILD_BUG_ON_MSG(__bf_cast_unsigned(mask, mask) > \ + __bf_cast_unsigned(reg, ~0ull), \ + pfx "type of reg too small for mask") + +#define __BF_FIELD_CHECK(mask, reg, val, pfx) \ + ({ \ + __BF_FIELD_CHECK_MASK(mask, val, pfx); \ + __BF_FIELD_CHECK_REG(mask, reg, pfx); \ + }) + +#define __FIELD_PREP(mask, val, pfx) \ + ({ \ + __BF_FIELD_CHECK_MASK(mask, val, pfx); \ + ((typeof(mask))(val) << __bf_shf(mask)) & (mask); \ + }) + +#define __FIELD_GET(mask, reg, pfx) \ + ({ \ + __BF_FIELD_CHECK_MASK(mask, 0U, pfx); \ + (typeof(mask))(((reg) & (mask)) >> __bf_shf(mask)); \ + }) + /** * FIELD_MAX() - produce the maximum value representable by a field * @_mask: shifted mask defining the field's length and position @@ -112,8 +132,8 @@ */ #define FIELD_PREP(_mask, _val) \ ({ \ - __BF_FIELD_CHECK(_mask, 0ULL, _val, "FIELD_PREP: "); \ - ((typeof(_mask))(_val) << __bf_shf(_mask)) & (_mask); \ + __BF_FIELD_CHECK_REG(_mask, 0ULL, "FIELD_PREP: "); \ + __FIELD_PREP(_mask, _val, "FIELD_PREP: "); \ }) =20 #define __BF_CHECK_POW2(n) BUILD_BUG_ON_ZERO(((n) & ((n) - 1)) !=3D 0) @@ -152,8 +172,8 @@ */ #define FIELD_GET(_mask, _reg) \ ({ \ - __BF_FIELD_CHECK(_mask, _reg, 0U, "FIELD_GET: "); \ - (typeof(_mask))(((_reg) & (_mask)) >> __bf_shf(_mask)); \ + __BF_FIELD_CHECK_REG(_mask, _reg, "FIELD_GET: "); \ + __FIELD_GET(_mask, _reg, "FIELD_GET: "); \ }) =20 /** --=20 2.43.0 From nobody Thu Dec 18 21:45:12 2025 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 66A612010EE; Thu, 6 Nov 2025 13:36: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=1762436207; cv=none; b=CDcQPhiISrkBmnjYtWjUfw3dfPExC8P+xaWMwoI5+QkuS1IQCVU+0sLSTbkt4tNMkxa2Lrt+ko0MfDfR/KWcPaX/tKcqugRqAQfk5B88ud/JqzIpqearTyYW6HHtuGIk86quhC1gSZot9WgbyWHDIGplcIjLdKvgn5gTw1d/6Pg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762436207; c=relaxed/simple; bh=gjqu9tecVqJuGLXjNzJWqdP0H0ejNhLevHydt0XGr+I=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=IxZ/J14+g6BLagJZL1rOmdRxhHRK5nDIwnFyCFhOWMaJ03G7DKJnYB+0UvJ1VC6Zikk/3dKJHPLRwjodNrVQL9xezqpd1pkxkKGkrwXtopCKbr/BK5Af8odX47kM3BG7fvY8A5RZYo07QVOd4XBW31+JkJWX+2oAgJZBI4fDlh4= 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 10BC4C4CEF7; Thu, 6 Nov 2025 13:36:36 +0000 (UTC) From: Geert Uytterhoeven To: Yury Norov , 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 , 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 , Nathan Chancellor , Nick Desaulniers , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra 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-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven , Jonathan Cameron , Andy Shevchenko Subject: [PATCH v6 13/26] bitfield: Add non-constant field_{prep,get}() helpers Date: Thu, 6 Nov 2025 14:34:01 +0100 Message-ID: <62a5058e460129155e4e7539e37140bd0f0d4abc.1762435376.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-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 Reviewed-by: Yury Norov (NVIDIA) --- v6: - Align \, - Add Return sections to kerneldoc, - Add Reviewed-by, - Document field_{get,prep} in top comment block, - Use less-checking __FIELD_{GET,PREP}() to avoid build issues with clang and W=3D1: https://lore.kernel.org/all/202510281335.UpSLYJG9-lkp@intel.com https://lore.kernel.org/all/202510281414.DnejZh4n-lkp@intel.com https://lore.kernel.org/all/202510281304.RK3J3c3t-lkp@intel.com 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 | 59 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 59 insertions(+) diff --git a/include/linux/bitfield.h b/include/linux/bitfield.h index bf8e0ae4b5b41038..f92e18c9629a59c6 100644 --- a/include/linux/bitfield.h +++ b/include/linux/bitfield.h @@ -17,6 +17,7 @@ * FIELD_{GET,PREP} macros take as first parameter shifted mask * from which they extract the base mask and shift amount. * Mask must be a compilation time constant. + * field_{get,prep} are variants that take a non-const mask. * * Example: * @@ -240,4 +241,62 @@ __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 + * + * Return: field value masked and shifted to its final destination + * + * 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: ") \ + : __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 + * + * Return: extracted field value + * + * 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: ") \ + : __field_get(mask, reg)) + #endif --=20 2.43.0 From nobody Thu Dec 18 21:45:12 2025 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 ED7BB32C93A; Thu, 6 Nov 2025 13:36: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=1762436218; cv=none; b=secNo25V7HHTK1kk/iv+p5EpDmVob8pFAYhfNjoURAnzVEKvoE5YqPEyKgbRojKdUOZNZUBmL9Skm/4R7igaor2GUopUSELPKtyTsKDheZdhf+O583gzaDjLQ2k3oIJTLxnywygMMWtI7nNVdSqKB4DfCtuTl2qUuG00uGbggsk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762436218; c=relaxed/simple; bh=C3OhvAoJgP+fek32MaXzGq/UWD7zvuIhAhJ69zVWPAc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=iDiQsrCcbSqPoVwY4y8Lcln5S63O1oApEqn/Nztmb1fLg6UX5DZmGp+FqxoJDCcS6KTMxwytTvPW5dTp1OzrQQtrZ9e+ogRHI8DjVG0L9N1louGKNZOiUEukww7ENFUWS3TEITlfAZ0wo44EJe6Q7bGLdqEqi46EGiphO2KFsqE= 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 B14A4C4CEFB; Thu, 6 Nov 2025 13:36:47 +0000 (UTC) From: Geert Uytterhoeven To: Yury Norov , 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 , 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 , Nathan Chancellor , Nick Desaulniers , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra 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-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH v6 14/26] clk: at91: Convert to common field_{get,prep}() helpers Date: Thu, 6 Nov 2025 14:34:02 +0100 Message-ID: <7414c080bbacc3c5be00c0eec4f5cbca386acaf3.1762435376.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: Alexandre Belloni Acked-by: Claudiu Beznea Acked-by: Stephen Boyd --- v6: - No changes, 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 Thu Dec 18 21:45:12 2025 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 65D9C7494; Thu, 6 Nov 2025 13:37: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=1762436228; cv=none; b=NsKoebaKgDV8jnVcAJJnVs7w/LLvBRGr9V6cW5AI24isA5JwmH8AA0Y38ONtHMuWbLWHiGr/2qCiPLwulnjIFVw10LHBG1In6AAlsCgdWDy96b5WIde1oEWoZSWEDDSPjOQyK6xasnXRVGkhxIWNC3OBUwGVQmj0MqUkqNBiEJs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762436228; c=relaxed/simple; bh=zAJhfxiHAI6uxLsH2VSXq1YR9iFMcVHBRn+PnPZskp4=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bBDG7lIGfzSpxrCXLCG1VdCR1swA97NzkEm5HVl1MKcLimf7+wsvIIE3nRWuDq4OzFGlp4k43mqLhld9nWuvV7BkQQfuvmxzXMAIsG+Sw8gQl9y191S+9ZxayLQ/MRzuHTZqovZ0razGXXQzRL3sYBiqlkY4MxQoEshRFVwiAvk= 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 056E1C4CEF7; Thu, 6 Nov 2025 13:36:57 +0000 (UTC) From: Geert Uytterhoeven To: Yury Norov , 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 , 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 , Nathan Chancellor , Nick Desaulniers , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra 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-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH v6 15/26] crypto: qat - convert to common field_get() helper Date: Thu, 6 Nov 2025 14:34:03 +0100 Message-ID: <950aacf2c39845b20f33696fe178a435140f28fe.1762435376.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 --- v6: - Add Acked-by, 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 Thu Dec 18 21:45:12 2025 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 58C13340261; Thu, 6 Nov 2025 13:37:18 +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=1762436238; cv=none; b=evsxkXFllr57dfzT8x+odgWd88nRCgZ6LAyBP/d3PYtWbU8QBoU95J89rJrAxorXHY3CwcTqHwjx3e31m6CXRegBQ6tVghXvc/RrDkyAis/GUitXLDBc93rqBAnXa+I2O1xZ8XJdTrnvMz3LqNOOVRaNEEbkjVLqWA9Fzc0KXPU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762436238; c=relaxed/simple; bh=IMIlqrKP0L4jm5kQtF0MH5BvOeiS8fVQ/S73c1PPKZM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=lodZqvTjvH37Y4dfl/gGFx7Tq0v6zIYj8kflxp8PPhq6ifVMqjIYV07eFcZGNW9S21tHkixvz9Y0C+B6cmeRODueX4NtBkk0r7vt8U5OWqRxybFrG7wLTP4hAuPV93GQFazA2J+E1Umfp+XgsNwA4UtDrjPgwti7QYBtjwg6bjQ= 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 57804C4CEFB; Thu, 6 Nov 2025 13:37:08 +0000 (UTC) From: Geert Uytterhoeven To: Yury Norov , 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 , 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 , Nathan Chancellor , Nick Desaulniers , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra 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-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH v6 16/26] EDAC/ie31200: Convert to common field_get() helper Date: Thu, 6 Nov 2025 14:34:04 +0100 Message-ID: <56ec4d8e40d24ead68a14948cbbe122c5aaa1405.1762435376.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 Reviewed-by: Qiuxu Zhuo --- v6: - No changes, 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 Thu Dec 18 21:45:12 2025 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 9F196320CC2; Thu, 6 Nov 2025 13:37:28 +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=1762436248; cv=none; b=tuPExMQonZypPYtfKFx4OnMp1bsLSKxKmc930MxXalVffaJYXD/J80vgTplvkhfazrzU75+BdB6M0wVjBx4/Mdbt4WJe1oZSamAtt/v8hK+0jTo8UVzg139DnlJkWyEsC8bbcAZANqfHdrFeXN7gh+NfoGfQx3GFiDPzqj6RCvs= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762436248; c=relaxed/simple; bh=34MepyNO2jdLZLz3Q38/z3QwTUhyg9G1oeU6SrlHRB0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Cb8BEjXLL0nV8nbIeEw7VTTjMqETPHIFZnXrWN3MKzh4LPSz5llgX8l7zonFjWXXwicPryjhsoFWnkZ/ow/ZsC+2eE9fOvUB/wMnoyB2w+gKN2oq1e2ljtCJkTnPUttL1X/qWUUCxRrmieKcf02i5Xrgd/ITjNUlby6iHVSQtRI= 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 A4618C4CEFB; Thu, 6 Nov 2025 13:37:18 +0000 (UTC) From: Geert Uytterhoeven To: Yury Norov , 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 , 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 , Nathan Chancellor , Nick Desaulniers , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra 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-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH v6 17/26] gpio: aspeed: Convert to common field_{get,prep}() helpers Date: Thu, 6 Nov 2025 14:34:05 +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 --- v6: - No changes, 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 Thu Dec 18 21:45:12 2025 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 5B44C32C329; Thu, 6 Nov 2025 13:37:39 +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=1762436259; cv=none; b=LQAXcqeUKkJwn13/Dyjn300Wjx3h4W6c6dP5I0d/8UMpwyJ+jGHaJOAEV6SACQJKxNdPpO+tTMiSj5P2bm7Ei+Adlds/A3HPTK+Gxkp6h/AfbAXV+9mg5xB12lD/fn5fumAmWPTyyPsb6+cODwDtu0tjeWnm/DdicAEyH9xm+RA= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762436259; c=relaxed/simple; bh=ZNy76KJ20NwyTajsiOvwW1vaEd5b4EPjtpWn4DyG6Qc=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=iXqaAsKH7+WlHPDNMzPSvrZFMKVnBGtys/CxXrVRvV3bYqq0+KWjayoa1DyqeNAmYAbliR3o6YyJpv/mX1laB7dJhrancWBEAY3HxFdeRL8mwoIZieubTKttqF2czxGgY8/MJKludTWWemyRsM/O2/YIOoIGEu6xH01VhJ+DvgU= 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 E9F99C19421; Thu, 6 Nov 2025 13:37:28 +0000 (UTC) From: Geert Uytterhoeven To: Yury Norov , 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 , 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 , Nathan Chancellor , Nick Desaulniers , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra 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-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven , Jonathan Cameron Subject: [PATCH v6 18/26] iio: dac: Convert to common field_prep() helper Date: Thu, 6 Nov 2025 14:34:06 +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 --- v6: - No changes, 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 Thu Dec 18 21:45:12 2025 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 D092332E695; Thu, 6 Nov 2025 13:37: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=1762436269; cv=none; b=PSckF+DnBk9bU9fN8YrPzuv5IqyTtRoEPqd7k+heCpENFMygmq1+X+uMPisOJfcIhTuutrSem9xEuYyMHSAqmYOh5Mk0ylGf6u+5V9OI+1kWwF4zl38LtoAKPsNriYUZSc2Tc+YgrjxRGM5jmZV87of9VbTJ37ac9gccRTFGl/Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762436269; c=relaxed/simple; bh=xVbhDHaHzmPRP7lrfj89FekJo4CRr58UcvA57BSXGAE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=tP8UWURELJZC186YpHgfTj8rD3gyboGezaXqA6WeUxbeMtvmhw2bm3VF7v2NXaCJ/ka757op2opZUiLWLzzGhY8GXwgIPfxGz1JOWuNq7MSgXmjZvYBgxks3/YehE6jbYAvZ/ueVySl0q2rNFPztWyNxo2y+ynH0iGzMhguhUf0= 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 6BA7CC116C6; Thu, 6 Nov 2025 13:37:39 +0000 (UTC) From: Geert Uytterhoeven To: Yury Norov , 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 , 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 , Nathan Chancellor , Nick Desaulniers , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra 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-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven , Jonathan Cameron Subject: [PATCH v6 19/26] iio: mlx90614: Convert to common field_{get,prep}() helpers Date: Thu, 6 Nov 2025 14:34:07 +0100 Message-ID: <007e72b33aee33726e161acd9d92f801b7051838.1762435376.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 --- v6: - No changes, 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 Thu Dec 18 21:45:12 2025 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 3AB01330D42; Thu, 6 Nov 2025 13:37:59 +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=1762436281; cv=none; b=MUn59viP01JA65SpC7S9jkNihBBlsd2TVBrnFBpbattXtXnrOJeAwSYkXijrjw/S5bm0mrKu5/AE2aWhxS8/hEeOptYR39y2LZplz91mtXpeUeDDpgQIIkfuGa8KMrBd77pTksTf87AdDvv7pnyVKyZzJqbnVia1W6WhXuv0cZ8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762436281; c=relaxed/simple; bh=AhOwMmnnFq3LQdG7hWqbYI0/NPCiOaL7k4eT2Yd3yVk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Uc/5U8yTqAABs/WzxvfhI9HVaJU0wZdVz9tIoJxcdP8YxrXKAFyz8aUbTEo+Yo8QlVVve60EQNCNKj9FR63Q6XnDyVJRgPwDgL6YwDjX0P5ocRN4E39aCjcl0iPf1zws3OdQDmWtdIuywaDb/75+s8OuReFefnvQF4ygqw9iYE0= 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 DF761C16AAE; Thu, 6 Nov 2025 13:37:49 +0000 (UTC) From: Geert Uytterhoeven To: Yury Norov , 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 , 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 , Nathan Chancellor , Nick Desaulniers , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra 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-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH v6 20/26] pinctrl: ma35: Convert to common field_{get,prep}() helpers Date: Thu, 6 Nov 2025 14:34:08 +0100 Message-ID: <2e7d92c7b668ae1f669177a47928548eceb9351b.1762435376.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 Reviewed-by: Linus Walleij --- v6: - Add Reviewed-by, 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 Thu Dec 18 21:45:12 2025 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 8B3A9330B27; Thu, 6 Nov 2025 13:38:10 +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=1762436290; cv=none; b=C50O4utiHDh6fFetnjA/wzlKY0/Oyj3nvN/RDuoMItHgruEM/jhA9S+BBOLopaWlA2KpTrWnY/bYav+oJ7dlIn8V2eKAutkXIy/vR8Tb+/sHQcYb1ADidVAcB3uIgChieQWZ11DT8EB/LVnBQmvhXdQG+8Kc70l/Aju2w+2oSxk= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762436290; c=relaxed/simple; bh=vmZCAANcJWTKqzgct4Lcnq3ccQofCM8xLZB3E7QcKaU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=fp3zGf9gvu0AYGkcZTDprilZiNXO3tL/JsE+Tl7RSqYPRIreHV2ZAwzTP+CxHn9DXBxJuICTtZF7aDcYAbbg7QbS/spmyfGgqsHQaY/GD16cKpek86R34zXpAhn1l0qYLlJk3Yfk7vxQf55rozWQng5+CRFeyGV9UiUlbv5Fouk= 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 360D9C4CEFB; Thu, 6 Nov 2025 13:38:00 +0000 (UTC) From: Geert Uytterhoeven To: Yury Norov , 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 , 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 , Nathan Chancellor , Nick Desaulniers , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra 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-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH v6 21/26] soc: renesas: rz-sysc: Convert to common field_get() helper Date: Thu, 6 Nov 2025 14:34:09 +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() macro, in favor of the globally available variant from . Signed-off-by: Geert Uytterhoeven Reviewed-by: Claudiu Beznea --- v6: - No changes, 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 Thu Dec 18 21:45:12 2025 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 050D0308F1E; Thu, 6 Nov 2025 13:38: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=1762436301; cv=none; b=LhUYmratzkJyaGCLOpcpuiAUEVBijYO6mtOgK1K4Wq9lpCBB9mLqWlApWiIGXa5fqetc0UrZbZlJ3+qM7Fvgk9zqNAfnXiRnkQVRxWcIzU6tjp1WOhJSIcwhsFkuheWvt9k7GdkAnPcVoexyiOVAwW0k6hGSv2r5itL3l/GSIHE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762436301; c=relaxed/simple; bh=wy8+4Flzjp55ON8bxAxMMESfFJFFVAIXTzBA9EA25hM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=psJPQmJFsgjd1xn5G1aRzyFs5hzwwcIZVd1jz8ICAgc2P+9GkbG0ufqis7PyyZuiMkwuXLFHKUNyE823P/hu8NGjXTXzPdNHAqika3U3fxEqPOax86Eh79EobS6Aiuk8w5Hg3DUci6viRX648da/Pt0vVMlFuez+ZpBpIz/S2sU= 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 7DDC1C4CEF7; Thu, 6 Nov 2025 13:38:10 +0000 (UTC) From: Geert Uytterhoeven To: Yury Norov , 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 , 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 , Nathan Chancellor , Nick Desaulniers , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra 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-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven , Takashi Iwai Subject: [PATCH v6 22/26] ALSA: usb-audio: Convert to common field_{get,prep}() helpers Date: Thu, 6 Nov 2025 14:34:10 +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: Takashi Iwai --- v6: - Add Acked-by, 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 Thu Dec 18 21:45:12 2025 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 4FE84345CB9; Thu, 6 Nov 2025 13:38:30 +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=1762436311; cv=none; b=kyE3hhwrElVLTbkfmz6/NvHfrKbkLPIh0YSVh2KuKSw644YEiwWXWeG5TkZx4aBDeLBp6DMyT3vnZIzpnEe4IfF81ZBT/CliGWCnKoxjqydDAye5WImKH45SkU915oT9iUTPYTbUXDzy9h4T5XVd/QsmIQZ5eOw5X46z/Tk2y4Q= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762436311; c=relaxed/simple; bh=h0rHqH+kYzVxrybUnI8yqZLSmOFRn1uxRtWZHjr40/M=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=sh8hB6UAD5Mknd7ZwwcHV1QZ0TZLsp0Y2390r9KitZ8ASyrAfhOAkyCaFfh+d5JUOp0wMZxDORWx1ZnjEkPRKPzw6qN+ml1OEKXqIGB2251mJI/qxbYSjETuqyon6S6E4MG679wrG9OPzP1M5DmW3MAWJKgGLQUqvMptqEW80Ks= 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 E7E0CC19421; Thu, 6 Nov 2025 13:38:20 +0000 (UTC) From: Geert Uytterhoeven To: Yury Norov , 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 , 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 , Nathan Chancellor , Nick Desaulniers , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra 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-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH -next v6 23/26] iio: imu: smi330: Convert to common field_{get,prep}() helpers Date: Thu, 6 Nov 2025 14:34:11 +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 --- v6: - No changes, 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 Thu Dec 18 21:45:12 2025 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 71F6016132F; Thu, 6 Nov 2025 13:38:41 +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=1762436321; cv=none; b=UrAOnvwDOEv30isYn7OfI4gmQxu0i2heZjBCqWR+e5EY/t9ZpD98ldAySCCEN+VWYiYYYFz86gICPnRQXV/UERTBdEsqhAoybw+Tdzgmmr4A+Bmr0Qu92gTiQCqx/mGKJVx2lO/uyj6XUDprjwHh5SEy92P2yDle0hRk5RBpTPE= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762436321; c=relaxed/simple; bh=yKdzKCYGKy5zOlvfoqXNMCUqqkhzFI4Iv8OE29SGHUg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=d7erHoUF4p3v772PGGUM/N/3MvOMCQqzR1MQYKhXY5/Sf/ssnup61dqrD+kPcHY3Ygr06XFfTxKgLG6xHmWD2w5e56oWso5HX7awKrhduMRCo+He2gq9z+596jGox3dq2wUtKM2fL9S6OYPALO1y7V57KTBEREW9ZfKP44D5Sfo= 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 4035EC4CEF7; Thu, 6 Nov 2025 13:38:31 +0000 (UTC) From: Geert Uytterhoeven To: Yury Norov , 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 , 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 , Nathan Chancellor , Nick Desaulniers , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra 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-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH -next v6 24/26] mtd: rawnand: sunxi: Convert to common field_{get,prep}() helpers Date: Thu, 6 Nov 2025 14:34:12 +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: Miquel Raynal --- v6: - New. --- drivers/mtd/nand/raw/sunxi_nand.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/drivers/mtd/nand/raw/sunxi_nand.c b/drivers/mtd/nand/raw/sunxi= _nand.c index 9dcdc93734cbff39..e66adfcca7cd63fb 100644 --- a/drivers/mtd/nand/raw/sunxi_nand.c +++ b/drivers/mtd/nand/raw/sunxi_nand.c @@ -29,12 +29,6 @@ #include #include =20 -/* non compile-time field get/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 NFC_REG_CTL 0x0000 #define NFC_REG_ST 0x0004 #define NFC_REG_INT 0x0008 --=20 2.43.0 From nobody Thu Dec 18 21:45:12 2025 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 820333168E5; Thu, 6 Nov 2025 13:38:51 +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=1762436331; cv=none; b=J92WnLZC5ijXw3zWEoJba5YY9wggMONpnEQ3JqIPb3DdA8XQfZ10nEo80PlL9pYGgOpGAYZYfHjMUz+0PLim4Ph7ZQ3952EJqpkKu3JB365yQgD2L9al+rP35lB2R+YivHwF+jAkEnRAXVVDT3GOL+xTJ/kwxAgrufDyoZqBfeo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762436331; c=relaxed/simple; bh=XqGCl8KuYf3jtM8h5pr9hPO9eQg6QKXoRXzbBzQ+2so=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=YnNl69Pb/5EJEekso10f+vexGSHbb+Y5wCAuUP9Is71ffTaeW6VptcNQtT9KcyAD/Q/LBWquaYHNxR8Pm/3jXkOWQSvEig7O/zZnScIm9O5DOD7sFIXZ5NJew6EJwmYVv12yB/jrY/TCHf16N4W0uOx/eRhAYhWg+LwYu0TIc6E= 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 82CEBC19421; Thu, 6 Nov 2025 13:38:41 +0000 (UTC) From: Geert Uytterhoeven To: Yury Norov , 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 , 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 , Nathan Chancellor , Nick Desaulniers , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra 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-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH v6 25/26] clk: renesas: Use bitfield helpers Date: Thu, 6 Nov 2025 14:34:13 +0100 Message-ID: <8014f3aaf8f55f41cb8799b682737882cd1c1112.1762435376.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 Reviewed-by: Stephen Boyd --- v6: - No changes, 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 Thu Dec 18 21:45:12 2025 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 3F7313370F5; Thu, 6 Nov 2025 13:39:01 +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=1762436342; cv=none; b=T+HzJRWRP05YxWdGixF8WM+Y1c3YJ0eZPchpar/NTv6ygcrGCESRB4UTq+RZxfS7cu05BJBgd7Z+MxNVj7eeNIqVl0oH/283gTIqHDZeyQeowe0MjOqkcMyhmztsJdcsZmpyExk1rGhFjODIq3nDCXgxia07YkvbSHmidTVSslw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762436342; c=relaxed/simple; bh=WYHa35/WSbF7l7X/7zby0sd49RpvAMPpddrSd2lq3dI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=BzNntgnc82R8Vd2YIlNkvOFBfpckunkOhYjLoqOir9S6F42khi9qXRwBQJ1+Es59jx3mIaKGiTN1TcCN1J+ZPR/jgBZWJOR9GOBzEDpFly2BKsAlv+GG4opsH7cYfZBWVSbx6aSPZs43DVr2AaTWJNKBG1sovXKqw2KRtNyTkxk= 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 CC7F0C19422; Thu, 6 Nov 2025 13:38:51 +0000 (UTC) From: Geert Uytterhoeven To: Yury Norov , 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 , 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 , Nathan Chancellor , Nick Desaulniers , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra 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-mtd@lists.infradead.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH v6 26/26] soc: renesas: Use bitfield helpers Date: Thu, 6 Nov 2025 14:34:14 +0100 Message-ID: <4316b09f7e7a4fa2ac0c5d05c3dbb25547969833.1762435376.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() helper, instead of open-coding the same operation. Signed-off-by: Geert Uytterhoeven --- v6: - No changes, 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