git: 43d0c2ddd255 - main - netlink: use (void) for function definitions with no arguments
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 27 Oct 2022 15:14:40 UTC
The branch main has been updated by emaste: URL: https://cgit.FreeBSD.org/src/commit/?id=43d0c2ddd2556841717a50925f713c9c70d3936e commit 43d0c2ddd2556841717a50925f713c9c70d3936e Author: Ed Maste <emaste@FreeBSD.org> AuthorDate: 2022-10-27 14:49:51 +0000 Commit: Ed Maste <emaste@FreeBSD.org> CommitDate: 2022-10-27 15:14:00 +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 --- sys/compat/linux/linux_netlink.c | 4 ++-- 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 +- 6 files changed, 11 insertions(+), 10 deletions(-) diff --git a/sys/compat/linux/linux_netlink.c b/sys/compat/linux/linux_netlink.c index 816d9f34f19f..7744fee094e0 100644 --- a/sys/compat/linux/linux_netlink.c +++ b/sys/compat/linux/linux_netlink.c @@ -561,13 +561,13 @@ static struct linux_netlink_provider linux_netlink_v1 = { }; void -linux_netlink_register() +linux_netlink_register(void) { linux_netlink_p = &linux_netlink_v1; } void -linux_netlink_deregister() +linux_netlink_deregister(void) { linux_netlink_p = NULL; } 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));