From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tom Rini Date: Fri, 24 Apr 2020 13:08:18 -0400 Subject: [PATCH 2/5] env_internal.h: add alternative ENV_SAVE_PTR macro In-Reply-To: <20200219094726.26798-3-rasmus.villemoes@prevas.dk> References: <20200219094726.26798-1-rasmus.villemoes@prevas.dk> <20200219094726.26798-3-rasmus.villemoes@prevas.dk> Message-ID: <20200424170818.GV4555@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 Wed, Feb 19, 2020 at 09:47:40AM +0000, Rasmus Villemoes wrote: > The current definition of the env_save_ptr does not take SPL_SAVEENV > into account. Moreover, the way it is implemented means that drivers > need to guard the definitions of their _save methods with ifdefs to > avoid "defined but unused" warnings in case CMD_SAVEENV=n. > > The ifdeffery can be avoided by using a "something ? x : NULL" > construction instead and still have the compiler elide the _save > method when it is not referenced. Unfortunately we can't just switch > the existing env_save_ptr macro, since that would give a lot of build > errors unless all the ifdeffery is removed at the same time. > Conversely, removing that ifdeffery first would merely lead to the > "defined but unused" warnings temporarily, but for some storage > drivers it requires a bit more work than just removing their private > CMD_SAVEENV logic. > > So introduce an alternative to env_save_ptr, which for lack of a > better name is simply uppercased, allowing one to update storage > drivers piecemeal to both reduce their ifdeffery and honour > CONFIG_SPL_SAVEENV. > > Signed-off-by: Rasmus Villemoes Applied to u-boot/master, thanks! -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: