]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
net: enetc: fix implicit declaration of function FIELD_PREP
authorWei Fang <wei.fang@nxp.com>
Mon, 12 May 2025 06:17:01 +0000 (14:17 +0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 14 May 2025 08:48:49 +0000 (09:48 +0100)
The kernel test robot reported the following error:

drivers/net/ethernet/freescale/enetc/ntmp.c: In function 'ntmp_fill_request_hdr':
drivers/net/ethernet/freescale/enetc/ntmp.c:203:38: error: implicit
declaration of function 'FIELD_PREP' [-Wimplicit-function-declaration]
203 |         cbd->req_hdr.access_method = FIELD_PREP(NTMP_ACCESS_METHOD,
    |                                      ^~~~~~~~~~

Therefore, add "bitfield.h" to ntmp_private.h to fix this issue.

Fixes: 4701073c3deb ("net: enetc: add initial netc-lib driver to support NTMP")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202505101047.NTMcerZE-lkp@intel.com/
Signed-off-by: Wei Fang <wei.fang@nxp.com>
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/freescale/enetc/ntmp_private.h

index 685b388e7ddf62a191467d4a8fdc02f20110e8cb..34394e40fddd4d5f20d601d0b79233e4a21411e1 100644 (file)
@@ -7,6 +7,7 @@
 #ifndef __NTMP_PRIVATE_H
 #define __NTMP_PRIVATE_H
 
+#include <linux/bitfield.h>
 #include <linux/fsl/ntmp.h>
 
 #define NTMP_EID_REQ_LEN       8