[PATCH 07/48] libertas: make more functions static

Arnd Bergmann arnd at arndb.de
Mon Dec 10 11:08:31 EST 2007


On Monday 10 December 2007, David Woodhouse wrote:
> --- a/drivers/net/wireless/libertas/cmd.c
> +++ b/drivers/net/wireless/libertas/cmd.c
> @@ -13,6 +13,11 @@
>  #include "wext.h"
>  
>  static void cleanup_cmdnode(struct cmd_ctrl_node *ptempnode);
> +struct cmd_ctrl_node *lbs_get_cmd_ctrl_node(struct lbs_private *priv);
> +void lbs_set_cmd_ctrl_node(struct lbs_private *priv,
> +                   struct cmd_ctrl_node *ptempnode,
> +                   u16 wait_option, void *pdata_buf);
> +

You should never need forward declarations for global functions in a C file,
it is error prone in any case:

* if the functions are only used in one file, make them static.
* Better, avoid forward declarations entirely by ordering the functions in the
way they are called.
* If they are used in one file and defined in another, declare them in
a common header, and only there, in order to avoid the prototypes from diverging.

	Arnd <><



More information about the libertas-dev mailing list