From patchwork Wed Apr 8 06:41:16 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joe Hershberger X-Patchwork-Id: 459123 X-Patchwork-Delegate: sjg@chromium.org Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from theia.denx.de (theia.denx.de [85.214.87.163]) by ozlabs.org (Postfix) with ESMTP id 845941401DA for ; Wed, 8 Apr 2015 16:45:47 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A7091A7464; Wed, 8 Apr 2015 08:45:10 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id H7lgCXeOV3Le; Wed, 8 Apr 2015 08:45:10 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 7080BA7443; Wed, 8 Apr 2015 08:44:49 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C59C7A7428 for ; Wed, 8 Apr 2015 08:43:32 +0200 (CEST) Received: from theia.denx.de ([127.0.0.1]) by localhost (theia.denx.de [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6Z21iOd-Futz for ; Wed, 8 Apr 2015 08:43:32 +0200 (CEST) X-policyd-weight: NOT_IN_SBL_XBL_SPAMHAUS=-1.5 NOT_IN_SPAMCOP=-1.5 NOT_IN_BL_NJABL=-1.5 (only DNSBL check requested) Received: from ni.com (skprod3.natinst.com [130.164.80.24]) by theia.denx.de (Postfix) with ESMTPS id 0D847A7448 for ; Wed, 8 Apr 2015 08:43:27 +0200 (CEST) Received: from us-aus-mgwout2.amer.corp.natinst.com (nb-snip2-1338.natinst.com [130.164.19.135]) by us-aus-skprod3.natinst.com (8.15.0.59/8.15.0.59) with ESMTP id t386hQYg003903 for ; Wed, 8 Apr 2015 01:43:26 -0500 Received: from linux-xvxi.natinst.com ([130.164.14.198]) by us-aus-mgwout2.amer.corp.natinst.com (Lotus Domino Release 8.5.3FP6) with ESMTP id 2015040801432621-960403 ; Wed, 8 Apr 2015 01:43:26 -0500 From: Joe Hershberger To: u-boot@lists.denx.de Date: Wed, 8 Apr 2015 01:41:16 -0500 Message-Id: <1428475285-25836-17-git-send-email-joe.hershberger@ni.com> X-Mailer: git-send-email 1.7.11.5 In-Reply-To: <1428475285-25836-1-git-send-email-joe.hershberger@ni.com> References: <1428095695-23368-1-git-send-email-joe.hershberger@ni.com> <1428475285-25836-1-git-send-email-joe.hershberger@ni.com> X-MIMETrack: Itemize by SMTP Server on US-AUS-MGWOut2/AUS/H/NIC(Release 8.5.3FP6|November 21, 2013) at 04/08/2015 01:43:26 AM, Serialize by Router on US-AUS-MGWOut2/AUS/H/NIC(Release 8.5.3FP6|November 21, 2013) at 04/08/2015 01:43:26 AM, Serialize complete at 04/08/2015 01:43:26 AM X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2015-04-08_03:, , signatures=0 Cc: Joe Hershberger Subject: [U-Boot] [PATCH v2 16/25] net: cosmetic: Clean up netconsole variables and functions X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.15 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" Make a thorough pass through all variables and function names contained within netconsole.c and remove CamelCase and improve naming. Signed-off-by: Joe Hershberger Acked-by: Simon Glass --- Changes in v2: None drivers/net/netconsole.c | 32 +++++++++++++++++--------------- include/net.h | 2 +- net/net.c | 2 +- 3 files changed, 19 insertions(+), 17 deletions(-) diff --git a/drivers/net/netconsole.c b/drivers/net/netconsole.c index 9aba0c5..c2e0184 100644 --- a/drivers/net/netconsole.c +++ b/drivers/net/netconsole.c @@ -48,7 +48,7 @@ static void nc_handler(uchar *pkt, unsigned dest, struct in_addr sip, net_set_state(NETLOOP_SUCCESS); /* got input - quit net loop */ } -static void nc_timeout(void) +static void nc_timeout_handler(void) { net_set_state(NETLOOP_SUCCESS); } @@ -91,8 +91,9 @@ static int refresh_settings_from_env(void) nc_out_port = simple_strtoul(p + 1, NULL, 10); nc_in_port = nc_out_port; } - } else + } else { nc_ip.s_addr = ~0; /* ncip is not set, so broadcast */ + } p = getenv("ncoutport"); if (p != NULL) @@ -114,13 +115,13 @@ static int refresh_settings_from_env(void) /** * Called from NetLoop in net/net.c before each packet */ -void NcStart(void) +void nc_start(void) { refresh_settings_from_env(); if (!output_packet_len || memcmp(nc_ether, net_null_ethaddr, 6)) { /* going to check for input packet */ net_set_udp_handler(nc_handler); - NetSetTimeout(net_timeout, nc_timeout); + NetSetTimeout(net_timeout, nc_timeout_handler); } else { /* send arp request */ uchar *pkt; @@ -198,8 +199,9 @@ static void nc_send_packet(const char *buf, int len) if (eth_init() < 0) return; eth_set_last_protocol(NETCONS); - } else + } else { eth_init_state_only(); + } inited = 1; } @@ -217,7 +219,7 @@ static void nc_send_packet(const char *buf, int len) } } -static int nc_start(struct stdio_dev *dev) +static int nc_stdio_start(struct stdio_dev *dev) { int retval; @@ -237,7 +239,7 @@ static int nc_start(struct stdio_dev *dev) return 0; } -static void nc_putc(struct stdio_dev *dev, char c) +static void nc_stdio_putc(struct stdio_dev *dev, char c) { if (output_recursion) return; @@ -248,7 +250,7 @@ static void nc_putc(struct stdio_dev *dev, char c) output_recursion = 0; } -static void nc_puts(struct stdio_dev *dev, const char *s) +static void nc_stdio_puts(struct stdio_dev *dev, const char *s) { int len; @@ -267,7 +269,7 @@ static void nc_puts(struct stdio_dev *dev, const char *s) output_recursion = 0; } -static int nc_getc(struct stdio_dev *dev) +static int nc_stdio_getc(struct stdio_dev *dev) { uchar c; @@ -288,7 +290,7 @@ static int nc_getc(struct stdio_dev *dev) return c; } -static int nc_tstc(struct stdio_dev *dev) +static int nc_stdio_tstc(struct stdio_dev *dev) { struct eth_device *eth; @@ -321,11 +323,11 @@ int drv_nc_init(void) strcpy(dev.name, "nc"); dev.flags = DEV_FLAGS_OUTPUT | DEV_FLAGS_INPUT | DEV_FLAGS_SYSTEM; - dev.start = nc_start; - dev.putc = nc_putc; - dev.puts = nc_puts; - dev.getc = nc_getc; - dev.tstc = nc_tstc; + dev.start = nc_stdio_start; + dev.putc = nc_stdio_putc; + dev.puts = nc_stdio_puts; + dev.getc = nc_stdio_getc; + dev.tstc = nc_stdio_tstc; rc = stdio_register(&dev); diff --git a/include/net.h b/include/net.h index 1275ffe..a7aefbc 100644 --- a/include/net.h +++ b/include/net.h @@ -634,7 +634,7 @@ int net_send_udp_packet(uchar *ether, struct in_addr dest, int dport, void net_process_received_packet(uchar *in_packet, int len); #ifdef CONFIG_NETCONSOLE -void NcStart(void); +void nc_start(void); int nc_input_packet(uchar *pkt, struct in_addr src_ip, unsigned dest_port, unsigned src_port, unsigned len); #endif diff --git a/net/net.c b/net/net.c index 1133f79..1395276 100644 --- a/net/net.c +++ b/net/net.c @@ -417,7 +417,7 @@ restart: #endif #if defined (CONFIG_NETCONSOLE) && !(CONFIG_SPL_BUILD) case NETCONS: - NcStart(); + nc_start(); break; #endif #if defined(CONFIG_CMD_SNTP)