git: 6e5d41dc8f16 - stable/13 - netlink: use (void) for function definitions with no arguments

From: Alexander V. Chernikov <melifaro_at_FreeBSD.org>
Date: Mon, 23 Jan 2023 22:11:51 UTC
The branch stable/13 has been updated by melifaro:

URL: https://cgit.FreeBSD.org/src/commit/?id=6e5d41dc8f165e16dc924dd50f7081783adb450e

commit 6e5d41dc8f165e16dc924dd50f7081783adb450e
Author:     Ed Maste <emaste@FreeBSD.org>
AuthorDate: 2022-10-27 14:49:51 +0000
Commit:     Alexander V. Chernikov <melifaro@FreeBSD.org>
CommitDate: 2023-01-23 22:04:02 +0000

    netlink: use (void) for function definitions with no arguments
    
    For some of these Clang produced a warning that "a function declaration
    without a prototype is deprecated in all versions of C".  In other cases
    the function defintion used () which did not match the header
    declaration, which used (void).
    
    Sponsored by:   The FreeBSD Foundation
    
    (cherry picked from commit 43d0c2ddd2556841717a50925f713c9c70d3936e)
---
 sys/netlink/netlink_domain.c  | 3 ++-
 sys/netlink/netlink_generic.c | 4 ++--
 sys/netlink/route/neigh.c     | 4 ++--
 sys/netlink/route/nexthop.c   | 4 ++--
 sys/netlink/route/route.c     | 2 +-
 5 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/sys/netlink/netlink_domain.c b/sys/netlink/netlink_domain.c
index bca30bedce11..44b5fb732896 100644
--- a/sys/netlink/netlink_domain.c
+++ b/sys/netlink/netlink_domain.c
@@ -174,7 +174,8 @@ nlp_has_priv(struct nlpcb *nlp, int priv)
 }
 
 static uint32_t
-nl_find_port() {
+nl_find_port(void)
+{
 	/*
 	 * app can open multiple netlink sockets.
 	 * Start with current pid, if already taken,
diff --git a/sys/netlink/netlink_generic.c b/sys/netlink/netlink_generic.c
index 64985f656a63..7d226f77e44b 100644
--- a/sys/netlink/netlink_generic.c
+++ b/sys/netlink/netlink_generic.c
@@ -440,7 +440,7 @@ static const struct genl_cmd nlctrl_cmds[] = {
 };
 
 static void
-genl_nlctrl_init()
+genl_nlctrl_init(void)
 {
 	ctrl_family_id = genl_register_family(CTRL_FAMILY_NAME, 0, 2, CTRL_ATTR_MAX);
 	genl_register_cmds(CTRL_FAMILY_NAME, nlctrl_cmds, NL_ARRAY_LEN(nlctrl_cmds));
@@ -448,7 +448,7 @@ genl_nlctrl_init()
 }
 
 static void
-genl_nlctrl_destroy()
+genl_nlctrl_destroy(void)
 {
 	genl_unregister_family(CTRL_FAMILY_NAME);
 }
diff --git a/sys/netlink/route/neigh.c b/sys/netlink/route/neigh.c
index 076f4bfafdf4..9bcbb68dd375 100644
--- a/sys/netlink/route/neigh.c
+++ b/sys/netlink/route/neigh.c
@@ -559,7 +559,7 @@ rtnl_lle_event(void *arg __unused, struct llentry *lle, int evt)
 static const struct nlhdr_parser *all_parsers[] = { &ndmsg_parser };
 
 void
-rtnl_neighs_init()
+rtnl_neighs_init(void)
 {
 	NL_VERIFY_PARSERS(all_parsers);
 	rtnl_register_messages(cmd_handlers, NL_ARRAY_LEN(cmd_handlers));
@@ -568,7 +568,7 @@ rtnl_neighs_init()
 }
 
 void
-rtnl_neighs_destroy()
+rtnl_neighs_destroy(void)
 {
 	EVENTHANDLER_DEREGISTER(lle_event, lle_event_p);
 }
diff --git a/sys/netlink/route/nexthop.c b/sys/netlink/route/nexthop.c
index 31816d84f189..64f46ad035fc 100644
--- a/sys/netlink/route/nexthop.c
+++ b/sys/netlink/route/nexthop.c
@@ -590,7 +590,7 @@ consider_resize(struct unhop_ctl *ctl, uint32_t new_size)
 }
 
 static bool __noinline
-vnet_init_unhops()
+vnet_init_unhops(void)
 {
         uint32_t num_buckets = 16;
         size_t alloc_size = CHT_SLIST_GET_RESIZE_SIZE(num_buckets);
@@ -998,7 +998,7 @@ static const struct rtnl_cmd_handler cmd_handlers[] = {
 static const struct nlhdr_parser *all_parsers[] = { &nhmsg_parser };
 
 void
-rtnl_nexthops_init()
+rtnl_nexthops_init(void)
 {
 	NL_VERIFY_PARSERS(all_parsers);
 	rtnl_register_messages(cmd_handlers, NL_ARRAY_LEN(cmd_handlers));
diff --git a/sys/netlink/route/route.c b/sys/netlink/route/route.c
index 7b4fc64ec4bd..852843af1b7d 100644
--- a/sys/netlink/route/route.c
+++ b/sys/netlink/route/route.c
@@ -981,7 +981,7 @@ static const struct rtnl_cmd_handler cmd_handlers[] = {
 static const struct nlhdr_parser *all_parsers[] = {&mpath_parser, &metrics_parser, &rtm_parser};
 
 void
-rtnl_routes_init()
+rtnl_routes_init(void)
 {
 	NL_VERIFY_PARSERS(all_parsers);
 	rtnl_register_messages(cmd_handlers, NL_ARRAY_LEN(cmd_handlers));