[PATCH -next v6 11/26] mtd: rawnand: sunxi: #undef field_{get,prep}() before local definition

Geert Uytterhoeven geert+renesas at glider.be
Fri Nov 7 00:33:59 AEDT 2025


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 <yury.norov at gmail.com>
Signed-off-by: Geert Uytterhoeven <geert+renesas at glider.be>
---
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 <linux/reset.h>
 
 /* 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
-- 
2.43.0



More information about the Linux-aspeed mailing list