[PATCH v6 16/26] EDAC/ie31200: Convert to common field_get() helper

Geert Uytterhoeven posted 26 patches 1 month, 1 week ago
[PATCH v6 16/26] EDAC/ie31200: Convert to common field_get() helper
Posted by Geert Uytterhoeven 1 month, 1 week ago
Drop the driver-specific field_get() macro, in favor of the globally
available variant from <linux/bitfield.h>.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
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 processors.
  */
 
+#include <linux/bitfield.h>
 #include <linux/module.h>
 #include <linux/init.h>
 #include <linux/pci.h>
@@ -139,10 +140,6 @@
 #define IE31200_CAPID0_DDPCD		BIT(6)
 #define IE31200_CAPID0_ECC		BIT(1)
 
-/* 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 = 1;
-- 
2.43.0
RE: [PATCH v6 16/26] EDAC/ie31200: Convert to common field_get() helper
Posted by Zhuo, Qiuxu 1 month, 1 week ago
> From: Geert Uytterhoeven <geert+renesas@glider.be>
> Sent: Thursday, November 6, 2025 9:34 PM
> To: Yury Norov <yury.norov@gmail.com>; Michael Turquette
> <mturquette@baylibre.com>; Stephen Boyd <sboyd@kernel.org>; Nicolas
> Ferre <nicolas.ferre@microchip.com>; Alexandre Belloni
> <alexandre.belloni@bootlin.com>; Claudiu Beznea
> <claudiu.beznea@tuxon.dev>; Cabiddu, Giovanni
> <giovanni.cabiddu@intel.com>; Herbert Xu <herbert@gondor.apana.org.au>;
> David Miller <davem@davemloft.net>; Linus Walleij
> <linus.walleij@linaro.org>; Bartosz Golaszewski <brgl@bgdev.pl>; Joel Stanley
> <joel@jms.id.au>; Andrew Jeffery <andrew@codeconstruct.com.au>; Crt
> Mori <cmo@melexis.com>; Jonathan Cameron <jic23@kernel.org>; Lars-
> Peter Clausen <lars@metafoo.de>; Jacky Huang <ychuang3@nuvoton.com>;
> Shan-Chun Hung <schung@nuvoton.com>; Rasmus Villemoes
> <linux@rasmusvillemoes.dk>; Jaroslav Kysela <perex@perex.cz>; Takashi Iwai
> <tiwai@suse.com>; Johannes Berg <johannes@sipsolutions.net>; Jakub
> Kicinski <kuba@kernel.org>; Alex Elder <elder@ieee.org>; David Laight
> <david.laight.linux@gmail.com>; Vincent Mailhol
> <mailhol.vincent@wanadoo.fr>; Jason Baron <jbaron@akamai.com>; Borislav
> Petkov <bp@alien8.de>; Luck, Tony <tony.luck@intel.com>; Michael
> Hennerich <Michael.Hennerich@analog.com>; Kim Seer Paller
> <kimseer.paller@analog.com>; Lechner, David <dlechner@baylibre.com>;
> Nuno Sá <nuno.sa@analog.com>; Andy Shevchenko <andy@kernel.org>;
> Richard Genoud <richard.genoud@bootlin.com>; Cosmin Tanislav
> <demonsingur@gmail.com>; Biju Das <biju.das.jz@bp.renesas.com>;
> Jianping Shen <Jianping.Shen@de.bosch.com>; Nathan Chancellor
> <nathan@kernel.org>; Nick Desaulniers <nick.desaulniers+lkml@gmail.com>;
> Miquel Raynal <miquel.raynal@bootlin.com>; Richard Weinberger
> <richard@nod.at>; Vignesh Raghavendra <vigneshr@ti.com>
> 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 <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
> <geert+renesas@glider.be>
> Subject: [PATCH v6 16/26] EDAC/ie31200: Convert to common field_get()
> helper
> 
> Drop the driver-specific field_get() macro, in favor of the globally available
> variant from <linux/bitfield.h>.
> 
> Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>

Good to see the global field_{get,prep}() macros are available for use.
Thanks.

Reviewed-by: Qiuxu Zhuo <qiuxu.zhuo@intel.com>

> [...]