[U-Boot] [PATCHv4] [RFC] DM: early_malloc for DM added.

Tom Rini trini at ti.com
Wed Sep 19 20:29:32 CEST 2012

On Wed, Sep 19, 2012 at 09:29:04AM +1000, Graeme Russ wrote:
> Hi Marek,
> On Tue, Sep 18, 2012 at 8:57 PM, Marek Vasut <marex at denx.de> wrote:
> > Dear Tomas Hlavacek,
> >> +struct early_heap_header *early_brk(size_t size)
> >> +     __attribute__((weak, alias("def_early_brk")));
> >
> > what about using (it needs <linux/compiler.h>):
> >
> > __weak struct early_heap_header *early_brk(size_t size)
> > {
> > ...
> > body
> > ...
> > }
> We already have a lot of the former - I prefer not to add additional
> semantics (unless you want to do a wholesale search/replace ;))

Migrating everyone but the real tricky uses (alias >=2 functions to one
weak dummy) to the <linux/compiler.h> semantics is something on my TODO
list from ages ago.  So yes please, unless it's a complex case, find and
use the __shortform that <linux/compiler.h> and company provide (and a
git grep for your attribute when in doubt, sometimes it's in
<linux/compiler-gcc.h or so).

And a general I know everyone should know but please, checkpatch.pl your
work before posting.  Getting everyone doing DM series patches to use
patman might be a little bit more overhead (sorry!) but it'll help with
a lot of the little things like formatting and some of the bigger things
like changelog tracking.  Don't have to switch but it might make your
lives easier.


More information about the U-Boot mailing list