public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: York Sun <yorksun@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2 2/9] make the hwconfig buffer deeper
Date: Mon, 3 Jan 2011 13:26:31 -0800	[thread overview]
Message-ID: <1294089991.24386.58.camel@oslab-l1> (raw)
In-Reply-To: <20110103211125.710E5CEF7A6@gemini.denx.de>

On Mon, 2011-01-03 at 22:11 +0100, Wolfgang Denk wrote:
> Dear York Sun,
> 
> In message <1294085287.24386.52.camel@oslab-l1> you wrote:
> >
> > > Please explain 1) why this is needed and 2) what it has to do with
> > > running "at" (from?) flash?
> > > 
> > > hwconfig is intended for simple h/w configurations.  In which case do
> > > you need more than 128 characters for such settings?  And is this
> > > really needed / reasonable?
> > 
> > First of all, I don't need more than 128 characters for hwconfig. I
> > think the buggy code makes the buffer less usable.
> 
> Hm... I have no idea whish sort of "buggy code" you are referring to
> here, but in this case we shoul start and fix that buggy code, right?

Making a buffer in a function's stack and make use of it out of the
scope, that's the buggy code I am referring. 

> 
> > If you look into the common/hwconfig.c, you will notice the _current_
> > code uses the stack as temporary memory to hold the variable. Even I
> > don't agree with this way, I don't have a quick fix either. There may be
> 
> What's wrong with putting it on the stack?  This prevents a permanent
> allocation, so the memory can easily be reused once that function
> returns.

How can the content be guaranteed? The stack can be trashed when the
function returns.

> 
> > two ways or more to fix it. One is to create wrapper functions to deal
> > with pre-relocation and post-relocation functions. Another way is to
> > allocate more space in gd. Which way do you think is better?
> 
> You fail to explain why we should change anything when you "don't need
> more than 128 characters for hwconfig" in the first place?

I don't need more than 128 characters. However, the stack is trashed by
other functions. I have to push the stack deeper to keep the content
unchanged. I am not happy with it.

York

  reply	other threads:[~2011-01-03 21:26 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-17 23:59 [U-Boot] [PATCH v2 1/9] mpc8xxx: Display RDIMM if detected York Sun
2010-12-17 23:59 ` [U-Boot] [PATCH v2 2/9] make the hwconfig buffer deeper York Sun
2010-12-18 22:25   ` Wolfgang Denk
2011-01-03 20:08     ` York Sun
2011-01-03 21:11       ` Wolfgang Denk
2011-01-03 21:26         ` York Sun [this message]
2011-01-03 21:47           ` Wolfgang Denk
2011-01-07 15:14             ` Kumar Gala
2011-01-07 16:49               ` York Sun
2011-01-07 17:52                 ` Wolfgang Denk
2011-01-07 23:23                   ` Kumar Gala
2011-01-09 21:00                     ` Kumar Gala
2011-01-10 18:39                       ` York Sun
2011-01-07 17:50               ` Wolfgang Denk
2010-12-17 23:59 ` [U-Boot] [PATCH v2 3/9] mpc8xxx: Enable ECC on/off control in hwconfig York Sun
2011-01-09 21:23   ` Kumar Gala
2010-12-17 23:59 ` [U-Boot] [PATCH v2 4/9] corenet_ds: Enable ECC for corenet_ds York Sun
2010-12-17 23:59 ` [U-Boot] [PATCH v2 5/9] mpc85xx: Adding more registers and options York Sun
2010-12-18 22:30   ` Wolfgang Denk
2010-12-17 23:59 ` [U-Boot] [PATCH v2 6/9] mpc85xx: Enable unique mode registers and dynamic ODT for DDR3 York Sun
2010-12-18 22:53   ` Wolfgang Denk
2010-12-17 23:59 ` [U-Boot] [PATCH v2 7/9] Adding more SPD registers York Sun
2010-12-18 22:54   ` Wolfgang Denk
2010-12-17 23:59 ` [U-Boot] [PATCH v2 8/9] mpc85xx: Implement workaround for erratum DDR-A003 York Sun
2011-01-09 21:23   ` Kumar Gala
2010-12-17 23:59 ` [U-Boot] [PATCH v2 9/9] corenet_ds: Extend board specific parameters York Sun
2010-12-18 22:20   ` Wolfgang Denk
2010-12-18 22:21 ` [U-Boot] [PATCH v2 1/9] mpc8xxx: Display RDIMM if detected Wolfgang Denk
2010-12-21 13:36   ` Sergei Shtylyov

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=1294089991.24386.58.camel@oslab-l1 \
    --to=yorksun@freescale.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