From patchwork Wed Apr 8 06:41:03 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joe Hershberger X-Patchwork-Id: 459131 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 CF8F9140082 for ; Wed, 8 Apr 2015 16:47:08 +1000 (AEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id A35C0A747C; Wed, 8 Apr 2015 08:46:11 +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 Dn7wFvJMhHZz; Wed, 8 Apr 2015 08:46:11 +0200 (CEST) Received: from theia.denx.de (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id 601C2A749E; Wed, 8 Apr 2015 08:45:30 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by theia.denx.de (Postfix) with ESMTP id C9F17A7422 for ; Wed, 8 Apr 2015 08:43:33 +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 h4mFmfljxMBx for ; Wed, 8 Apr 2015 08:43:33 +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 0DA07A744C for ; Wed, 8 Apr 2015 08:43:26 +0200 (CEST) Received: from us-aus-mgwout2.amer.corp.natinst.com (nb-chan1-1338.natinst.com [130.164.19.134]) by us-aus-skprod3.natinst.com (8.15.0.59/8.15.0.59) with ESMTP id t386hOoD003878 for ; Wed, 8 Apr 2015 01:43:24 -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 2015040801432462-960386 ; Wed, 8 Apr 2015 01:43:24 -0500 From: Joe Hershberger To: u-boot@lists.denx.de Date: Wed, 8 Apr 2015 01:41:03 -0500 Message-Id: <1428475285-25836-4-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:24 AM, Serialize by Router on US-AUS-MGWOut2/AUS/H/NIC(Release 8.5.3FP6|November 21, 2013) at 04/08/2015 01:43:24 AM, Serialize complete at 04/08/2015 01:43:24 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 03/25] net: cosmetic: Fixup var names for DHCP strings 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" Remove CamelCase variable naming. Move the definition to the same compilation unit as the primary use. Signed-off-by: Joe Hershberger Acked-by: Simon Glass --- Changes in v2: None common/cmd_net.c | 12 ++++++------ include/net.h | 6 +++--- net/bootp.c | 51 +++++++++++++++++++++++++++------------------------ net/net.c | 6 ------ 4 files changed, 36 insertions(+), 39 deletions(-) diff --git a/common/cmd_net.c b/common/cmd_net.c index d75718c..87c4ed1 100644 --- a/common/cmd_net.c +++ b/common/cmd_net.c @@ -124,11 +124,11 @@ static void netboot_update_env(void) setenv("netmask", tmp); } - if (NetOurHostName[0]) - setenv("hostname", NetOurHostName); + if (net_hostname[0]) + setenv("hostname", net_hostname); - if (NetOurRootPath[0]) - setenv("rootpath", NetOurRootPath); + if (net_root_path[0]) + setenv("rootpath", net_root_path); if (net_ip.s_addr) { ip_to_string(net_ip, tmp); @@ -154,8 +154,8 @@ static void netboot_update_env(void) setenv("dnsip2", tmp); } #endif - if (NetOurNISDomain[0]) - setenv("domain", NetOurNISDomain); + if (net_nis_domain[0]) + setenv("domain", net_nis_domain); #if defined(CONFIG_CMD_SNTP) \ && defined(CONFIG_BOOTP_TIMEOFFSET) diff --git a/include/net.h b/include/net.h index b484d4c..2664865 100644 --- a/include/net.h +++ b/include/net.h @@ -467,9 +467,9 @@ extern struct in_addr net_dns_server; /* Our 2nd Domain Name Server (0 = unknown) */ extern struct in_addr net_dns_server2; #endif -extern char NetOurNISDomain[32]; /* Our NIS domain */ -extern char NetOurHostName[32]; /* Our hostname */ -extern char NetOurRootPath[64]; /* Our root path */ +extern char net_nis_domain[32]; /* Our IS domain */ +extern char net_hostname[32]; /* Our hostname */ +extern char net_root_path[64]; /* Our root path */ /** END OF BOOTP EXTENTIONS **/ extern uchar NetOurEther[6]; /* Our ethernet address */ extern uchar NetServerEther[6]; /* Boot server enet address */ diff --git a/net/bootp.c b/net/bootp.c index 0148c19..9251e91 100644 --- a/net/bootp.c +++ b/net/bootp.c @@ -56,6 +56,9 @@ unsigned int bootp_num_ids; int BootpTry; ulong bootp_start; ulong bootp_timeout; +char net_nis_domain[32] = {0,}; /* Our NIS domain */ +char net_hostname[32] = {0,}; /* Our hostname */ +char net_root_path[64] = {0,}; /* Our bootpath */ #if defined(CONFIG_CMD_DHCP) static dhcp_state_t dhcp_state = INIT; @@ -220,11 +223,11 @@ static void BootpVendorFieldProcess(u8 *ext) case 11: /* RPL server - Not yet supported */ break; case 12: /* Host name */ - if (NetOurHostName[0] == 0) { + if (net_hostname[0] == 0) { size = truncate_sz("Host Name", - sizeof(NetOurHostName), size); - memcpy(&NetOurHostName, ext + 2, size); - NetOurHostName[size] = 0; + sizeof(net_hostname), size); + memcpy(&net_hostname, ext + 2, size); + net_hostname[size] = 0; } break; case 13: /* Boot file size */ @@ -242,11 +245,11 @@ static void BootpVendorFieldProcess(u8 *ext) case 16: /* Swap server - Not yet supported */ break; case 17: /* Root path */ - if (NetOurRootPath[0] == 0) { + if (net_root_path[0] == 0) { size = truncate_sz("Root Path", - sizeof(NetOurRootPath), size); - memcpy(&NetOurRootPath, ext + 2, size); - NetOurRootPath[size] = 0; + sizeof(net_root_path), size); + memcpy(&net_root_path, ext + 2, size); + net_root_path[size] = 0; } break; case 18: /* Extension path - Not yet supported */ @@ -258,11 +261,11 @@ static void BootpVendorFieldProcess(u8 *ext) break; /* IP host layer fields */ case 40: /* NIS Domain name */ - if (NetOurNISDomain[0] == 0) { + if (net_nis_domain[0] == 0) { size = truncate_sz("NIS Domain Name", - sizeof(NetOurNISDomain), size); - memcpy(&NetOurNISDomain, ext + 2, size); - NetOurNISDomain[size] = 0; + sizeof(net_nis_domain), size); + memcpy(&net_nis_domain, ext + 2, size); + net_nis_domain[size] = 0; } break; #if defined(CONFIG_CMD_SNTP) && defined(CONFIG_BOOTP_NTPSERVER) @@ -310,14 +313,14 @@ static void BootpVendorProcess(u8 *ext, int size) debug("net_boot_file_expected_size_in_blocks : %d\n", net_boot_file_expected_size_in_blocks); - if (NetOurHostName[0]) - debug("NetOurHostName : %s\n", NetOurHostName); + if (net_hostname[0]) + debug("net_hostname : %s\n", net_hostname); - if (NetOurRootPath[0]) - debug("NetOurRootPath : %s\n", NetOurRootPath); + if (net_root_path[0]) + debug("net_root_path : %s\n", net_root_path); - if (NetOurNISDomain[0]) - debug("NetOurNISDomain : %s\n", NetOurNISDomain); + if (net_nis_domain[0]) + debug("net_nis_domain : %s\n", net_nis_domain); #if defined(CONFIG_CMD_SNTP) && defined(CONFIG_BOOTP_NTPSERVER) if (net_ntp_server) @@ -793,17 +796,17 @@ static void DhcpOptionsProcess(uchar *popt, struct Bootp_t *bp) break; case 12: size = truncate_sz("Host Name", - sizeof(NetOurHostName), oplen); - memcpy(&NetOurHostName, popt + 2, size); - NetOurHostName[size] = 0; + sizeof(net_hostname), oplen); + memcpy(&net_hostname, popt + 2, size); + net_hostname[size] = 0; break; case 15: /* Ignore Domain Name Option */ break; case 17: size = truncate_sz("Root Path", - sizeof(NetOurRootPath), oplen); - memcpy(&NetOurRootPath, popt + 2, size); - NetOurRootPath[size] = 0; + sizeof(net_root_path), oplen); + memcpy(&net_root_path, popt + 2, size); + net_root_path[size] = 0; break; case 28: /* Ignore Broadcast Address Option */ break; diff --git a/net/net.c b/net/net.c index f60998b..bfa326e 100644 --- a/net/net.c +++ b/net/net.c @@ -121,12 +121,6 @@ struct in_addr net_dns_server; /* Our 2nd DNS IP address */ struct in_addr net_dns_server2; #endif -/* Our NIS domain */ -char NetOurNISDomain[32] = {0,}; -/* Our hostname */ -char NetOurHostName[32] = {0,}; -/* Our bootpath */ -char NetOurRootPath[64] = {0,}; #ifdef CONFIG_MCAST_TFTP /* Multicast TFTP */ struct in_addr net_mcast_addr;