Skip to contentSkip to conversation

net: ieee802154: Fix compilation error when CONFIG_IEEE802154_NL802154_EXPERIMENTAL is disabled

PATCH Applied Jakub Kicinski 4 participants 4 messages Sep 2, 2022 – Sep 3, 2022

Subsystems (3)
lore
Share & tools
lore

Jakub Kicinski

author maintainer
#0 lore raw

PATCH v2 1/1 net: ieee802154: Fix compilation error when CONFIG_IEEE802154_NL802154_EXPERIMENTAL is disabled

From: Gal Pressman <[email protected]>

When CONFIG_IEEE802154_NL802154_EXPERIMENTAL is disabled,
NL802154_CMD_DEL_SEC_LEVEL is undefined and results in a compilation
error:
net/ieee802154/nl802154.c:2503:19: error: 'NL802154_CMD_DEL_SEC_LEVEL' undeclared here (not in a function); did you mean 'NL802154_CMD_SET_CCA_ED_LEVEL'?

 2503 |  .resv_start_op = NL802154_CMD_DEL_SEC_LEVEL + 1,
      |                   ^~~~~~~~~~~~~~~~~~~~~~~~~~
      |                   NL802154_CMD_SET_CCA_ED_LEVEL

Unhide the experimental commands, having them defined in an enum makes no difference.

Fixes 9c5d03d36251 ("genetlink: start to validate reserved header bytes")

---
v1: /tmp/0001-net-ieee802154-Fix-compilation-error-when-CONFIG_IEE.patch
v2: unhide instead of changing the define used

---
 include/net/nl802154.h | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
include/net/nl802154.h +2 -4
index 145acb8f2509..f5850b569c52 100644
@@ -58,9 +58,6 @@ enum nl802154_commands {
 
 	NL802154_CMD_SET_WPAN_PHY_NETNS,
 
-	/* add new commands above here */
-
-#ifdef CONFIG_IEEE802154_NL802154_EXPERIMENTAL
 	NL802154_CMD_SET_SEC_PARAMS,
 	NL802154_CMD_GET_SEC_KEY,		/* can dump */
 	NL802154_CMD_NEW_SEC_KEY,
@@ -74,7 +71,8 @@ enum nl802154_commands {
 	NL802154_CMD_GET_SEC_LEVEL,		/* can dump */
 	NL802154_CMD_NEW_SEC_LEVEL,
 	NL802154_CMD_DEL_SEC_LEVEL,
-#endif /* CONFIG_IEEE802154_NL802154_EXPERIMENTAL */
+
+	/* add new commands above here */
 
 	/* used to define NL802154_CMD_MAX below */
 	__NL802154_CMD_AFTER_LAST,
Signature · 1 line
2.37.2
maintainer Acked-by on v2 1/1
#1 lore raw

Hello Jabkub.

Quoted 43 lines · Jakub Kicinski

From: Gal Pressman <[email protected]>

When CONFIG_IEEE802154_NL802154_EXPERIMENTAL is disabled,
NL802154_CMD_DEL_SEC_LEVEL is undefined and results in a compilation
error:
net/ieee802154/nl802154.c:2503:19: error: 'NL802154_CMD_DEL_SEC_LEVEL' undeclared here (not in a function); did you mean 'NL802154_CMD_SET_CCA_ED_LEVEL'?

  2503 |  .resv_start_op = NL802154_CMD_DEL_SEC_LEVEL + 1,
       |                   ^~~~~~~~~~~~~~~~~~~~~~~~~~
       |                   NL802154_CMD_SET_CCA_ED_LEVEL

Unhide the experimental commands, having them defined in an enum makes no difference.

Fixes 9c5d03d36251 ("genetlink: start to validate reserved header bytes")

---
v1: /tmp/0001-net-ieee802154-Fix-compilation-error-when-CONFIG_IEE.patch
v2: unhide instead of changing the define used

---
  include/net/nl802154.h | 6 ++----
  1 file changed, 2 insertions(+), 4 deletions(-)
include/net/nl802154.h +0 -3
index 145acb8f2509..f5850b569c52 100644
@@ -58,9 +58,6 @@ enum nl802154_commands {
 
  	NL802154_CMD_SET_WPAN_PHY_NETNS,
 
-	/* add new commands above here */
-
-#ifdef CONFIG_IEEE802154_NL802154_EXPERIMENTAL
  	NL802154_CMD_SET_SEC_PARAMS,
  	NL802154_CMD_GET_SEC_KEY,		/* can dump */
  	NL802154_CMD_NEW_SEC_KEY,

include/net/nl802154.h enum nl802154_commands { · line 78

Quoted 9 lines
include/net/nl802154.h +2 -1
@@ -74,7 +71,8 @@ enum nl802154_commands {
  	NL802154_CMD_GET_SEC_LEVEL,		/* can dump */
  	NL802154_CMD_NEW_SEC_LEVEL,
  	NL802154_CMD_DEL_SEC_LEVEL,
-#endif /* CONFIG_IEEE802154_NL802154_EXPERIMENTAL */
+
+	/* add new commands above here */
 
  	/* used to define NL802154_CMD_MAX below */
  	__NL802154_CMD_AFTER_LAST,

Thanks for handling this! I will simply ack it as I assume you will take it directly instead of me taking it through my tree and adding delays.

regards
Stefan Schmidt

Tested-by on v2 1/1
#2 lore raw
In reply to Jakub Kicinski
Quoted 11 lines · Jakub Kicinski

From: Gal Pressman <[email protected]>

When CONFIG_IEEE802154_NL802154_EXPERIMENTAL is disabled,
NL802154_CMD_DEL_SEC_LEVEL is undefined and results in a compilation
error:
net/ieee802154/nl802154.c:2503:19: error: 'NL802154_CMD_DEL_SEC_LEVEL' undeclared here (not in a function); did you mean 'NL802154_CMD_SET_CCA_ED_LEVEL'?

 2503 |  .resv_start_op = NL802154_CMD_DEL_SEC_LEVEL + 1,
      |                   ^~~~~~~~~~~~~~~~~~~~~~~~~~
      |                   NL802154_CMD_SET_CCA_ED_LEVEL
Quoted 6 lines

Unhide the experimental commands, having them defined in an enum makes no difference.

Fixes 9c5d03d36251 ("genetlink: start to validate reserved header bytes")

Fixes the build for me.

Signature · 2 lines
Regards
Sudip
#3 lore raw
In reply to Jakub Kicinski
This patch was applied to netdev/net-next.git (master) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net-next.git (master) by Jakub Kicinski <[email protected]>:

Quoted 11 lines · On Thu, 1 Sep 2022 20:06:20 -0700 you wrote:

From: Gal Pressman <[email protected]>

When CONFIG_IEEE802154_NL802154_EXPERIMENTAL is disabled,
NL802154_CMD_DEL_SEC_LEVEL is undefined and results in a compilation
error:
net/ieee802154/nl802154.c:2503:19: error: 'NL802154_CMD_DEL_SEC_LEVEL' undeclared here (not in a function); did you mean 'NL802154_CMD_SET_CCA_ED_LEVEL'?

 2503 |  .resv_start_op = NL802154_CMD_DEL_SEC_LEVEL + 1,
      |                   ^~~~~~~~~~~~~~~~~~~~~~~~~~
      |                   NL802154_CMD_SET_CCA_ED_LEVEL

[...]

Here is the summary with links:
- [net-next,v2] net: ieee802154: Fix compilation error when CONFIG_IEEE802154_NL802154_EXPERIMENTAL is disabled

    https://git.kernel.org/netdev/net-next/c/8254393663f9

You are awesome, thank you!

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