Skip to contentSkip to conversation

net: enetc: fix implicit declaration of function FIELD_PREP

PATCH Applied Wei Fang 3 participants 3 messages May 12, 2025 – May 14, 2025

Subsystems (4)
lore
Share & tools
lore

Wei Fang

author maintainer
#0 lore raw

PATCH 1/1 net: enetc: fix implicit declaration of function FIELD_PREP

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")
---
 drivers/net/ethernet/freescale/enetc/ntmp_private.h | 1 +
 1 file changed, 1 insertion(+)
drivers/net/ethernet/freescale/enetc/ntmp_private.h +1 -0
index 685b388e7ddf..34394e40fddd 100644
@@ -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
Signature · 1 line
2.34.1
maintainer Reviewed-by on v1 1/1
#1 lore raw
Quoted 8 lines · Wei Fang

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,
| ^~~~~~~~~~

Quoted 7 lines

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

Fixes 4701073c3deb ("net: enetc: add initial netc-lib driver to support NTMP")

---

#2 lore raw
In reply to Wei Fang
This patch was applied to netdev/net-next.git (main) by David S. Miller <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (main) by David S. Miller <[email protected]>:

Quoted 9 lines · On Mon, 12 May 2025 14:17:01 +0800 you wrote:

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,
| ^~~~~~~~~~

[...]

Here is the summary with links:
- [net-next] net: enetc: fix implicit declaration of function FIELD_PREP

    https://git.kernel.org/netdev/net-next/c/664bf117a308

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html