aboutsummaryrefslogtreecommitdiff
path: root/networking/libiproute
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2007-06-25 10:55:35 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2007-06-25 10:55:35 +0000
commit80b8b39899a09c7516920cda5fd343b3086d4824 (patch)
treeaa9903fd6b64d19c5f640fa302272d85c92b204e /networking/libiproute
parent1399282b47bb218132a554cbe5b2b0ce4dcc055f (diff)
downloadbusybox-w32-80b8b39899a09c7516920cda5fd343b3086d4824.tar.gz
busybox-w32-80b8b39899a09c7516920cda5fd343b3086d4824.tar.bz2
busybox-w32-80b8b39899a09c7516920cda5fd343b3086d4824.zip
Consolidate ARRAY_SIZE macro; remove one unneeded global var (walter harms <wharms@bfs.de>)
Diffstat (limited to 'networking/libiproute')
-rw-r--r--networking/libiproute/ll_proto.c4
-rw-r--r--networking/libiproute/ll_types.c2
2 files changed, 3 insertions, 3 deletions
diff --git a/networking/libiproute/ll_proto.c b/networking/libiproute/ll_proto.c
index 10d749881..4e62e876e 100644
--- a/networking/libiproute/ll_proto.c
+++ b/networking/libiproute/ll_proto.c
@@ -96,7 +96,7 @@ const char * ll_proto_n2a(unsigned short id, char *buf, int len)
96 96
97 id = ntohs(id); 97 id = ntohs(id);
98 98
99 for (i=0; i<sizeof(llproto_names)/sizeof(llproto_names[0]); i++) { 99 for (i=0; i < ARRAY_SIZE(llproto_names); i++) {
100 if (llproto_names[i].id == id) 100 if (llproto_names[i].id == id)
101 return llproto_names[i].name; 101 return llproto_names[i].name;
102 } 102 }
@@ -107,7 +107,7 @@ const char * ll_proto_n2a(unsigned short id, char *buf, int len)
107int ll_proto_a2n(unsigned short *id, char *buf) 107int ll_proto_a2n(unsigned short *id, char *buf)
108{ 108{
109 int i; 109 int i;
110 for (i=0; i<sizeof(llproto_names)/sizeof(llproto_names[0]); i++) { 110 for (i=0; i < ARRAY_SIZE(llproto_names); i++) {
111 if (strcasecmp(llproto_names[i].name, buf) == 0) { 111 if (strcasecmp(llproto_names[i].name, buf) == 0) {
112 *id = htons(llproto_names[i].id); 112 *id = htons(llproto_names[i].id);
113 return 0; 113 return 0;
diff --git a/networking/libiproute/ll_types.c b/networking/libiproute/ll_types.c
index 5d2843b14..84fd628cb 100644
--- a/networking/libiproute/ll_types.c
+++ b/networking/libiproute/ll_types.c
@@ -108,7 +108,7 @@ __PF(VOID,void)
108#undef __PF 108#undef __PF
109 109
110 int i; 110 int i;
111 for (i = 0; i < sizeof(arphrd_names)/sizeof(arphrd_names[0]); i++) { 111 for (i = 0; i < ARRAY_SIZE(arphrd_names); i++) {
112 if (arphrd_names[i].type == type) 112 if (arphrd_names[i].type == type)
113 return arphrd_names[i].name; 113 return arphrd_names[i].name;
114 } 114 }