public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Tom Rini <trini@konsulko.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] Relax check for valid environment in __hwconfig
Date: Thu, 11 Jan 2018 11:32:43 -0500	[thread overview]
Message-ID: <20180111163243.GH4660@bill-the-cat> (raw)
In-Reply-To: <20180110204233.77975-1-kan@FreeBSD.org>

On Wed, Jan 10, 2018 at 08:42:33PM +0000, Alexander Kabaev wrote:
> The function only needs env_get to be functional, so check
> the env_valid flag instead. There is no reason why this function
> should not work if environment is available early, say by being
> directly mapped in SPI.
> ---
>  common/hwconfig.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/common/hwconfig.c b/common/hwconfig.c
> index e5186d7796..4006aad59c 100644
> --- a/common/hwconfig.c
> +++ b/common/hwconfig.c
> @@ -12,6 +12,7 @@
>  #ifndef HWCONFIG_TEST
>  #include <config.h>
>  #include <common.h>
> +#include <environment.h>
>  #include <exports.h>
>  #include <hwconfig.h>
>  #include <linux/types.h>
> @@ -76,7 +77,7 @@ static const char *__hwconfig(const char *opt, size_t *arglen,
>  
>  	/* if we are passed a buffer use it, otherwise try the environment */
>  	if (!env_hwconfig) {
> -		if (!(gd->flags & GD_FLG_ENV_READY)) {
> +		if (gd->env_valid == ENV_INVALID) {
>  			printf("WARNING: Calling __hwconfig without a buffer "
>  					"and before environment is ready\n");
>  			return NULL;

Since you're changing the check here, please change the printf as well
to match the new check.  Thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20180111/2b52a7ff/attachment.sig>

      reply	other threads:[~2018-01-11 16:32 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-10 20:42 [U-Boot] [PATCH] Relax check for valid environment in __hwconfig Alexander Kabaev
2018-01-11 16:32 ` Tom Rini [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=20180111163243.GH4660@bill-the-cat \
    --to=trini@konsulko.com \
    --cc=u-boot@lists.denx.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