diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2010-07-24 23:27:38 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2010-07-24 23:27:38 +0200 |
commit | 2e9b5510d687e5418bea85c3b04ad1e1fa797b6f (patch) | |
tree | 426a864b37e091349a569e1f822ea084121ed04a | |
parent | e0a622093c6c1f3e3a1f58713118395994000fd9 (diff) | |
download | busybox-w32-2e9b5510d687e5418bea85c3b04ad1e1fa797b6f.tar.gz busybox-w32-2e9b5510d687e5418bea85c3b04ad1e1fa797b6f.tar.bz2 busybox-w32-2e9b5510d687e5418bea85c3b04ad1e1fa797b6f.zip |
libiproute: code shrink by adding FAST_FUNC
function old new delta
ipaddr_list_or_flush 1282 1293 +11
ip_parse_common_args 153 151 -2
ip_main 53 50 -3
ip_do 19 15 -4
do_iptunnel 985 980 -5
do_iprule 982 977 -5
do_iplink 1637 1631 -6
do_iproute 2105 2098 -7
do_ipaddr 1406 1398 -8
------------------------------------------------------------------------------
(add/remove: 0/0 grow/shrink: 1/8 up/down: 11/-40) Total: -29 bytes
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | networking/ip.c | 4 | ||||
-rw-r--r-- | networking/libiproute/ip_common.h | 29 | ||||
-rw-r--r-- | networking/libiproute/ip_parse_common_args.c | 2 | ||||
-rw-r--r-- | networking/libiproute/ipaddress.c | 4 | ||||
-rw-r--r-- | networking/libiproute/iplink.c | 2 | ||||
-rw-r--r-- | networking/libiproute/iproute.c | 2 | ||||
-rw-r--r-- | networking/libiproute/iprule.c | 2 | ||||
-rw-r--r-- | networking/libiproute/iptunnel.c | 2 |
8 files changed, 23 insertions, 24 deletions
diff --git a/networking/ip.c b/networking/ip.c index 3a99fa320..004289667 100644 --- a/networking/ip.c +++ b/networking/ip.c | |||
@@ -22,12 +22,12 @@ | |||
22 | || ENABLE_FEATURE_IP_TUNNEL \ | 22 | || ENABLE_FEATURE_IP_TUNNEL \ |
23 | || ENABLE_FEATURE_IP_RULE | 23 | || ENABLE_FEATURE_IP_RULE |
24 | 24 | ||
25 | static int ip_print_help(char **argv UNUSED_PARAM) | 25 | static int FAST_FUNC ip_print_help(char **argv UNUSED_PARAM) |
26 | { | 26 | { |
27 | bb_show_usage(); | 27 | bb_show_usage(); |
28 | } | 28 | } |
29 | 29 | ||
30 | typedef int (*ip_func_ptr_t)(char**); | 30 | typedef int FAST_FUNC (*ip_func_ptr_t)(char**); |
31 | 31 | ||
32 | static int ip_do(ip_func_ptr_t ip_func, char **argv) | 32 | static int ip_do(ip_func_ptr_t ip_func, char **argv) |
33 | { | 33 | { |
diff --git a/networking/libiproute/ip_common.h b/networking/libiproute/ip_common.h index aef325281..30c7e595b 100644 --- a/networking/libiproute/ip_common.h +++ b/networking/libiproute/ip_common.h | |||
@@ -15,22 +15,21 @@ | |||
15 | 15 | ||
16 | PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN | 16 | PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN |
17 | 17 | ||
18 | extern char **ip_parse_common_args(char **argv); | 18 | char FAST_FUNC **ip_parse_common_args(char **argv); |
19 | extern int print_neigh(struct sockaddr_nl *who, struct nlmsghdr *n, void *arg); | 19 | //int FAST_FUNC print_neigh(struct sockaddr_nl *who, struct nlmsghdr *n, void *arg); |
20 | extern int ipaddr_list_or_flush(char **argv, int flush); | 20 | int FAST_FUNC ipaddr_list_or_flush(char **argv, int flush); |
21 | extern int iproute_monitor(char **argv); | 21 | //int FAST_FUNC iproute_monitor(char **argv); |
22 | extern void iplink_usage(void) NORETURN; | 22 | //void FAST_FUNC ipneigh_reset_filter(void); |
23 | extern void ipneigh_reset_filter(void); | ||
24 | 23 | ||
25 | extern int do_ipaddr(char **argv); | 24 | int FAST_FUNC do_ipaddr(char **argv); |
26 | extern int do_iproute(char **argv); | 25 | int FAST_FUNC do_iproute(char **argv); |
27 | extern int do_iprule(char **argv); | 26 | int FAST_FUNC do_iprule(char **argv); |
28 | extern int do_ipneigh(char **argv); | 27 | //int FAST_FUNC do_ipneigh(char **argv); |
29 | extern int do_iptunnel(char **argv); | 28 | int FAST_FUNC do_iptunnel(char **argv); |
30 | extern int do_iplink(char **argv); | 29 | int FAST_FUNC do_iplink(char **argv); |
31 | extern int do_ipmonitor(char **argv); | 30 | //int FAST_FUNC do_ipmonitor(char **argv); |
32 | extern int do_multiaddr(char **argv); | 31 | //int FAST_FUNC do_multiaddr(char **argv); |
33 | extern int do_multiroute(char **argv); | 32 | //int FAST_FUNC do_multiroute(char **argv); |
34 | 33 | ||
35 | POP_SAVED_FUNCTION_VISIBILITY | 34 | POP_SAVED_FUNCTION_VISIBILITY |
36 | 35 | ||
diff --git a/networking/libiproute/ip_parse_common_args.c b/networking/libiproute/ip_parse_common_args.c index 5e4012b81..bf01528c4 100644 --- a/networking/libiproute/ip_parse_common_args.c +++ b/networking/libiproute/ip_parse_common_args.c | |||
@@ -22,7 +22,7 @@ family_t preferred_family = AF_UNSPEC; | |||
22 | smallint oneline; | 22 | smallint oneline; |
23 | char _SL_; | 23 | char _SL_; |
24 | 24 | ||
25 | char **ip_parse_common_args(char **argv) | 25 | char** FAST_FUNC ip_parse_common_args(char **argv) |
26 | { | 26 | { |
27 | static const char ip_common_commands[] ALIGN1 = | 27 | static const char ip_common_commands[] ALIGN1 = |
28 | "oneline" "\0" | 28 | "oneline" "\0" |
diff --git a/networking/libiproute/ipaddress.c b/networking/libiproute/ipaddress.c index 381293412..b6f469d0f 100644 --- a/networking/libiproute/ipaddress.c +++ b/networking/libiproute/ipaddress.c | |||
@@ -415,7 +415,7 @@ static void ipaddr_reset_filter(int _oneline) | |||
415 | } | 415 | } |
416 | 416 | ||
417 | /* Return value becomes exitcode. It's okay to not return at all */ | 417 | /* Return value becomes exitcode. It's okay to not return at all */ |
418 | int ipaddr_list_or_flush(char **argv, int flush) | 418 | int FAST_FUNC ipaddr_list_or_flush(char **argv, int flush) |
419 | { | 419 | { |
420 | static const char option[] ALIGN1 = "to\0""scope\0""up\0""label\0""dev\0"; | 420 | static const char option[] ALIGN1 = "to\0""scope\0""up\0""label\0""dev\0"; |
421 | 421 | ||
@@ -747,7 +747,7 @@ static int ipaddr_modify(int cmd, char **argv) | |||
747 | } | 747 | } |
748 | 748 | ||
749 | /* Return value becomes exitcode. It's okay to not return at all */ | 749 | /* Return value becomes exitcode. It's okay to not return at all */ |
750 | int do_ipaddr(char **argv) | 750 | int FAST_FUNC do_ipaddr(char **argv) |
751 | { | 751 | { |
752 | static const char commands[] ALIGN1 = | 752 | static const char commands[] ALIGN1 = |
753 | "add\0""delete\0""list\0""show\0""lst\0""flush\0"; | 753 | "add\0""delete\0""list\0""show\0""lst\0""flush\0"; |
diff --git a/networking/libiproute/iplink.c b/networking/libiproute/iplink.c index 8bf892797..9f9218573 100644 --- a/networking/libiproute/iplink.c +++ b/networking/libiproute/iplink.c | |||
@@ -362,7 +362,7 @@ static int do_change(char **argv, const unsigned rtm) | |||
362 | } | 362 | } |
363 | 363 | ||
364 | /* Return value becomes exitcode. It's okay to not return at all */ | 364 | /* Return value becomes exitcode. It's okay to not return at all */ |
365 | int do_iplink(char **argv) | 365 | int FAST_FUNC do_iplink(char **argv) |
366 | { | 366 | { |
367 | static const char keywords[] ALIGN1 = | 367 | static const char keywords[] ALIGN1 = |
368 | "add\0""delete\0""set\0""show\0""lst\0""list\0"; | 368 | "add\0""delete\0""set\0""show\0""lst\0""list\0"; |
diff --git a/networking/libiproute/iproute.c b/networking/libiproute/iproute.c index d771a609b..8dba2bf3d 100644 --- a/networking/libiproute/iproute.c +++ b/networking/libiproute/iproute.c | |||
@@ -869,7 +869,7 @@ static int iproute_get(char **argv) | |||
869 | } | 869 | } |
870 | 870 | ||
871 | /* Return value becomes exitcode. It's okay to not return at all */ | 871 | /* Return value becomes exitcode. It's okay to not return at all */ |
872 | int do_iproute(char **argv) | 872 | int FAST_FUNC do_iproute(char **argv) |
873 | { | 873 | { |
874 | static const char ip_route_commands[] ALIGN1 = | 874 | static const char ip_route_commands[] ALIGN1 = |
875 | /*0-3*/ "add\0""append\0""change\0""chg\0" | 875 | /*0-3*/ "add\0""append\0""change\0""chg\0" |
diff --git a/networking/libiproute/iprule.c b/networking/libiproute/iprule.c index 835529ec4..3af6a83a8 100644 --- a/networking/libiproute/iprule.c +++ b/networking/libiproute/iprule.c | |||
@@ -304,7 +304,7 @@ static int iprule_modify(int cmd, char **argv) | |||
304 | } | 304 | } |
305 | 305 | ||
306 | /* Return value becomes exitcode. It's okay to not return at all */ | 306 | /* Return value becomes exitcode. It's okay to not return at all */ |
307 | int do_iprule(char **argv) | 307 | int FAST_FUNC do_iprule(char **argv) |
308 | { | 308 | { |
309 | static const char ip_rule_commands[] ALIGN1 = | 309 | static const char ip_rule_commands[] ALIGN1 = |
310 | "add\0""delete\0""list\0""show\0"; | 310 | "add\0""delete\0""list\0""show\0"; |
diff --git a/networking/libiproute/iptunnel.c b/networking/libiproute/iptunnel.c index 257343826..8389ef348 100644 --- a/networking/libiproute/iptunnel.c +++ b/networking/libiproute/iptunnel.c | |||
@@ -556,7 +556,7 @@ static int do_show(char **argv) | |||
556 | } | 556 | } |
557 | 557 | ||
558 | /* Return value becomes exitcode. It's okay to not return at all */ | 558 | /* Return value becomes exitcode. It's okay to not return at all */ |
559 | int do_iptunnel(char **argv) | 559 | int FAST_FUNC do_iptunnel(char **argv) |
560 | { | 560 | { |
561 | static const char keywords[] ALIGN1 = | 561 | static const char keywords[] ALIGN1 = |
562 | "add\0""change\0""delete\0""show\0""list\0""lst\0"; | 562 | "add\0""change\0""delete\0""show\0""list\0""lst\0"; |