[PATCH 1/2] globalvar: fix build without CONFIG_GLOBALVAR

Sascha Hauer s.hauer at pengutronix.de
Wed May 17 04:39:07 PDT 2017


On Wed, May 17, 2017 at 12:16:55PM +0200, Lucas Stach wrote:
> Don't reference global_device if there is no globalvar support build in.
> 
> Signed-off-by: Lucas Stach <l.stach at pengutronix.de>
> ---
>  include/globalvar.h | 186 ++++++++++++++++++++++++++++++++++------------------
>  1 file changed, 122 insertions(+), 64 deletions(-)
> 
> diff --git a/include/globalvar.h b/include/globalvar.h
> index aea43b193dd1..afe390a96afb 100644
> --- a/include/globalvar.h
> +++ b/include/globalvar.h
> @@ -32,6 +32,80 @@ void globalvar_print(void);
>  
> -#endif
> +static inline int globalvar_add_simple_bool_ro(const char *name, uint32_t *value)
> +{
> +	return 0;
> +}
>  
> -#define DECLARE_GLOBALVAR_INT(intname, inttype, paramtype) \
> -	static inline int globalvar_add_simple_##intname(const char *name,	\
> -						      inttype *value,		\
> -						      const char *format)	\
> -	{									\
> -		return __globalvar_add_simple_int(name, value,			\
> -						  paramtype,			\
> -						  format);			\
> -	}

Wouldn't it be nicer to do a

	if (!IS_ENABLED(CONFIG_GLOBALVAR))
		return 0;

here and elsewhere?

Sascha

-- 
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