aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2010-07-24 23:27:38 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2010-07-24 23:27:38 +0200
commit2e9b5510d687e5418bea85c3b04ad1e1fa797b6f (patch)
tree426a864b37e091349a569e1f822ea084121ed04a
parente0a622093c6c1f3e3a1f58713118395994000fd9 (diff)
downloadbusybox-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.c4
-rw-r--r--networking/libiproute/ip_common.h29
-rw-r--r--networking/libiproute/ip_parse_common_args.c2
-rw-r--r--networking/libiproute/ipaddress.c4
-rw-r--r--networking/libiproute/iplink.c2
-rw-r--r--networking/libiproute/iproute.c2
-rw-r--r--networking/libiproute/iprule.c2
-rw-r--r--networking/libiproute/iptunnel.c2
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
25static int ip_print_help(char **argv UNUSED_PARAM) 25static int FAST_FUNC ip_print_help(char **argv UNUSED_PARAM)
26{ 26{
27 bb_show_usage(); 27 bb_show_usage();
28} 28}
29 29
30typedef int (*ip_func_ptr_t)(char**); 30typedef int FAST_FUNC (*ip_func_ptr_t)(char**);
31 31
32static int ip_do(ip_func_ptr_t ip_func, char **argv) 32static 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
16PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN 16PUSH_AND_SET_FUNCTION_VISIBILITY_TO_HIDDEN
17 17
18extern char **ip_parse_common_args(char **argv); 18char FAST_FUNC **ip_parse_common_args(char **argv);
19extern 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);
20extern int ipaddr_list_or_flush(char **argv, int flush); 20int FAST_FUNC ipaddr_list_or_flush(char **argv, int flush);
21extern int iproute_monitor(char **argv); 21//int FAST_FUNC iproute_monitor(char **argv);
22extern void iplink_usage(void) NORETURN; 22//void FAST_FUNC ipneigh_reset_filter(void);
23extern void ipneigh_reset_filter(void);
24 23
25extern int do_ipaddr(char **argv); 24int FAST_FUNC do_ipaddr(char **argv);
26extern int do_iproute(char **argv); 25int FAST_FUNC do_iproute(char **argv);
27extern int do_iprule(char **argv); 26int FAST_FUNC do_iprule(char **argv);
28extern int do_ipneigh(char **argv); 27//int FAST_FUNC do_ipneigh(char **argv);
29extern int do_iptunnel(char **argv); 28int FAST_FUNC do_iptunnel(char **argv);
30extern int do_iplink(char **argv); 29int FAST_FUNC do_iplink(char **argv);
31extern int do_ipmonitor(char **argv); 30//int FAST_FUNC do_ipmonitor(char **argv);
32extern int do_multiaddr(char **argv); 31//int FAST_FUNC do_multiaddr(char **argv);
33extern int do_multiroute(char **argv); 32//int FAST_FUNC do_multiroute(char **argv);
34 33
35POP_SAVED_FUNCTION_VISIBILITY 34POP_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;
22smallint oneline; 22smallint oneline;
23char _SL_; 23char _SL_;
24 24
25char **ip_parse_common_args(char **argv) 25char** 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 */
418int ipaddr_list_or_flush(char **argv, int flush) 418int 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 */
750int do_ipaddr(char **argv) 750int 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 */
365int do_iplink(char **argv) 365int 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 */
872int do_iproute(char **argv) 872int 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 */
307int do_iprule(char **argv) 307int 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 */
559int do_iptunnel(char **argv) 559int 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";