From: David Gibson <david@gibson•dropbear.id.au>
To: Jerry Van Baren <gvb.uboot@gmail•com>
Cc: linuxppc-dev@ozlabs•org, jdl@jdl•com
Subject: Re: [PATCH dtc] Fix reserve map output for asm format.
Date: Sun, 15 Apr 2007 10:44:17 +1000 [thread overview]
Message-ID: <20070415004417.GE9104@localhost.localdomain> (raw)
In-Reply-To: <20070414221526.GA23870@dellserver.lan>
On Sat, Apr 14, 2007 at 06:15:27PM -0400, Jerry Van Baren wrote:
> Add extra reserve map slots output for asm format (previously done for dtb
> output).
> Use cmalloc to pre-zero memory (for dtb input) and handle dtb (binary)
> input being shorter than the total blob length (result of putting
> extra space in the blob).
>
> Signed-off-by: Gerald Van Baren <vanbaren@cideas•com>
> ---
>
> Hi Jon:
>
> Some simple fixes for handling extra reserve slots and extra space in
> the blob.
>
> Best regards,
> gvb
>
> dtc.h | 4 ++--
> flattree.c | 14 +++++++++++---
> 2 files changed, 13 insertions(+), 5 deletions(-)
>
> diff --git a/dtc.h b/dtc.h
> index 8cfe1a1..e77f9d1 100644
> --- a/dtc.h
> +++ b/dtc.h
> @@ -55,10 +55,10 @@ static inline void die(char * str, ...)
>
> static inline void *xmalloc(size_t len)
> {
> - void *new = malloc(len);
> + void *new = calloc(len, 1);
>
> if (! new)
> - die("malloc() failed\n");
> + die("calloc() failed\n");
>
> return new;
> }
I'm less that thrilled about this change. There's a semi-standard
definition of "xmalloc()" and using callc() isn't it. I'd prefer the
clearing was done in the caller.
--
David Gibson | I'll have my music baroque, and my code
david AT gibson.dropbear.id.au | minimalist, thank you. NOT _the_ _other_
| _way_ _around_!
http://www.ozlabs.org/~dgibson
prev parent reply other threads:[~2007-04-15 0:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-04-14 22:15 [PATCH dtc] Fix reserve map output for asm format Jerry Van Baren
2007-04-15 0:44 ` David Gibson [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=20070415004417.GE9104@localhost.localdomain \
--to=david@gibson$(echo .)dropbear.id.au \
--cc=gvb.uboot@gmail$(echo .)com \
--cc=jdl@jdl$(echo .)com \
--cc=linuxppc-dev@ozlabs$(echo .)org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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