[PATCH 1/7] globalbar: add inline when not enabled

Sascha Hauer s.hauer at pengutronix.de
Fri Sep 7 13:33:27 EDT 2012


sibject: s/globalbar/globalvar/

Sascha

On Wed, Sep 05, 2012 at 02:28:21PM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj at jcrosoft.com>
> ---
>  include/globalvar.h |   20 ++++++++++++++++++++
>  1 file changed, 20 insertions(+)
> 
> diff --git a/include/globalvar.h b/include/globalvar.h
> index 7cc3976..a127a05 100644
> --- a/include/globalvar.h
> +++ b/include/globalvar.h
> @@ -1,6 +1,7 @@
>  #ifndef __GLOBALVAR_H
>  #define __GLOBALVAR_H
>  
> +#ifdef CONFIG_GLOBALVAR
>  int globalvar_add_simple(const char *name);
>  
>  int globalvar_add(const char *name,
> @@ -8,5 +9,24 @@ int globalvar_add(const char *name,
>  		const char *(*get)(struct device_d *, struct param_d *p),
>  		unsigned long flags);
>  char *globalvar_get_match(const char *match, const char *seperator);
> +#else
> +static inline int globalvar_add_simple(const char *name)
> +{
> +	return 0;
> +}
> +
> +static inline int globalvar_add(const char *name,
> +		int (*set)(struct device_d *dev, struct param_d *p, const char *val),
> +		const char *(*get)(struct device_d *, struct param_d *p),
> +		unsigned long flags)
> +{
> +	return 0;
> +}
> +
> +static inline char *globalvar_get_match(const char *match, const char *seperator)
> +{
> +	return NULL;
> +}
> +#endif
>  
>  #endif /* __GLOBALVAR_H */
> -- 
> 1.7.10.4
> 
> 
> _______________________________________________
> barebox mailing list
> barebox at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |



More information about the barebox mailing list