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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux