diff mbox

[U-Boot,2/5] libfdt_env.h: Add <malloc.h> in libfdt environment

Message ID 1498839782-4702-3-git-send-email-pantelis.antoniou@konsulko.com
State Deferred
Delegated to: Simon Glass
Headers show

Commit Message

Pantelis Antoniou June 30, 2017, 4:22 p.m. UTC
Overlays require malloc so add it in the libfdt environment.

Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
---
 include/libfdt_env.h | 1 +
 1 file changed, 1 insertion(+)

Comments

Marek Vasut July 1, 2017, 2:02 p.m. UTC | #1
On 06/30/2017 06:22 PM, Pantelis Antoniou wrote:
> Overlays require malloc so add it in the libfdt environment.

Include this where it's actually used, not in some header.

> Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
> ---
>  include/libfdt_env.h | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/include/libfdt_env.h b/include/libfdt_env.h
> index 6c6845f..59463c0 100644
> --- a/include/libfdt_env.h
> +++ b/include/libfdt_env.h
> @@ -27,6 +27,7 @@ typedef __be64 fdt64_t;
>  #include <vsprintf.h>
>  
>  #define strtoul(cp, endp, base)	simple_strtoul(cp, endp, base)
> +#include <malloc.h>
>  #endif
>  
>  /* adding a ramdisk needs 0x44 bytes in version 2008.10 */
>
Pantelis Antoniou July 4, 2017, 4:53 p.m. UTC | #2
Hi Marek,

On Sat, 2017-07-01 at 16:02 +0200, Marek Vasut wrote:
> On 06/30/2017 06:22 PM, Pantelis Antoniou wrote:
> > Overlays require malloc so add it in the libfdt environment.
> 
> Include this where it's actually used, not in some header.
> 

This follows the same method of libfdt adaption layer, that all required
headers are placed in the libfdt_env.h file so that upreving to a new
libfdt version is less painful.

Sorry, libfdt is not normal u-boot code :)

> > Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
> > ---
> >  include/libfdt_env.h | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/include/libfdt_env.h b/include/libfdt_env.h
> > index 6c6845f..59463c0 100644
> > --- a/include/libfdt_env.h
> > +++ b/include/libfdt_env.h
> > @@ -27,6 +27,7 @@ typedef __be64 fdt64_t;
> >  #include <vsprintf.h>
> >  
> >  #define strtoul(cp, endp, base)	simple_strtoul(cp, endp, base)
> > +#include <malloc.h>
> >  #endif
> >  
> >  /* adding a ramdisk needs 0x44 bytes in version 2008.10 */
> > 
> 
> 

Regards

-- Pantelis
Simon Glass July 7, 2017, 3:58 a.m. UTC | #3
On 30 June 2017 at 10:22, Pantelis Antoniou
<pantelis.antoniou@konsulko.com> wrote:
> Overlays require malloc so add it in the libfdt environment.
>
> Signed-off-by: Pantelis Antoniou <pantelis.antoniou@konsulko.com>
> ---
>  include/libfdt_env.h | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/include/libfdt_env.h b/include/libfdt_env.h
> index 6c6845f..59463c0 100644
> --- a/include/libfdt_env.h
> +++ b/include/libfdt_env.h
> @@ -27,6 +27,7 @@ typedef __be64 fdt64_t;
>  #include <vsprintf.h>
>
>  #define strtoul(cp, endp, base)        simple_strtoul(cp, endp, base)
> +#include <malloc.h>
>  #endif
>
>  /* adding a ramdisk needs 0x44 bytes in version 2008.10 */
> --
> 2.1.4
>

Reviewed-by: Simon Glass <sjg@chromium.org>
diff mbox

Patch

diff --git a/include/libfdt_env.h b/include/libfdt_env.h
index 6c6845f..59463c0 100644
--- a/include/libfdt_env.h
+++ b/include/libfdt_env.h
@@ -27,6 +27,7 @@  typedef __be64 fdt64_t;
 #include <vsprintf.h>
 
 #define strtoul(cp, endp, base)	simple_strtoul(cp, endp, base)
+#include <malloc.h>
 #endif
 
 /* adding a ramdisk needs 0x44 bytes in version 2008.10 */