netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] genetlink: correct uAPI defines
@ 2022-08-09 23:27 Jakub Kicinski
  2022-08-10 10:34 ` Johannes Berg
  2022-08-10 13:10 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Jakub Kicinski @ 2022-08-09 23:27 UTC (permalink / raw)
  To: davem; +Cc: netdev, edumazet, pabeni, johannes.berg, johannes, Jakub Kicinski

Commit 50a896cf2d6f ("genetlink: properly support per-op policy dumping")
seems to have copy'n'pasted things a little incorrectly.

The #define CTRL_ATTR_MCAST_GRP_MAX should have stayed right
after the previous enum. The new CTRL_ATTR_POLICY_* needs
its own define for MAX and that max should not contain the
superfluous _DUMP in the name.

We probably can't do anything about the CTRL_ATTR_POLICY_DUMP_MAX
any more, there's likely code which uses it. For consistency
(*cough* codegen *cough*) let's add the correctly name define
nonetheless.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
 include/uapi/linux/genetlink.h | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/include/uapi/linux/genetlink.h b/include/uapi/linux/genetlink.h
index d83f214b4134..ddba3ca01e39 100644
--- a/include/uapi/linux/genetlink.h
+++ b/include/uapi/linux/genetlink.h
@@ -87,6 +87,8 @@ enum {
 	__CTRL_ATTR_MCAST_GRP_MAX,
 };
 
+#define CTRL_ATTR_MCAST_GRP_MAX (__CTRL_ATTR_MCAST_GRP_MAX - 1)
+
 enum {
 	CTRL_ATTR_POLICY_UNSPEC,
 	CTRL_ATTR_POLICY_DO,
@@ -96,7 +98,6 @@ enum {
 	CTRL_ATTR_POLICY_DUMP_MAX = __CTRL_ATTR_POLICY_DUMP_MAX - 1
 };
 
-#define CTRL_ATTR_MCAST_GRP_MAX (__CTRL_ATTR_MCAST_GRP_MAX - 1)
-
+#define CTRL_ATTR_POLICY_MAX (__CTRL_ATTR_POLICY_DUMP_MAX - 1)
 
 #endif /* _UAPI__LINUX_GENERIC_NETLINK_H */
-- 
2.37.1


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

* Re: [PATCH net] genetlink: correct uAPI defines
  2022-08-09 23:27 [PATCH net] genetlink: correct uAPI defines Jakub Kicinski
@ 2022-08-10 10:34 ` Johannes Berg
  2022-08-10 13:10 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Johannes Berg @ 2022-08-10 10:34 UTC (permalink / raw)
  To: Jakub Kicinski, davem; +Cc: netdev, edumazet, pabeni

On Tue, 2022-08-09 at 16:27 -0700, Jakub Kicinski wrote:
> Commit 50a896cf2d6f ("genetlink: properly support per-op policy dumping")
> seems to have copy'n'pasted things a little incorrectly.
> 
> The #define CTRL_ATTR_MCAST_GRP_MAX should have stayed right
> after the previous enum. The new CTRL_ATTR_POLICY_* needs
> its own define for MAX and that max should not contain the
> superfluous _DUMP in the name.
> 
> We probably can't do anything about the CTRL_ATTR_POLICY_DUMP_MAX
> any more, there's likely code which uses it. For consistency
> (*cough* codegen *cough*) let's add the correctly name define
> nonetheless.

Oops, yes, that all makes sense.

Reviewed-by: Johannes Berg <johannes@sipsolutions.net>

johannes



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

* Re: [PATCH net] genetlink: correct uAPI defines
  2022-08-09 23:27 [PATCH net] genetlink: correct uAPI defines Jakub Kicinski
  2022-08-10 10:34 ` Johannes Berg
@ 2022-08-10 13:10 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-08-10 13:10 UTC (permalink / raw)
  To: Jakub Kicinski; +Cc: davem, netdev, edumazet, pabeni, johannes.berg, johannes

Hello:

This patch was applied to netdev/net.git (master)
by David S. Miller <davem@davemloft.net>:

On Tue,  9 Aug 2022 16:27:40 -0700 you wrote:
> Commit 50a896cf2d6f ("genetlink: properly support per-op policy dumping")
> seems to have copy'n'pasted things a little incorrectly.
> 
> The #define CTRL_ATTR_MCAST_GRP_MAX should have stayed right
> after the previous enum. The new CTRL_ATTR_POLICY_* needs
> its own define for MAX and that max should not contain the
> superfluous _DUMP in the name.
> 
> [...]

Here is the summary with links:
  - [net] genetlink: correct uAPI defines
    https://git.kernel.org/netdev/net/c/f329a0ebeaba

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2022-08-10 13:10 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-09 23:27 [PATCH net] genetlink: correct uAPI defines Jakub Kicinski
2022-08-10 10:34 ` Johannes Berg
2022-08-10 13:10 ` patchwork-bot+netdevbpf

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).