]> git.kernelconcepts.de Git - karo-tx-uboot.git/commitdiff
net: cosmetic: Clean up RARP variables and functions
authorJoe Hershberger <joe.hershberger@ni.com>
Wed, 8 Apr 2015 06:41:11 +0000 (01:41 -0500)
committerLothar Waßmann <LW@KARO-electronics.de>
Tue, 8 Sep 2015 20:27:16 +0000 (22:27 +0200)
Make a thorough pass through all variables and function names contained
within rarp.c and remove CamelCase and improve naming.

Signed-off-by: Joe Hershberger <joe.hershberger@ni.com>
Acked-by: Simon Glass <sjg@chromium.org>
net/net.c
net/rarp.c
net/rarp.h

index 320039add5ece9a3b7440c6a1e1491491dc1a38d..bd92806ba4427ec0b907de16c4a701951cd32751 100644 (file)
--- a/net/net.c
+++ b/net/net.c
@@ -395,9 +395,9 @@ restart:
 
 #if defined(CONFIG_CMD_RARP)
                case RARP:
-                       RarpTry = 0;
+                       rarp_try = 0;
                        net_ip.s_addr = 0;
-                       RarpRequest();
+                       rarp_request();
                        break;
 #endif
 #if defined(CONFIG_CMD_PING)
index f50d2fbd9de7dc5ef261d19ac833a2047def641a..204e03cf28ae034ffff82ac802b9ebe695a5ad0f 100644 (file)
@@ -20,7 +20,7 @@
 #define TIMEOUT_COUNT (CONFIG_NET_RETRY_COUNT)
 #endif
 
-int RarpTry;
+int rarp_try;
 
 /*
  *     Handle a RARP received packet.
@@ -37,10 +37,9 @@ void rarp_receive(struct ip_udp_hdr *ip, unsigned len)
        }
 
        if ((ntohs(arp->ar_op) != RARPOP_REPLY) ||
-               (ntohs(arp->ar_hrd) != ARP_ETHER)   ||
-               (ntohs(arp->ar_pro) != PROT_IP)     ||
-               (arp->ar_hln != 6) || (arp->ar_pln != 4)) {
-
+           (ntohs(arp->ar_hrd) != ARP_ETHER)   ||
+           (ntohs(arp->ar_pro) != PROT_IP)     ||
+           (arp->ar_hln != 6) || (arp->ar_pln != 4)) {
                puts("invalid RARP header\n");
        } else {
                net_copy_ip(&net_ip, &arp->ar_data[16]);
@@ -56,25 +55,25 @@ void rarp_receive(struct ip_udp_hdr *ip, unsigned len)
 /*
  *     Timeout on BOOTP request.
  */
-static void RarpTimeout(void)
+static void rarp_timeout_handler(void)
 {
-       if (RarpTry >= TIMEOUT_COUNT) {
+       if (rarp_try >= TIMEOUT_COUNT) {
                puts("\nRetry count exceeded; starting again\n");
                NetStartAgain();
        } else {
-               NetSetTimeout(TIMEOUT, RarpTimeout);
-               RarpRequest();
+               NetSetTimeout(TIMEOUT, rarp_timeout_handler);
+               rarp_request();
        }
 }
 
 
-void RarpRequest(void)
+void rarp_request(void)
 {
        uchar *pkt;
        struct arp_hdr *rarp;
        int eth_hdr_size;
 
-       printf("RARP broadcast %d\n", ++RarpTry);
+       printf("RARP broadcast %d\n", ++rarp_try);
        pkt = net_tx_packet;
 
        eth_hdr_size = net_set_ether(pkt, net_bcast_ethaddr, PROT_RARP);
@@ -96,5 +95,5 @@ void RarpRequest(void)
 
        net_send_packet(net_tx_packet, eth_hdr_size + ARP_HDR_SIZE);
 
-       NetSetTimeout(TIMEOUT, RarpTimeout);
+       NetSetTimeout(TIMEOUT, rarp_timeout_handler);
 }
index 93e18899c308be762ace2b867753edad82710575..1ca8833ce5288c7796153dd5f7f9e23b675c848c 100644 (file)
  *     Global functions and variables.
  */
 
-extern int RarpTry;
+extern int rarp_try;
 
 /* Process the receipt of a RARP packet */
-extern void rarp_receive(struct ip_udp_hdr *ip, unsigned len);
-extern void RarpRequest(void); /* Send a RARP request */
+void rarp_receive(struct ip_udp_hdr *ip, unsigned len);
+void rarp_request(void);       /* Send a RARP request */
 
 /**********************************************************************/