From: Tom Rini Date: Fri, 26 Feb 2021 12:40:32 -0500 Subject: [PATCH] RFC: spl: fit: Use libfdt functions to read stringlist In-Reply-To: <20210225143118.1.Ib1a20614bbab61d1c9ef8a1df528f10ce98c5bcc@changeid> References: <20210225143118.1.Ib1a20614bbab61d1c9ef8a1df528f10ce98c5bcc@changeid> Message-ID: <20210226174032.GK10169@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 25, 2021 at 02:31:23PM -0500, Simon Glass wrote: > At present the code here reimplements a few libfdt functions and does not > always respect the property length. The !str check is unlikely to fire > since 1 is added to the string address. If strchr() returns NULL then the > code produces (void*)1 instead. Also it might extend beyond the property > value since strchr() does not have a maximum length. > > In any case it does not seem worthwhile to implement the libfdt functions > again, despite small code-size advantages. There is no function to return > the count after a failed get, but we can call two functions. We could add > one if code size is considered critical here. > > Update the code to use libfdt directly. > > For lion-rk3368 (aarch64) this adds 68 bytes of code. > For am57xx_hs_evm (arm) it adds 134 bytes. > > Signed-off-by: Simon Glass Reviewed-by: Tom Rini -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: