public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [RFC] arm/board.c: avoid ifdef using weak default functions
Date: Thu, 23 Jul 2009 23:53:10 +0200	[thread overview]
Message-ID: <20090723215310.GF9480@game.jcrosoft.org> (raw)
In-Reply-To: <20090722171910.GA4914@mail.gnudd.com>

On 19:19 Wed 22 Jul     , Alessandro Rubini wrote:
> From: Alessandro Rubini <rubini@gnudd.com>
> 
> While it's a matter of personal taste, I prefer to avoid ifdef when
> possible.  For example, I don't like to add BOARD_LATE_INIT in the
> config file just to have my board_late_init() function called.
> 
> This patch (not meant to be applied mainstram, jsut for discussion)
> tries to simplify and make more readable the code in lib_arm/board.c.
> If this is considered useful it can be done more seriously to all
> platforms, and allow over time to remove defines in the class of
> BOARD_LATE_INIT.
> 
> A serious reordering will definitely need more time, and this is just
> a quick hack to show the idea; some things are suboptimal like the
> arm_pci_init() thing which has to remain an ifdef and should be fixed
> in a different way (I think all init function should return int
> and print their own messages, to simplify this factoring out, but again
> it's a matter of personal taste).
> 
> About the use of weak, I first converted .a to .o, but then found it
> works nonetheless, and led functions are already weak ones in this file.
> 
> Is the idea worth pursuing? Or does it conflich with other work in
> progress?
I've already send an RFC about initcall

I'm not in favor a weak function as it will increase the size of U-Boot and
will not be easy to use as we seen a lots of time due to compiler issue

so I think the initcall mecansim will be more generic, more easier to use and
smaller than the current implementation (already tested)

Best Regards,
J.

      reply	other threads:[~2009-07-23 21:53 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-22 17:19 [U-Boot] [RFC] arm/board.c: avoid ifdef using weak default functions Alessandro Rubini
2009-07-23 21:53 ` Jean-Christophe PLAGNIOL-VILLARD [this message]

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=20090723215310.GF9480@game.jcrosoft.org \
    --to=plagnioj@jcrosoft.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