[PATCH v6 05/26] iio: dac: ad3530r: #undef field_prep() before local definition

Geert Uytterhoeven
2025-11-06T13:35:24Z

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 <yury.norov@gmail.com>
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
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

/* Non-constant mask variant of FIELD_PREP() */
+#undef field_prep
#define field_prep(_mask, _val) (((_val) << (ffs(_mask) - 1)) & (_mask))

enum ad3530r_mode {
--
2.43.0