From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tom Rini Date: Fri, 24 Apr 2020 13:09:10 -0400 Subject: [PATCH 4/4] make env_entry::callback conditional on !CONFIG_SPL_BUILD In-Reply-To: <20200227135600.28853-5-rasmus.villemoes@prevas.dk> References: <20200227135600.28853-1-rasmus.villemoes@prevas.dk> <20200227135600.28853-5-rasmus.villemoes@prevas.dk> Message-ID: <20200424170910.GD4555@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 Thu, Feb 27, 2020 at 01:56:12PM +0000, Rasmus Villemoes wrote: > The callback member of struct env_entry is always NULL for an SPL > build. Removing it thus saves a bit of run-time memory in the > SPL (when CONFIG_SPL_ENV_SUPPORT=y) since struct env_entry is embedded > in struct env_entry_node - i.e. about 2KB for the normal case of > 512+change hash table entries. > > Two small fixups are needed for this, all other references to the > callback member are already under !CONFIG_SPL_BUILD: Don't initialize > .callback in set_flags() - hsearch_r doesn't use that value > anyway. And make env_callback_init() initialize ->callback to NULL for > a new entry instead of relying on an unused or deleted entry having > NULL in ->callback. > > Signed-off-by: Rasmus Villemoes > Reviewed-by: Simon Glass 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: