diff options
author | Denis Vlasenko | 2007-06-25 10:55:35 +0000 |
---|---|---|
committer | Denis Vlasenko | 2007-06-25 10:55:35 +0000 |
commit | 80b8b39899a09c7516920cda5fd343b3086d4824 (patch) | |
tree | aa9903fd6b64d19c5f640fa302272d85c92b204e /networking/ifupdown.c | |
parent | 1399282b47bb218132a554cbe5b2b0ce4dcc055f (diff) | |
download | busybox-80b8b39899a09c7516920cda5fd343b3086d4824.zip busybox-80b8b39899a09c7516920cda5fd343b3086d4824.tar.gz |
Consolidate ARRAY_SIZE macro; remove one unneeded global var (walter harms <wharms@bfs.de>)
Diffstat (limited to 'networking/ifupdown.c')
-rw-r--r-- | networking/ifupdown.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/networking/ifupdown.c b/networking/ifupdown.c index 2b748f1..8843184 100644 --- a/networking/ifupdown.c +++ b/networking/ifupdown.c @@ -375,7 +375,7 @@ static const struct method_t methods6[] = { static const struct address_family_t addr_inet6 = { "inet6", - sizeof(methods6) / sizeof(struct method_t), + ARRAY_SIZE(methods6), methods6 }; #endif /* FEATURE_IFUPDOWN_IPV6 */ @@ -471,8 +471,8 @@ static const struct dhcp_client_t ext_dhcp_clients[] = { static int dhcp_up(struct interface_defn_t *ifd, execfn *exec) { #if ENABLE_FEATURE_IFUPDOWN_EXTERNAL_DHCP - int i, nclients = sizeof(ext_dhcp_clients) / sizeof(ext_dhcp_clients[0]); - for (i = 0; i < nclients; i++) { + int i ; + for (i = 0; i < ARRAY_SIZE(ext_dhcp_clients); i++) { if (exists_execable(ext_dhcp_clients[i].name)) return execute(ext_dhcp_clients[i].startcmd, ifd, exec); } @@ -490,8 +490,8 @@ static int dhcp_up(struct interface_defn_t *ifd, execfn *exec) static int dhcp_down(struct interface_defn_t *ifd, execfn *exec) { #if ENABLE_FEATURE_IFUPDOWN_EXTERNAL_DHCP - int i, nclients = sizeof(ext_dhcp_clients) / sizeof(ext_dhcp_clients[0]); - for (i = 0; i < nclients; i++) { + int i ; + for (i = 0; i < ARRAY_SIZE(ext_dhcp_clients); i++) { if (exists_execable(ext_dhcp_clients[i].name)) return execute(ext_dhcp_clients[i].stopcmd, ifd, exec); } @@ -551,7 +551,7 @@ static const struct method_t methods[] = { static const struct address_family_t addr_inet = { "inet", - sizeof(methods) / sizeof(methods[0]), + ARRAY_SIZE(methods), methods }; |