From: Wolfgang Denk Date: Fri, 19 Jul 2019 11:05:53 +0200 Subject: [U-Boot] [RFC, PATCH v4 13/16] cmd: env: show variable storage attribute in "env flags" command In-Reply-To: <20190717082525.891-14-takahiro.akashi@linaro.org> References: <20190717082525.891-1-takahiro.akashi@linaro.org> <20190717082525.891-14-takahiro.akashi@linaro.org> Message-ID: <20190719090553.8A79E2403E6@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear AKASHI Takahiro, In message <20190717082525.891-14-takahiro.akashi@linaro.org> you wrote: > > diff --git a/cmd/nvedit.c b/cmd/nvedit.c > index 70fbb5dd8f2f..77e8846b601a 100644 > --- a/cmd/nvedit.c > +++ b/cmd/nvedit.c > @@ -618,10 +618,12 @@ static int print_static_flags(const char *var_name, const char *flags, > { > enum env_flags_vartype type = env_flags_parse_vartype(flags); > enum env_flags_varaccess access = env_flags_parse_varaccess(flags); > + enum env_flags_varstorage storage = env_flags_parse_varstorage(flags); > > - printf("\t%-20s %-20s %-20s\n", var_name, > + printf("\t%-20s %-20s %-20s %-20s\n", var_name, > env_flags_get_vartype_name(type), > - env_flags_get_varaccess_name(access)); > + env_flags_get_varaccess_name(access), > + env_flags_get_varstorage_name(storage)); This needs changing, see before. > > - if (entry->flags == 0) > +#ifdef CONFIG_EFI_LOADER > + if (entry->context == ENVCTX_UEFI && > + entry->flags == ENV_FLAGS_VARSTORAGE_NON_VOLATILE_AUTOSAVE) > + return 0; > +#endif > + /* ENVCTX_UBOOT */ > + if (entry->flags == ENV_FLAGS_VARSTORAGE_NON_VOLATILE) > return 0; No; we should not have such #ifdefery here. Please get rid of this. We have contexts, we should not handle these through #ifdef. Best regards, Wolfgang Denk -- DENX Software Engineering GmbH, Managing Director: Wolfgang Denk HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de There are three ways to get something done: do it yourself, hire someone, or forbid your kids to do it.