[U-Boot] [PATCH v3 09/15] env: Support multiple environments

Simon Goldschmidt sgoldschmidt at de.pepperl-fuchs.com
Wed Feb 7 08:25:55 UTC 2018


On 07.02.2018 09:19, Maxime Ripard wrote:
> On Tue, Feb 06, 2018 at 09:09:07AM +0100, Simon Goldschmidt wrote:
>> On 23.01.2018 21:16, Maxime Ripard wrote:
>>> Now that we have everything in place to support multiple environment, let's
>>> make sure the current code can use it.
>> I get more build errors testing this feature: there's a global variable
>> 'env_ptr' declared in flash, nand, nvram and remote env drivers (declared as
>> extern in envrionment.h). From reading the code, it seems like these could
>> just be changed to static, since 'env_ptr' is not used outside these
>> drivers?
> Given Joakim's comment, I guess we should keep them !static, rename
> them to $env_env_ptr, and remove the definition in the
> include/environment that doesn't seem used anywhere.

That's OK for me, I just wanted to point out the build error.

However, I do think that having unnecessary non-static global variables 
is not really good coding style as you risk name clashes. I'd really be 
interested in a reason for this.

Simon


More information about the U-Boot mailing list