[miquelraynal:macronix/nand-next/spi-nand-cont-read 13/13] drivers/mtd/nand/spi/macronix.c:71:12: error: call to undeclared function 'FIELD_GET'; ISO C99 and later do not support implicit function declarations

kernel test robot
2024-05-20T20:02:45Z

tree: https://github.com/miquelraynal/linux-0day.git macronix/nand-next/spi-nand-cont-read
head: f60b2d314a9c7534714521dfbeca9cff37134d56
commit: f60b2d314a9c7534714521dfbeca9cff37134d56 [13/13] mtd: spi-nand: macronix: Continuous read support
config: hexagon-allmodconfig (https://download.01.org/0day-ci/archive/20240521/202405210358.Lu8w6dPe-lkp@intel.com/config)
compiler: clang version 19.0.0git (https://github.com/llvm/llvm-project fa9b1be45088dce1e4b602d451f118128b94237b)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20240521/202405210358.Lu8w6dPe-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202405210358.Lu8w6dPe-lkp@intel.com/

All errors (new ones prefixed by >>):

In file included from drivers/mtd/nand/spi/macronix.c:10:
In file included from include/linux/mtd/spinand.h:16:
In file included from include/linux/spi/spi.h:17:
In file included from include/linux/scatterlist.h:8:
In file included from include/linux/mm.h:2208:
include/linux/vmstat.h:522:36: warning: arithmetic between different enumeration types ('enum node_stat_item' and 'enum lru_list') [-Wenum-enum-conversion]
522 | return node_stat_name(NR_LRU_BASE + lru) + 3; // skip "nr_"
| ~~~~~~~~~~~ ^ ~~~
In file included from drivers/mtd/nand/spi/macronix.c:10:
In file included from include/linux/mtd/spinand.h:16:
In file included from include/linux/spi/spi.h:17:
In file included from include/linux/scatterlist.h:9:
In file included from arch/hexagon/include/asm/io.h:328:
include/asm-generic/io.h:547:31: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
547 | val = __raw_readb(PCI_IOBASE + addr);
| ~~~~~~~~~~ ^
include/asm-generic/io.h:560:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
560 | val = __le16_to_cpu((__le16 __force)__raw_readw(PCI_IOBASE + addr));
| ~~~~~~~~~~ ^
include/uapi/linux/byteorder/little_endian.h:37:51: note: expanded from macro '__le16_to_cpu'
37 | #define __le16_to_cpu(x) ((__force __u16)(__le16)(x))
| ^
In file included from drivers/mtd/nand/spi/macronix.c:10:
In file included from include/linux/mtd/spinand.h:16:
In file included from include/linux/spi/spi.h:17:
In file included from include/linux/scatterlist.h:9:
In file included from arch/hexagon/include/asm/io.h:328:
include/asm-generic/io.h:573:61: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
573 | val = __le32_to_cpu((__le32 __force)__raw_readl(PCI_IOBASE + addr));
| ~~~~~~~~~~ ^
include/uapi/linux/byteorder/little_endian.h:35:51: note: expanded from macro '__le32_to_cpu'
35 | #define __le32_to_cpu(x) ((__force __u32)(__le32)(x))
| ^
In file included from drivers/mtd/nand/spi/macronix.c:10:
In file included from include/linux/mtd/spinand.h:16:
In file included from include/linux/spi/spi.h:17:
In file included from include/linux/scatterlist.h:9:
In file included from arch/hexagon/include/asm/io.h:328:
include/asm-generic/io.h:584:33: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
584 | __raw_writeb(value, PCI_IOBASE + addr);
| ~~~~~~~~~~ ^
include/asm-generic/io.h:594:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
594 | __raw_writew((u16 __force)cpu_to_le16(value), PCI_IOBASE + addr);
| ~~~~~~~~~~ ^
include/asm-generic/io.h:604:59: warning: performing pointer arithmetic on a null pointer has undefined behavior [-Wnull-pointer-arithmetic]
604 | __raw_writel((u32 __force)cpu_to_le32(value), PCI_IOBASE + addr);
| ~~~~~~~~~~ ^
>> drivers/mtd/nand/spi/macronix.c:71:12: error: call to undeclared function 'FIELD_GET'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
71 | *eccsr = MACRONIX_ECCSR_BF_LAST_PAGE(*eccsr);
| ^
drivers/mtd/nand/spi/macronix.c:13:44: note: expanded from macro 'MACRONIX_ECCSR_BF_LAST_PAGE'
13 | #define MACRONIX_ECCSR_BF_LAST_PAGE(eccsr) FIELD_GET(GENMASK(3, 0), eccsr)
| ^
7 warnings and 1 error generated.

vim +/FIELD_GET +71 drivers/mtd/nand/spi/macronix.c

53
54 static int macronix_get_eccsr(struct spinand_device *spinand, u8 *eccsr)
55 {
56 struct spi_mem_op op = SPI_MEM_OP(SPI_MEM_OP_CMD(0x7c, 1),
57 SPI_MEM_OP_NO_ADDR,
58 SPI_MEM_OP_DUMMY(1, 1),
59 SPI_MEM_OP_DATA_IN(1, eccsr, 1));
60
61 int ret = spi_mem_exec_op(spinand->spimem, &op);
62 if (ret)
63 return ret;
64
65 /*
66 * ECCSR exposes the number of bitflips for the last read page in bits [3:0].
67 * Continuous read compatible chips also expose maximum number of
68 * bitflips for the whole read operation in bits [7:4].
69 */
70 if (!spinand->set_cont_read)
> 71 *eccsr = MACRONIX_ECCSR_BF_LAST_PAGE(*eccsr);
72 else
73 *eccsr = MACRONIX_ECCSR_BF_ACCUMULATED_PAGES(*eccsr);
74
75 return 0;
76 }
77

--
0-DAY CI Kernel Test Service