mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Lucas Stach <l.stach@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 1/2] globalvar: fix build without CONFIG_GLOBALVAR
Date: Wed, 17 May 2017 13:39:07 +0200	[thread overview]
Message-ID: <20170517113906.d5zlfbue3qtahqrk@pengutronix.de> (raw)
In-Reply-To: <20170517101656.31717-1-l.stach@pengutronix.de>

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

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

      parent reply	other threads:[~2017-05-17 11:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-17 10:16 Lucas Stach
2017-05-17 10:16 ` [PATCH 2/2] video: select OFTREE from DRIVER_VIDEO_IMX_IPUV3 Lucas Stach
2017-05-17 11:40   ` Sascha Hauer
2017-05-17 11:39 ` Sascha Hauer [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170517113906.d5zlfbue3qtahqrk@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=l.stach@pengutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox