Skip to content

Commit ccc7edf

Browse files
leitaokuba-moo
authored andcommitted
netpoll: move netpoll_print_options to netconsole
Move netpoll_print_options() from net/core/netpoll.c to drivers/net/netconsole.c and make it static. This function is only used by netconsole, so there's no need to export it or keep it in the public netpoll API. This reduces the netpoll API surface and improves code locality by keeping netconsole-specific functionality within the netconsole driver. Signed-off-by: Breno Leitao <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 5a34c9a commit ccc7edf

File tree

3 files changed

+17
-18
lines changed

3 files changed

+17
-18
lines changed

drivers/net/netconsole.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,23 @@ static void netconsole_process_cleanups_core(void)
278278
mutex_unlock(&target_cleanup_list_lock);
279279
}
280280

281+
static void netpoll_print_options(struct netpoll *np)
282+
{
283+
np_info(np, "local port %d\n", np->local_port);
284+
if (np->ipv6)
285+
np_info(np, "local IPv6 address %pI6c\n", &np->local_ip.in6);
286+
else
287+
np_info(np, "local IPv4 address %pI4\n", &np->local_ip.ip);
288+
np_info(np, "interface name '%s'\n", np->dev_name);
289+
np_info(np, "local ethernet address '%pM'\n", np->dev_mac);
290+
np_info(np, "remote port %d\n", np->remote_port);
291+
if (np->ipv6)
292+
np_info(np, "remote IPv6 address %pI6c\n", &np->remote_ip.in6);
293+
else
294+
np_info(np, "remote IPv4 address %pI4\n", &np->remote_ip.ip);
295+
np_info(np, "remote ethernet address %pM\n", np->remote_mac);
296+
}
297+
281298
#ifdef CONFIG_NETCONSOLE_DYNAMIC
282299

283300
/*

include/linux/netpoll.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ static inline void netpoll_poll_enable(struct net_device *dev) { return; }
7272
#endif
7373

7474
int netpoll_send_udp(struct netpoll *np, const char *msg, int len);
75-
void netpoll_print_options(struct netpoll *np);
7675
int __netpoll_setup(struct netpoll *np, struct net_device *ndev);
7776
int netpoll_setup(struct netpoll *np);
7877
void __netpoll_free(struct netpoll *np);

net/core/netpoll.c

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -492,23 +492,6 @@ int netpoll_send_udp(struct netpoll *np, const char *msg, int len)
492492
}
493493
EXPORT_SYMBOL(netpoll_send_udp);
494494

495-
void netpoll_print_options(struct netpoll *np)
496-
{
497-
np_info(np, "local port %d\n", np->local_port);
498-
if (np->ipv6)
499-
np_info(np, "local IPv6 address %pI6c\n", &np->local_ip.in6);
500-
else
501-
np_info(np, "local IPv4 address %pI4\n", &np->local_ip.ip);
502-
np_info(np, "interface name '%s'\n", np->dev_name);
503-
np_info(np, "local ethernet address '%pM'\n", np->dev_mac);
504-
np_info(np, "remote port %d\n", np->remote_port);
505-
if (np->ipv6)
506-
np_info(np, "remote IPv6 address %pI6c\n", &np->remote_ip.in6);
507-
else
508-
np_info(np, "remote IPv4 address %pI4\n", &np->remote_ip.ip);
509-
np_info(np, "remote ethernet address %pM\n", np->remote_mac);
510-
}
511-
EXPORT_SYMBOL(netpoll_print_options);
512495

513496
static void skb_pool_flush(struct netpoll *np)
514497
{

0 commit comments

Comments
 (0)