]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
netconsole: rename functions to better reflect their purpose
authorBreno Leitao <leitao@debian.org>
Fri, 13 Jun 2025 11:31:34 +0000 (04:31 -0700)
committerJakub Kicinski <kuba@kernel.org>
Mon, 16 Jun 2025 22:18:33 +0000 (15:18 -0700)
Rename netpoll_parse_options() to netconsole_parser_cmdline() and
netpoll_print_options() to netconsole_print_banner() to better
describe what these functions actually do within the netconsole
context.

Also fix minor code style issues including variable declaration
ordering and spacing.

These functions are specific to netconsole functionality rather
than general netpoll operations, so the new names better reflect
their actual purpose.

Signed-off-by: Breno Leitao <leitao@debian.org>
Link: https://patch.msgid.link/20250613-rework-v3-5-0752bf2e6912@debian.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/netconsole.c

index 71522fb0eeeef0d73d80446b0de957ad2541a43b..cc45ec18848c9d1a8c4eb743f376772abcb214bd 100644 (file)
@@ -278,7 +278,7 @@ static void netconsole_process_cleanups_core(void)
        mutex_unlock(&target_cleanup_list_lock);
 }
 
-static void netpoll_print_options(struct netpoll *np)
+static void netconsole_print_banner(struct netpoll *np)
 {
        np_info(np, "local port %d\n", np->local_port);
        if (np->ipv6)
@@ -551,10 +551,10 @@ static ssize_t enabled_store(struct config_item *item,
                }
 
                /*
-                * Skip netpoll_parse_options() -- all the attributes are
+                * Skip netconsole_parser_cmdline() -- all the attributes are
                 * already configured via configfs. Just print them out.
                 */
-               netpoll_print_options(&nt->np);
+               netconsole_print_banner(&nt->np);
 
                ret = netpoll_setup(&nt->np);
                if (ret)
@@ -1696,11 +1696,12 @@ static int netpoll_parse_ip_addr(const char *str, union inet_addr *addr)
        return -1;
 }
 
-static int netpoll_parse_options(struct netpoll *np, char *opt)
+static int netconsole_parser_cmdline(struct netpoll *np, char *opt)
 {
-       char *cur=opt, *delim;
-       int ipv6;
        bool ipversion_set = false;
+       char *cur = opt;
+       char *delim;
+       int ipv6;
 
        if (*cur != '@') {
                if ((delim = strchr(cur, '@')) == NULL)
@@ -1775,7 +1776,7 @@ static int netpoll_parse_options(struct netpoll *np, char *opt)
                        goto parse_failed;
        }
 
-       netpoll_print_options(np);
+       netconsole_print_banner(np);
 
        return 0;
 
@@ -1813,7 +1814,7 @@ static struct netconsole_target *alloc_param_target(char *target_config,
        }
 
        /* Parse parameters and setup netpoll */
-       err = netpoll_parse_options(&nt->np, target_config);
+       err = netconsole_parser_cmdline(&nt->np, target_config);
        if (err)
                goto fail;