diff mbox series

[U-Boot,1/1] hush: re-sequence includes

Message ID 20191026214508.20532-1-xypron.glpk@gmx.de
State Accepted
Commit 68c0912bf25d71e48f0775051b58443ad35faf23
Delegated to: Tom Rini
Headers show
Series [U-Boot,1/1] hush: re-sequence includes | expand

Commit Message

Heinrich Schuchardt Oct. 26, 2019, 9:45 p.m. UTC
'make tests' on a 32bit ARM system leads to

In file included from ../common/cli_hush.c:79:
../include/malloc.h:364:7: error: conflicting types for ‘memset’
 void* memset(void*, int, size_t);
       ^~~~~~
In file included from ../include/compiler.h:126,
                 from ../include/env.h:12,
                 from ../common/cli_hush.c:78:
../include/linux/string.h:103:15:
note: previous declaration of ‘memset’ was here
 extern void * memset(void *,int,__kernel_size_t);
               ^~~~~~
In file included from ../common/cli_hush.c:79:
../include/malloc.h:365:7: error: conflicting types for ‘memcpy’
 void* memcpy(void*, const void*, size_t);
       ^~~~~~
In file included from ../include/compiler.h:126,
                 from ../include/env.h:12,
                 from ../common/cli_hush.c:78:
../include/linux/string.h:106:15:
note: previous declaration of ‘memcpy’ was here
 extern void * memcpy(void *,const void *,__kernel_size_t);
        ^~~~~~

According to the U-Boot coding style guide common.h should be the first
include.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
---
 common/cli_hush.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--
2.20.1

Comments

Tom Rini Nov. 8, 2019, 3:33 p.m. UTC | #1
On Sat, Oct 26, 2019 at 11:45:08PM +0200, Heinrich Schuchardt wrote:

> 'make tests' on a 32bit ARM system leads to
> 
> In file included from ../common/cli_hush.c:79:
> ../include/malloc.h:364:7: error: conflicting types for ‘memset’
>  void* memset(void*, int, size_t);
>        ^~~~~~
> In file included from ../include/compiler.h:126,
>                  from ../include/env.h:12,
>                  from ../common/cli_hush.c:78:
> ../include/linux/string.h:103:15:
> note: previous declaration of ‘memset’ was here
>  extern void * memset(void *,int,__kernel_size_t);
>                ^~~~~~
> In file included from ../common/cli_hush.c:79:
> ../include/malloc.h:365:7: error: conflicting types for ‘memcpy’
>  void* memcpy(void*, const void*, size_t);
>        ^~~~~~
> In file included from ../include/compiler.h:126,
>                  from ../include/env.h:12,
>                  from ../common/cli_hush.c:78:
> ../include/linux/string.h:106:15:
> note: previous declaration of ‘memcpy’ was here
>  extern void * memcpy(void *,const void *,__kernel_size_t);
>         ^~~~~~
> 
> According to the U-Boot coding style guide common.h should be the first
> include.
> 
> Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>

Applied to u-boot/master, thanks!
diff mbox series

Patch

diff --git a/common/cli_hush.c b/common/cli_hush.c
index 8f86e4aa4a..cf1e273485 100644
--- a/common/cli_hush.c
+++ b/common/cli_hush.c
@@ -75,10 +75,10 @@ 

 #define __U_BOOT__
 #ifdef __U_BOOT__
+#include <common.h>         /* readline */
 #include <env.h>
 #include <malloc.h>         /* malloc, free, realloc*/
 #include <linux/ctype.h>    /* isalpha, isdigit */
-#include <common.h>        /* readline */
 #include <console.h>
 #include <bootretry.h>
 #include <cli.h>