All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Hobbs <jason.hobbs@calxeda.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v4 06/13] Replace space and tab checks with isblank
Date: Wed, 24 Aug 2011 10:56:47 -0500	[thread overview]
Message-ID: <20110824155647.GB7512@jhobbs-laptop> (raw)
In-Reply-To: <201108231742.59942.vapier@gentoo.org>

On Tue, Aug 23, 2011 at 05:42:59PM -0400, Mike Frysinger wrote:
> On Tuesday, August 23, 2011 17:06:54 Jason Hobbs wrote:
> > -	while (*nn == ' ' || *nn == '\t')
> > +	while (isblank(*nn))
> >  		nn++;
> 
> at least for these "walking forward" ones, they could be replaced with:
> 	nn += strspn(nn, " \t");
> -mike

Sure, and we'd pick up the use of a currently unused function which
might otherwise get optimized away with linker garbage collection. Even
without taking garbage collection of strspn into account, switching one
of the "walkahead while isblank" lines in my tree to the strspn pattern
inceases my binary size by 11 bytes - two of them inceases it by 31
bytes. There's also the extra overhead for the function call and
strspn's local variables. I'd consider it if strspn was more readable (I
don't think it is), or there was some cost to adding the isblank macro
(there isn't, as it's replacing existing code that was doing the same
thing).

Jason

  reply	other threads:[~2011-08-24 15:56 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-23 21:06 [U-Boot] [PATCH v4 00/13] Add PXE support Jason Hobbs
2011-08-23 21:06 ` [U-Boot] [PATCH v4 01/13] Add generic, reusable menu code Jason Hobbs
2011-08-23 21:06 ` [U-Boot] [PATCH v4 02/13] common, menu: use abortboot for menu timeout Jason Hobbs
2011-08-23 21:06 ` [U-Boot] [PATCH v4 03/13] common: add run_command2 for running simple or hush commands Jason Hobbs
2011-08-23 21:46   ` Mike Frysinger
2011-08-23 21:06 ` [U-Boot] [PATCH v4 04/13] Add isblank Jason Hobbs
2011-08-23 21:40   ` Mike Frysinger
2011-08-24 15:40     ` Jason Hobbs
2011-08-23 21:06 ` [U-Boot] [PATCH v4 05/13] cosmetic: remove unneeded curly braces Jason Hobbs
2011-08-23 21:06 ` [U-Boot] [PATCH v4 06/13] Replace space and tab checks with isblank Jason Hobbs
2011-08-23 21:42   ` Mike Frysinger
2011-08-24 15:56     ` Jason Hobbs [this message]
2011-08-23 21:06 ` [U-Boot] [PATCH v4 07/13] Add standard environment variables README Jason Hobbs
2011-08-23 21:45   ` Mike Frysinger
2011-08-24 16:29     ` Jason Hobbs
2011-08-23 21:06 ` [U-Boot] [PATCH v4 08/13] lib: add uuid_str_to_bin for use with bootp and PXE uuid Jason Hobbs
2011-08-23 21:06 ` [U-Boot] [PATCH v4 09/13] Add pxe command Jason Hobbs
2011-08-23 21:06 ` [U-Boot] [PATCH v4 10/13] net: bootp: add PXE/RFC 4578 DHCP options support Jason Hobbs
2011-08-23 21:06 ` [U-Boot] [PATCH v4 11/13] Convert ca9x4_ct_vxp to standard env variables Jason Hobbs
2011-08-23 21:07 ` [U-Boot] [PATCH v4 12/13] arm: ca9x4_ct_vxp: enable pxe command support Jason Hobbs
2011-08-23 21:07 ` [U-Boot] [PATCH v4 13/13] arm: ca9x4_ct_vxp: enable PXE BOOTP options support Jason Hobbs

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110824155647.GB7512@jhobbs-laptop \
    --to=jason.hobbs@calxeda.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.