diff mbox series

[iproute2,01/22] lib/ll_addr: whitespace and indent cleanup

Message ID 20181115223640.411-2-stephen@networkplumber.org
State Accepted, archived
Delegated to: stephen hemminger
Headers show
Series misc cleanups | expand

Commit Message

Stephen Hemminger Nov. 15, 2018, 10:36 p.m. UTC
Run old ll_addr through kernel Lindent.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/ll_addr.c | 24 +++++++++++++-----------
 1 file changed, 13 insertions(+), 11 deletions(-)
diff mbox series

Patch

diff --git a/lib/ll_addr.c b/lib/ll_addr.c
index 84de64e2e053..00b562aeda22 100644
--- a/lib/ll_addr.c
+++ b/lib/ll_addr.c
@@ -26,20 +26,20 @@ 
 #include "rt_names.h"
 #include "utils.h"
 
-
-const char *ll_addr_n2a(const unsigned char *addr, int alen, int type, char *buf, int blen)
+const char *ll_addr_n2a(const unsigned char *addr, int alen, int type,
+			char *buf, int blen)
 {
 	int i;
 	int l;
 
 	if (alen == 4 &&
-	    (type == ARPHRD_TUNNEL || type == ARPHRD_SIT || type == ARPHRD_IPGRE)) {
+	    (type == ARPHRD_TUNNEL || type == ARPHRD_SIT
+	     || type == ARPHRD_IPGRE))
 		return inet_ntop(AF_INET, addr, buf, blen);
-	}
-	if (alen == 16 &&
-	    (type == ARPHRD_TUNNEL6 || type == ARPHRD_IP6GRE)) {
+
+	if (alen == 16 && (type == ARPHRD_TUNNEL6 || type == ARPHRD_IP6GRE))
 		return inet_ntop(AF_INET6, addr, buf, blen);
-	}
+
 	snprintf(buf, blen, "%02x", addr[0]);
 	for (i = 1, l = 2; i < alen && l < blen; i++, l += 3)
 		snprintf(buf + l, blen - l, ":%02x", addr[i]);
@@ -62,7 +62,7 @@  int ll_addr_a2n(char *lladdr, int len, const char *arg)
 	} else {
 		int i;
 
-		for (i=0; i<len; i++) {
+		for (i = 0; i < len; i++) {
 			int temp;
 			char *cp = strchr(arg, ':');
 			if (cp) {
@@ -70,11 +70,13 @@  int ll_addr_a2n(char *lladdr, int len, const char *arg)
 				cp++;
 			}
 			if (sscanf(arg, "%x", &temp) != 1) {
-				fprintf(stderr, "\"%s\" is invalid lladdr.\n", arg);
+				fprintf(stderr, "\"%s\" is invalid lladdr.\n",
+					arg);
 				return -1;
 			}
 			if (temp < 0 || temp > 255) {
-				fprintf(stderr, "\"%s\" is invalid lladdr.\n", arg);
+				fprintf(stderr, "\"%s\" is invalid lladdr.\n",
+					arg);
 				return -1;
 			}
 			lladdr[i] = temp;
@@ -82,6 +84,6 @@  int ll_addr_a2n(char *lladdr, int len, const char *arg)
 				break;
 			arg = cp;
 		}
-		return i+1;
+		return i + 1;
 	}
 }