netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net: ieee802154: Fix compilation error when CONFIG_IEEE802154_NL802154_EXPERIMENTAL is disabled
@ 2022-08-30 10:12 Gal Pressman
  2022-08-30 11:52 ` Sudip Mukherjee (Codethink)
  2022-08-31  6:13 ` Jakub Kicinski
  0 siblings, 2 replies; 18+ messages in thread
From: Gal Pressman @ 2022-08-30 10:12 UTC (permalink / raw)
  To: David S. Miller, Jakub Kicinski; +Cc: netdev, Gal Pressman, Leon Romanovsky

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

Use __NL802154_CMD_AFTER_LAST instead of
'NL802154_CMD_DEL_SEC_LEVEL + 1' to indicate the last command.

Fixes: 9c5d03d36251 ("genetlink: start to validate reserved header bytes")
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: Gal Pressman <gal@nvidia.com>
---
 net/ieee802154/nl802154.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/ieee802154/nl802154.c b/net/ieee802154/nl802154.c
index 38c4f3cb010e..dbfd24c70bd0 100644
--- a/net/ieee802154/nl802154.c
+++ b/net/ieee802154/nl802154.c
@@ -2500,7 +2500,7 @@ static struct genl_family nl802154_fam __ro_after_init = {
 	.module = THIS_MODULE,
 	.ops = nl802154_ops,
 	.n_ops = ARRAY_SIZE(nl802154_ops),
-	.resv_start_op = NL802154_CMD_DEL_SEC_LEVEL + 1,
+	.resv_start_op = __NL802154_CMD_AFTER_LAST,
 	.mcgrps = nl802154_mcgrps,
 	.n_mcgrps = ARRAY_SIZE(nl802154_mcgrps),
 };
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2022-09-02 10:35 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-08-30 10:12 [PATCH net-next] net: ieee802154: Fix compilation error when CONFIG_IEEE802154_NL802154_EXPERIMENTAL is disabled Gal Pressman
2022-08-30 11:52 ` Sudip Mukherjee (Codethink)
2022-08-31  6:13 ` Jakub Kicinski
2022-08-31  6:20   ` Gal Pressman
2022-08-31  6:23     ` Leon Romanovsky
2022-08-31  6:31     ` Jakub Kicinski
2022-08-31 18:21       ` Jakub Kicinski
2022-08-31 19:21         ` Alexander Aring
2022-08-31 20:59         ` Stefan Schmidt
2022-08-31 21:09           ` Jakub Kicinski
2022-08-31 21:13             ` Stefan Schmidt
2022-09-01  6:38             ` Leon Romanovsky
2022-09-01 12:50               ` Alexander Aring
2022-09-01 13:05                 ` Leon Romanovsky
2022-09-01 20:23               ` Jakub Kicinski
2022-09-02  2:48                 ` Alexander Aring
2022-09-02  3:00                   ` Jakub Kicinski
2022-09-02 10:35                     ` Leon Romanovsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).