From: Tom Rini Date: Sun, 22 Jan 2017 19:24:43 -0500 Subject: [U-Boot] [RFC PATCH] SPL: replace ctype implementation with tiny version In-Reply-To: <21ef0a56-0381-87f0-db89-1c0613f5f4b1@arm.com> References: <1484951608-15930-1-git-send-email-andre.przywara@arm.com> <20170122160937.GZ25981@bill-the-cat> <21ef0a56-0381-87f0-db89-1c0613f5f4b1@arm.com> Message-ID: <20170123002443.GA10853@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 Sun, Jan 22, 2017 at 11:30:04PM +0000, Andr? Przywara wrote: > On 22/01/17 16:09, Tom Rini wrote: > > On Fri, Jan 20, 2017 at 10:33:28PM +0000, Andre Przywara wrote: > >> The ctype implementation (isdigit() & friends) works with an array of > >> 256 Bytes - one for each character. This is pretty big in SPL terms, > >> so let's replace this "bloated" implementation with a tiny version > >> using C statements. This only implements the functions that the SPL > >> requires and confines this change only to an actual SPL build. > >> Saves about 200 Bytes from the SPL code size. > >> > >> Signed-off-by: Andre Przywara > >> --- > >> Hi, > >> > >> some people voiced concerns about running out of SPL code space when > >> adding new features. In this particular case this was an issue when > >> looking at the SPL FIT extension series[1]. > >> This patch here on top of this series saves more space than the SPL FIT > >> series consumed, so I trade this as a bait to people wrestling with this > >> problem ;-) > > > > So.. where might this fail? > > What do you mean by that? > > > Also, this doesn't look like it comes from > > the kernel exactly, so "linux/tiny_ctype.h" doesn't seem right (and, is > > missing the license boilerplate). It does bear some resemblance to the > > kernel ctype header so it would of course be correct to attribute that > > in the boilerplate. > > Actually I quickly hacked that up while looking at the existing map, > trying to convert it into statements. It was mostly an experiment to see > if that gives me something (hence the RFC tag). > > If the general idea is acceptable, I can surely make this pretty. Let me answer both parts at once. If this is as functional in all cases, why not just always do this instead? -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 819 bytes Desc: Digital signature URL: