From: John Schmoller <jschmoller@xes-inc.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [RFC 0/2 v2] Remove CONFIG_SYS_MAXARGS
Date: Fri, 09 Apr 2010 17:00:32 -0500 [thread overview]
Message-ID: <1270850432.4458.36.camel@johns> (raw)
In-Reply-To: <20100409210407.988A31E173@gemini.denx.de>
On Fri, 2010-04-09 at 23:04 +0200, Wolfgang Denk wrote:
> Dear John Schmoller,
>
> In message <cover.1268416692.git.jschmoller@xes-inc.com> you wrote:
> > The first patch removes CONFIG_SYS_MAXARGS, replacing the staticly defined
> > array with a malloc'd array of the appropriate size. When a function has no
> > upper argument limit (ie, was set to CONFIG_SYS_MAXARGS), it is now set to 0
> > to indicate this fact. Argument count is now unlimited, within reason and
> > malloc buffer size.
> >
> > The second patch removes cmdtp->maxargs and moves the checks to the individual
> > command functions. Since most functions do bounds checking anyway, it's a
> > a fairly cheap task (sometimes free) to remove this bounds check in
> > common/main.c. In addition, it's more intuitive (in my opinion) if all bounds
> > checking is done in only one place for each function. The second patch also
> > creates a CMD_ERR_USAGE return value, which prints usage when returned. The
> > overall effect of this patch is to reduce code size by an average of 200-250
> > bytes and, I feel, make things a bit cleaner.
> >
> > I'm looking for comments on these two patches as they are quite invasive, and
> > will definitly cause problems for those people who maintain their own code
> > out-of-tree. They may also require an additional amount of testing.
>
> Did you actually run MAKEALL after applying the patches?
>
> I tried to get a feeling for the impact on the memory footprint, but
> it doesn't work for me. I get tons of error messages like these:
>
I did run MAKEALL on ppc and arm. So, either something must have changed
or you're seeing these errors on an arch I don't have a compiler set up
for. Are you seeing these errors on all arches or just on a specific
arch? I'll try to get to this as soon as I can.
John
next prev parent reply other threads:[~2010-04-09 22:00 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-03-12 19:25 [U-Boot] [RFC 0/2 v2] Remove CONFIG_SYS_MAXARGS John Schmoller
2010-03-12 19:25 ` [U-Boot] [RFC 1/2 v2] cmd: " John Schmoller
2010-03-12 19:25 ` [U-Boot] [RFC 2/2 v2] command: Remove maxargs from command structure John Schmoller
2010-03-12 20:58 ` Kim Phillips
2010-03-12 21:04 ` John Schmoller
2010-03-12 21:32 ` Kim Phillips
2010-04-09 21:04 ` [U-Boot] [RFC 0/2 v2] Remove CONFIG_SYS_MAXARGS Wolfgang Denk
2010-04-09 22:00 ` John Schmoller [this message]
2010-04-09 22:35 ` Wolfgang Denk
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=1270850432.4458.36.camel@johns \
--to=jschmoller@xes-inc.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox