public inbox for linux-next@vger.kernel.org 
 help / color / mirror / Atom feed
From: Stephen Rothwell <sfr@canb•auug.org.au>
To: Yury Norov <yury.norov@gmail•com>,
	Miquel Raynal <miquel.raynal@bootlin•com>,
	Boris Brezillon <boris.brezillon@collabora•com>
Cc: Richard Genoud <richard.genoud@bootlin•com>,
	Geert Uytterhoeven <geert+renesas@glider•be>,
	Linux Kernel Mailing List <linux-kernel@vger•kernel.org>,
	Linux Next Mailing List <linux-next@vger•kernel.org>
Subject: linux-next: build failure after merge of the bitmap tree
Date: Tue, 25 Nov 2025 18:24:42 +1100	[thread overview]
Message-ID: <20251125182442.49ddb53a@canb.auug.org.au> (raw)

[-- Attachment #1: Type: text/plain, Size: 5040 bytes --]

Hi all,

After merging the bitmap tree, today's linux-next build (x86_64
allmodconfig) failed like this:

drivers/mtd/nand/raw/sunxi_nand.c:33:9: error: "field_get" redefined [-Werror]
   33 | #define field_get(_mask, _reg) (((_reg) & (_mask)) >> (ffs(_mask) - 1))
      |         ^~~~~~~~~
In file included from include/linux/fortify-string.h:5,
                 from include/linux/string.h:386,
                 from include/linux/bitmap.h:13,
                 from include/linux/cpumask.h:11,
                 from arch/x86/include/asm/paravirt.h:21,
                 from arch/x86/include/asm/cpuid/api.h:57,
                 from arch/x86/include/asm/processor.h:19,
                 from include/linux/sched.h:13,
                 from include/linux/ratelimit.h:6,
                 from include/linux/dev_printk.h:16,
                 from include/linux/device.h:15,
                 from include/linux/dma-mapping.h:5,
                 from drivers/mtd/nand/raw/sunxi_nand.c:16:
include/linux/bitfield.h:298:9: note: this is the location of the previous definition
  298 | #define field_get(mask, reg)                                            \
      |         ^~~~~~~~~
drivers/mtd/nand/raw/sunxi_nand.c:34:9: error: "field_prep" redefined [-Werror]
   34 | #define field_prep(_mask, _val) (((_val) << (ffs(_mask) - 1)) & (_mask))
      |         ^~~~~~~~~~
include/linux/bitfield.h:278:9: note: this is the location of the previous definition
  278 | #define field_prep(mask, val)                                           \
      |         ^~~~~~~~~~
cc1: all warnings being treated as errors

Caused by commit

  c1c6ab80b25c ("bitfield: Add non-constant field_{prep,get}() helpers")

interacting with commits

  d21b4338159f ("mtd: rawnand: sunxi: introduce ecc_mode_mask in sunxi_nfc_caps")
  6fc2619af1eb ("mtd: rawnand: sunxi: rework pattern found registers")

from the nand tree.

I have applied the following hack for today.

From: Stephen Rothwell <sfr@canb•auug.org.au>
Date: Tue, 25 Nov 2025 17:47:46 +1100
Subject: [PATCH] fix up for "bitfield: Add non-constant field_{prep,get}()
 helpers"

interacting with commits

  d21b4338159f ("mtd: rawnand: sunxi: introduce ecc_mode_mask in sunxi_nfc_caps")
  6fc2619af1eb ("mtd: rawnand: sunxi: rework pattern found registers")

from the nand tree.

Signed-off-by: Stephen Rothwell <sfr@canb•auug.org.au>
---
 drivers/mtd/nand/raw/sunxi_nand.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/mtd/nand/raw/sunxi_nand.c b/drivers/mtd/nand/raw/sunxi_nand.c
index 031ab651c5a8..b940eb5cf79a 100644
--- a/drivers/mtd/nand/raw/sunxi_nand.c
+++ b/drivers/mtd/nand/raw/sunxi_nand.c
@@ -30,8 +30,8 @@
 #include <linux/reset.h>
 
 /* non compile-time field get/prep */
-#define field_get(_mask, _reg) (((_reg) & (_mask)) >> (ffs(_mask) - 1))
-#define field_prep(_mask, _val) (((_val) << (ffs(_mask) - 1)) & (_mask))
+#define sunxi_field_get(_mask, _reg) (((_reg) & (_mask)) >> (ffs(_mask) - 1))
+#define sunxi_field_prep(_mask, _val) (((_val) << (ffs(_mask) - 1)) & (_mask))
 
 #define NFC_REG_CTL		0x0000
 #define NFC_REG_ST		0x0004
@@ -185,7 +185,7 @@
 #define NFC_RANDOM_EN(nfc)	(nfc->caps->random_en_mask)
 #define NFC_RANDOM_DIRECTION(nfc) (nfc->caps->random_dir_mask)
 #define NFC_ECC_MODE_MSK(nfc)	(nfc->caps->ecc_mode_mask)
-#define NFC_ECC_MODE(nfc, x)	field_prep(NFC_ECC_MODE_MSK(nfc), (x))
+#define NFC_ECC_MODE(nfc, x)	sunxi_field_prep(NFC_ECC_MODE_MSK(nfc), (x))
 /* RANDOM_PAGE_SIZE: 0: ECC block size  1: page size */
 #define NFC_A23_RANDOM_PAGE_SIZE	BIT(11)
 #define NFC_H6_RANDOM_PAGE_SIZE	BIT(7)
@@ -879,7 +879,7 @@ static void sunxi_nfc_set_user_data_len(struct sunxi_nfc *nfc,
 	val = readl(nfc->regs + NFC_REG_USER_DATA_LEN(nfc, step));
 
 	val &= ~NFC_USER_DATA_LEN_MSK(step);
-	val |= field_prep(NFC_USER_DATA_LEN_MSK(step), i);
+	val |= sunxi_field_prep(NFC_USER_DATA_LEN_MSK(step), i);
 	writel(val, nfc->regs + NFC_REG_USER_DATA_LEN(nfc, step));
 }
 
@@ -992,7 +992,7 @@ static int sunxi_nfc_hw_ecc_read_chunk(struct nand_chip *nand,
 	*cur_off = oob_off + ecc->bytes + USER_DATA_SZ;
 
 	pattern_found = readl(nfc->regs + nfc->caps->reg_pat_found);
-	pattern_found = field_get(NFC_ECC_PAT_FOUND_MSK(nfc), pattern_found);
+	pattern_found = sunxi_field_get(NFC_ECC_PAT_FOUND_MSK(nfc), pattern_found);
 
 	ret = sunxi_nfc_hw_ecc_correct(nand, data, oob_required ? oob : NULL, 0,
 				       readl(nfc->regs + NFC_REG_ECC_ST),
@@ -1121,7 +1121,7 @@ static int sunxi_nfc_hw_ecc_read_chunks_dma(struct nand_chip *nand, uint8_t *buf
 
 	status = readl(nfc->regs + NFC_REG_ECC_ST);
 	pattern_found = readl(nfc->regs + nfc->caps->reg_pat_found);
-	pattern_found = field_get(NFC_ECC_PAT_FOUND_MSK(nfc), pattern_found);
+	pattern_found = sunxi_field_get(NFC_ECC_PAT_FOUND_MSK(nfc), pattern_found);
 
 	for (i = 0; i < nchunks; i++) {
 		int data_off = i * ecc->size;
-- 
2.52.0

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

             reply	other threads:[~2025-11-25  7:24 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-25  7:24 Stephen Rothwell [this message]
2025-11-25  8:05 ` linux-next: build failure after merge of the bitmap tree Geert Uytterhoeven
2025-11-25  8:31   ` Miquel Raynal
2025-11-25  8:37     ` Geert Uytterhoeven
2025-11-25 14:44       ` Yury Norov
2025-11-25 14:55         ` Miquel Raynal
2025-11-25  8:53     ` Miquel Raynal
2025-11-28  8:17   ` Miquel Raynal
  -- strict thread matches above, loose matches on Subject: below --
2026-04-30  9:11 Thierry Reding
2026-03-24 15:11 Mark Brown
2026-03-24 17:56 ` Yury Norov
2025-02-18  5:07 Stephen Rothwell
2025-02-18 10:35 ` Beata Michalska
2025-02-18 13:49   ` Stephen Rothwell
2025-02-18 14:10     ` Catalin Marinas
2025-02-18 14:16       ` Yury Norov
2025-02-18 18:23         ` Catalin Marinas
2025-02-18 19:28           ` Beata Michalska
2025-02-18 19:44             ` Catalin Marinas
2024-05-08  6:27 Stephen Rothwell
2024-05-08 13:24 ` Kuan-Wei Chiu
2024-05-08 22:18   ` Yury Norov
2023-10-20  4:49 Stephen Rothwell
2023-10-19  6:01 Stephen Rothwell
2023-10-19 15:58 ` Yury Norov
2023-10-20  4:24   ` Yury Norov
2023-10-20  4:51     ` Stephen Rothwell
2023-10-20 12:33       ` Yury Norov
2023-11-02 11:41         ` Alexander Lobakin
2022-09-26 23:53 broonie
2022-09-27  0:37 ` Yury Norov
2022-09-27 18:56   ` Mark Brown
2022-09-20  8:08 Stephen Rothwell
2022-09-20 14:49 ` Yury Norov
2022-07-27 10:29 Stephen Rothwell
2022-07-22  9:16 Stephen Rothwell
2022-07-22 19:29 ` Yury Norov
2022-07-15 10:29 Stephen Rothwell
2022-07-08  7:47 Stephen Rothwell
2022-05-02  8:15 Stephen Rothwell
2022-04-19  4:29 Stephen Rothwell

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251125182442.49ddb53a@canb.auug.org.au \
    --to=sfr@canb$(echo .)auug.org.au \
    --cc=boris.brezillon@collabora$(echo .)com \
    --cc=geert+renesas@glider$(echo .)be \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=linux-next@vger$(echo .)kernel.org \
    --cc=miquel.raynal@bootlin$(echo .)com \
    --cc=richard.genoud@bootlin$(echo .)com \
    --cc=yury.norov@gmail$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox