diff options
author | Michael Brown <mcb30@etherboot.org> | 2009-06-28 20:24:54 +0100 |
---|---|---|
committer | Michael Brown <mcb30@etherboot.org> | 2009-06-28 20:24:54 +0100 |
commit | 6e564323e02ec019feec2f5754fb59f8144b7a35 (patch) | |
tree | 812642456b054308870c86e5e4dd2aca1ef40cdf | |
parent | ee1d315ac06d6fa0dcc95cbd54ee264e838d1b6b (diff) | |
download | ipxe-6e564323e02ec019feec2f5754fb59f8144b7a35.tar.gz |
[ifmgmt] Optimise prototype for ifcommon_exec()
ifcommon_exec() was long-ago marked as __attribute__((regparm(2))) in
order to minimise the size of functions that call into it. Since
then, gPXE has added -mregparm=3 as a general compilation option, and
this "optimisation" is now counter-productive.
Change (and simplify) the prototype to minimise code size given the
current compilation conditions.
-rw-r--r-- | src/hci/commands/ifmgmt_cmd.c | 18 | ||||
-rw-r--r-- | src/hci/commands/ifmgmt_cmd.h | 6 |
2 files changed, 12 insertions, 12 deletions
diff --git a/src/hci/commands/ifmgmt_cmd.c b/src/hci/commands/ifmgmt_cmd.c index b5f42056..1b1b10f0 100644 --- a/src/hci/commands/ifmgmt_cmd.c +++ b/src/hci/commands/ifmgmt_cmd.c @@ -98,15 +98,15 @@ static int ifcommon_do_list ( int ( * payload ) ( struct net_device * ), /** * Execute if<xxx> command * - * @v payload Command to execute - * @v verb Verb describing the action of the command * @v argc Argument count * @v argv Argument list + * @v payload Command to execute + * @v verb Verb describing the action of the command * @ret rc Exit code */ -__attribute__ (( regparm ( 2 ) )) int -ifcommon_exec ( int ( * payload ) ( struct net_device * ), - const char *verb, int argc, char **argv ) { +int ifcommon_exec ( int argc, char **argv, + int ( * payload ) ( struct net_device * ), + const char *verb ) { int c; /* Parse options */ @@ -137,7 +137,7 @@ static int ifopen_payload ( struct net_device *netdev ) { } static int ifopen_exec ( int argc, char **argv ) { - return ifcommon_exec ( ifopen_payload, "Open", argc, argv ); + return ifcommon_exec ( argc, argv, ifopen_payload, "Open" ); } /* "ifclose" command */ @@ -148,7 +148,7 @@ static int ifclose_payload ( struct net_device *netdev ) { } static int ifclose_exec ( int argc, char **argv ) { - return ifcommon_exec ( ifclose_payload, "Close", argc, argv ); + return ifcommon_exec ( argc, argv, ifclose_payload, "Close" ); } /* "ifstat" command */ @@ -159,8 +159,8 @@ static int ifstat_payload ( struct net_device *netdev ) { } static int ifstat_exec ( int argc, char **argv ) { - return ifcommon_exec ( ifstat_payload, "Display status of", - argc, argv ); + return ifcommon_exec ( argc, argv, + ifstat_payload, "Display status of" ); } /** Interface management commands */ diff --git a/src/hci/commands/ifmgmt_cmd.h b/src/hci/commands/ifmgmt_cmd.h index ead128fe..e9c810ab 100644 --- a/src/hci/commands/ifmgmt_cmd.h +++ b/src/hci/commands/ifmgmt_cmd.h @@ -23,8 +23,8 @@ FILE_LICENCE ( GPL2_OR_LATER ); struct net_device; -extern int ifcommon_exec ( int ( * payload ) ( struct net_device * ), - const char *verb, int argc, char **argv ) - __attribute__ (( regparm ( 2 ) )); +extern int ifcommon_exec ( int argc, char **argv, + int ( * payload ) ( struct net_device * ), + const char *verb ); #endif /* _IFMGMT_CMD_H */ |