*: add FAST_FUNC to function ptrs where it makes sense

function                                             old     new   delta
evalcommand                                         1195    1209     +14
testcmd                                                -      10     +10
printfcmd                                              -      10     +10
echocmd                                                -      10     +10
func_exec                                            270     276      +6
echo_dg                                              104     109      +5
store_nlmsg                                           85      89      +4
pseudo_exec_argv                                     195     198      +3
dotcmd                                               287     290      +3
machtime_stream                                       29      31      +2
discard_stream                                        24      26      +2
argstr                                              1299    1301      +2
killcmd                                              108     109      +1
evalfor                                              226     227      +1
daytime_stream                                        43      44      +1
run_list                                            2544    2543      -1
lookupvar                                             62      61      -1
ipaddr_modify                                       1310    1309      -1
...
parse_stream                                        2254    2245      -9
evalpipe                                             356     347      -9
collect_if                                           210     197     -13
read_opt                                             869     851     -18
handle_dollar                                        681     658     -23
print_addrinfo                                      1342    1303     -39
iterate_on_dir                                       156      59     -97
print_route                                         1709    1609    -100
------------------------------------------------------------------------------
(add/remove: 3/0 grow/shrink: 12/130 up/down: 74/-767)       Total: -693 bytes
   text    data     bss     dec     hex filename
 841748     467    7872  850087   cf8a7 busybox_old
 841061     467    7872  849400   cf5f8 busybox_unstripped

Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
This commit is contained in:
Denys Vlasenko
2009-06-05 12:06:05 +02:00
parent 8507e1f109
commit d5f1b1bbe0
22 changed files with 323 additions and 345 deletions

View File

@ -42,8 +42,8 @@ typedef int execfn(char *command);
struct method_t {
const char *name;
int (*up)(struct interface_defn_t *ifd, execfn *e);
int (*down)(struct interface_defn_t *ifd, execfn *e);
int (*up)(struct interface_defn_t *ifd, execfn *e) FAST_FUNC;
int (*down)(struct interface_defn_t *ifd, execfn *e) FAST_FUNC;
};
struct address_family_t {
@ -325,7 +325,7 @@ static int execute(const char *command, struct interface_defn_t *ifd, execfn *ex
#endif
#if ENABLE_FEATURE_IFUPDOWN_IPV6
static int loopback_up6(struct interface_defn_t *ifd, execfn *exec)
static int FAST_FUNC loopback_up6(struct interface_defn_t *ifd, execfn *exec)
{
#if ENABLE_FEATURE_IFUPDOWN_IP
int result;
@ -337,7 +337,7 @@ static int loopback_up6(struct interface_defn_t *ifd, execfn *exec)
#endif
}
static int loopback_down6(struct interface_defn_t *ifd, execfn *exec)
static int FAST_FUNC loopback_down6(struct interface_defn_t *ifd, execfn *exec)
{
#if ENABLE_FEATURE_IFUPDOWN_IP
return execute("ip link set %iface% down", ifd, exec);
@ -346,7 +346,7 @@ static int loopback_down6(struct interface_defn_t *ifd, execfn *exec)
#endif
}
static int static_up6(struct interface_defn_t *ifd, execfn *exec)
static int FAST_FUNC static_up6(struct interface_defn_t *ifd, execfn *exec)
{
int result;
#if ENABLE_FEATURE_IFUPDOWN_IP
@ -362,7 +362,7 @@ static int static_up6(struct interface_defn_t *ifd, execfn *exec)
return ((result == 3) ? 3 : 0);
}
static int static_down6(struct interface_defn_t *ifd, execfn *exec)
static int FAST_FUNC static_down6(struct interface_defn_t *ifd, execfn *exec)
{
#if ENABLE_FEATURE_IFUPDOWN_IP
return execute("ip link set %iface% down", ifd, exec);
@ -372,7 +372,7 @@ static int static_down6(struct interface_defn_t *ifd, execfn *exec)
}
#if ENABLE_FEATURE_IFUPDOWN_IP
static int v4tunnel_up(struct interface_defn_t *ifd, execfn *exec)
static int FAST_FUNC v4tunnel_up(struct interface_defn_t *ifd, execfn *exec)
{
int result;
result = execute("ip tunnel add %iface% mode sit remote "
@ -383,7 +383,7 @@ static int v4tunnel_up(struct interface_defn_t *ifd, execfn *exec)
return ((result == 4) ? 4 : 0);
}
static int v4tunnel_down(struct interface_defn_t * ifd, execfn * exec)
static int FAST_FUNC v4tunnel_down(struct interface_defn_t * ifd, execfn * exec)
{
return execute("ip tunnel del %iface%", ifd, exec);
}
@ -405,7 +405,7 @@ static const struct address_family_t addr_inet6 = {
#endif /* FEATURE_IFUPDOWN_IPV6 */
#if ENABLE_FEATURE_IFUPDOWN_IPV4
static int loopback_up(struct interface_defn_t *ifd, execfn *exec)
static int FAST_FUNC loopback_up(struct interface_defn_t *ifd, execfn *exec)
{
#if ENABLE_FEATURE_IFUPDOWN_IP
int result;
@ -417,7 +417,7 @@ static int loopback_up(struct interface_defn_t *ifd, execfn *exec)
#endif
}
static int loopback_down(struct interface_defn_t *ifd, execfn *exec)
static int FAST_FUNC loopback_down(struct interface_defn_t *ifd, execfn *exec)
{
#if ENABLE_FEATURE_IFUPDOWN_IP
int result;
@ -429,7 +429,7 @@ static int loopback_down(struct interface_defn_t *ifd, execfn *exec)
#endif
}
static int static_up(struct interface_defn_t *ifd, execfn *exec)
static int FAST_FUNC static_up(struct interface_defn_t *ifd, execfn *exec)
{
int result;
#if ENABLE_FEATURE_IFUPDOWN_IP
@ -451,7 +451,7 @@ static int static_up(struct interface_defn_t *ifd, execfn *exec)
#endif
}
static int static_down(struct interface_defn_t *ifd, execfn *exec)
static int FAST_FUNC static_down(struct interface_defn_t *ifd, execfn *exec)
{
int result;
#if ENABLE_FEATURE_IFUPDOWN_IP
@ -468,8 +468,7 @@ static int static_down(struct interface_defn_t *ifd, execfn *exec)
}
#if ENABLE_FEATURE_IFUPDOWN_EXTERNAL_DHCP
struct dhcp_client_t
{
struct dhcp_client_t {
const char *name;
const char *startcmd;
const char *stopcmd;
@ -497,7 +496,7 @@ static const struct dhcp_client_t ext_dhcp_clients[] = {
#endif /* ENABLE_FEATURE_IFUPDOWN_EXTERNAL_DHCPC */
#if ENABLE_FEATURE_IFUPDOWN_EXTERNAL_DHCP
static int dhcp_up(struct interface_defn_t *ifd, execfn *exec)
static int FAST_FUNC dhcp_up(struct interface_defn_t *ifd, execfn *exec)
{
unsigned i;
#if ENABLE_FEATURE_IFUPDOWN_IP
@ -517,7 +516,7 @@ static int dhcp_up(struct interface_defn_t *ifd, execfn *exec)
return 0;
}
#elif ENABLE_APP_UDHCPC
static int dhcp_up(struct interface_defn_t *ifd, execfn *exec)
static int FAST_FUNC dhcp_up(struct interface_defn_t *ifd, execfn *exec)
{
#if ENABLE_FEATURE_IFUPDOWN_IP
/* ip doesn't up iface when it configures it (unlike ifconfig) */
@ -533,7 +532,7 @@ static int dhcp_up(struct interface_defn_t *ifd, execfn *exec)
ifd, exec);
}
#else
static int dhcp_up(struct interface_defn_t *ifd UNUSED_PARAM,
static int FAST_FUNC dhcp_up(struct interface_defn_t *ifd UNUSED_PARAM,
execfn *exec UNUSED_PARAM)
{
return 0; /* no dhcp support */
@ -541,7 +540,7 @@ static int dhcp_up(struct interface_defn_t *ifd UNUSED_PARAM,
#endif
#if ENABLE_FEATURE_IFUPDOWN_EXTERNAL_DHCP
static int dhcp_down(struct interface_defn_t *ifd, execfn *exec)
static int FAST_FUNC dhcp_down(struct interface_defn_t *ifd, execfn *exec)
{
int result = 0;
unsigned i;
@ -564,7 +563,7 @@ static int dhcp_down(struct interface_defn_t *ifd, execfn *exec)
return ((result == 3) ? 3 : 0);
}
#elif ENABLE_APP_UDHCPC
static int dhcp_down(struct interface_defn_t *ifd, execfn *exec)
static int FAST_FUNC dhcp_down(struct interface_defn_t *ifd, execfn *exec)
{
int result;
result = execute("kill "
@ -579,42 +578,42 @@ static int dhcp_down(struct interface_defn_t *ifd, execfn *exec)
return ((result == 3) ? 3 : 0);
}
#else
static int dhcp_down(struct interface_defn_t *ifd UNUSED_PARAM,
static int FAST_FUNC dhcp_down(struct interface_defn_t *ifd UNUSED_PARAM,
execfn *exec UNUSED_PARAM)
{
return 0; /* no dhcp support */
}
#endif
static int manual_up_down(struct interface_defn_t *ifd UNUSED_PARAM, execfn *exec UNUSED_PARAM)
static int FAST_FUNC manual_up_down(struct interface_defn_t *ifd UNUSED_PARAM, execfn *exec UNUSED_PARAM)
{
return 1;
}
static int bootp_up(struct interface_defn_t *ifd, execfn *exec)
static int FAST_FUNC bootp_up(struct interface_defn_t *ifd, execfn *exec)
{
return execute("bootpc[[ --bootfile %bootfile%]] --dev %iface%"
"[[ --server %server%]][[ --hwaddr %hwaddr%]]"
" --returniffail --serverbcast", ifd, exec);
}
static int ppp_up(struct interface_defn_t *ifd, execfn *exec)
static int FAST_FUNC ppp_up(struct interface_defn_t *ifd, execfn *exec)
{
return execute("pon[[ %provider%]]", ifd, exec);
}
static int ppp_down(struct interface_defn_t *ifd, execfn *exec)
static int FAST_FUNC ppp_down(struct interface_defn_t *ifd, execfn *exec)
{
return execute("poff[[ %provider%]]", ifd, exec);
}
static int wvdial_up(struct interface_defn_t *ifd, execfn *exec)
static int FAST_FUNC wvdial_up(struct interface_defn_t *ifd, execfn *exec)
{
return execute("start-stop-daemon --start -x wvdial "
"-p /var/run/wvdial.%iface% -b -m --[[ %provider%]]", ifd, exec);
}
static int wvdial_down(struct interface_defn_t *ifd, execfn *exec)
static int FAST_FUNC wvdial_down(struct interface_defn_t *ifd, execfn *exec)
{
return execute("start-stop-daemon --stop -x wvdial "
"-p /var/run/wvdial.%iface% -s 2", ifd, exec);