Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

dcb: Use rtnl_register_many().

We will remove rtnl_register() in favour of rtnl_register_many().

When it succeeds, rtnl_register_many() guarantees all rtnetlink types
in the passed array are supported, and there is no chance that a part
of message types is not supported.

Let's use rtnl_register_many() instead.

Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Link: https://patch.msgid.link/20241014201828.91221-10-kuniyu@amazon.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Kuniyuki Iwashima and committed by
Jakub Kicinski
c82b031d 3ac84e31

+6 -2
+6 -2
net/dcb/dcbnl.c
··· 2408 2408 .notifier_call = dcbnl_netdevice_event, 2409 2409 }; 2410 2410 2411 + static const struct rtnl_msg_handler dcbnl_rtnl_msg_handlers[] __initconst = { 2412 + {.msgtype = RTM_GETDCB, .doit = dcb_doit}, 2413 + {.msgtype = RTM_SETDCB, .doit = dcb_doit}, 2414 + }; 2415 + 2411 2416 static int __init dcbnl_init(void) 2412 2417 { 2413 2418 int err; ··· 2421 2416 if (err) 2422 2417 return err; 2423 2418 2424 - rtnl_register(PF_UNSPEC, RTM_GETDCB, dcb_doit, NULL, 0); 2425 - rtnl_register(PF_UNSPEC, RTM_SETDCB, dcb_doit, NULL, 0); 2419 + rtnl_register_many(dcbnl_rtnl_msg_handlers); 2426 2420 2427 2421 return 0; 2428 2422 }