From: Tom Rini Date: Wed, 20 Nov 2019 16:24:11 -0500 Subject: [U-Boot] [PATCH] env: Provide programmatic equivalent to 'setenv -f' In-Reply-To: References: <0102016e84b84c9c-991687db-659e-4ede-b45e-20864255e87d-000000@eu-west-1.amazonses.com> <79415138-b2bc-78a9-d103-5716a6431cff@gmail.com> <1daad825-0231-661f-b31b-6d280030138d@gmx.de> Message-ID: <20191120212411.GM19317@bill-the-cat> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Tue, Nov 19, 2019 at 09:37:01PM +0000, Joe Hershberger wrote: > On Tue, Nov 19, 2019 at 3:01 PM Simon Goldschmidt > wrote: > > > > Heinrich Schuchardt schrieb am Di., 19. Nov. 2019, > > 21:56: > > > > > On 11/19/19 9:30 PM, Simon Goldschmidt wrote: > > > > Am 19.11.2019 um 18:31 schrieb James Byrne: > > > >> Add env_force() to provide an equivalent to 'setenv -f' that can be used > > > >> programmatically. > > > >> > > > >> Also tighten up the definition of argv in _do_env_set() so that > > > >> 'const char *' pointers are used. > > > >> > > > >> Signed-off-by: James Byrne > > > > > > > > OK, I'm on CC, so I'll give my two cent: > > > > > > > > I always thought this code to be messed up a bit: I think it's better > > > > programming style to have the "string argument parsing" code call real C > > > > functions with typed arguments. The env code instead does it the other > > > > way round (here, you add do_programmatic_env_set() that sets up an > > > > argv[] array to call another function). > > > > > > > > I'm not a maintainer for the ENV code, but maybe that should be sorted > > > > out instead of adding yet more code that goes this way? > > > > > > There is no maintainer for the ENV code. Simon makes a valid point here. > > > By creating a function for setting variables and separating it from > > > parsing arguments you get the function you need for forcing the value of > > > a variable for free. > > > > > > > Right. I thought someone had volunteered but a look at the maintainers file > > proves me wrong. > > I sent a patch [1] to Tom a while ago, but it hasn't made it in yet. > > [1] - https://patchwork.ozlabs.org/patch/1166740/ Sorry, I was waiting for an update where you move Wolfgang down to just 'R' for review, and fix the thinko on his last name :) -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 833 bytes Desc: not available URL: