diff mbox series

[v2,03/11] riscv: Add headers for asm/global_data.h

Message ID 5203bcac-aea1-ad14-1c8e-e2a699be30b3@gmail.com
State Superseded
Headers show
Series riscv: Add Sipeed Maix support | expand

Commit Message

Sean Anderson Jan. 15, 2020, 10:50 p.m. UTC
This header depended on bd_t and ulong, but did not include the appropriate
headers.

Signed-off-by: Sean Anderson <seanga2 at gmail.com>
---
 arch/riscv/include/asm/global_data.h | 2 ++
 1 file changed, 2 insertions(+)

Comments

Rick Chen Jan. 21, 2020, 2:07 a.m. UTC | #1
Hi Sean,

> From: Sean Anderson [mailto:seanga2 at gmail.com]
> Sent: Thursday, January 16, 2020 6:51 AM
> To: U-Boot Mailing List
> Cc: Rick Jian-Zhi Chen(陳建志)
> Subject: [PATCH v2 03/11] riscv: Add headers for asm/global_data.h
>
> This header depended on bd_t and ulong, but did not include the appropriate headers.
>
> Signed-off-by: Sean Anderson <seanga2 at gmail.com>
> ---
>  arch/riscv/include/asm/global_data.h | 2 ++
>  1 file changed, 2 insertions(+)
>

I wonder why the compiling is OK without those appropriate headers.

Thanks,
Rick

> diff --git a/arch/riscv/include/asm/global_data.h b/arch/riscv/include/asm/global_data.h
> index b74bd7e738..4f0c12b402 100644
> --- a/arch/riscv/include/asm/global_data.h
> +++ b/arch/riscv/include/asm/global_data.h
> @@ -11,6 +11,8 @@
>  #define __ASM_GBL_DATA_H
>
>  #include <asm/smp.h>
> +#include <asm/u-boot.h>
> +#include <linux/compiler.h>
>
>  /* Architecture-specific global data */  struct arch_global_data {
> --
> 2.24.1
>
Sean Anderson Jan. 21, 2020, 2:17 a.m. UTC | #2
> I wonder why the compiling is OK without those appropriate headers.

It's likely that all the uses looked like

#include <this_header_includes_ulong.h>
#include <asm/global_data.h>

So it wasn't noticed until it was included first in some file.
Lukas Auer Jan. 26, 2020, 10:04 p.m. UTC | #3
Hi Sean,


On Wed, 2020-01-15 at 17:50 -0500, Sean Anderson wrote:
> This header depended on bd_t and ulong, but did not include the appropriate
> headers.
> 
> Signed-off-by: Sean Anderson <seanga2 at gmail.com>
> ---
>  arch/riscv/include/asm/global_data.h | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/arch/riscv/include/asm/global_data.h b/arch/riscv/include/asm/global_data.h
> index b74bd7e738..4f0c12b402 100644
> --- a/arch/riscv/include/asm/global_data.h
> +++ b/arch/riscv/include/asm/global_data.h
> @@ -11,6 +11,8 @@
>  #define __ASM_GBL_DATA_H
>  
>  #include <asm/smp.h>
> +#include <asm/u-boot.h>
> +#include <linux/compiler.h>
>  

asm/u-boot.h is usually included with common.h. ulong is defined in
linux/types.h (also included in common.h). It should be sufficient to
include common.h in your source files.

Thanks,
Lukas
Sean Anderson Jan. 26, 2020, 10:12 p.m. UTC | #4
On 1/26/20 5:04 PM, Lukas Auer wrote:
> asm/u-boot.h is usually included with common.h. ulong is defined in
> linux/types.h (also included in common.h). It should be sufficient to
> include common.h in your source files.
> 
> Thanks,
> Lukas

So shouldn't asm/u-boot.h include common.h? Or is that header implicitly
assumed to be included with every source file? Is that documented
anywhere? To me, the "default" assumption is that any header should be
able to be included anywhere and to pull in all of its own dependencies.

--Sean
Lukas Auer Jan. 26, 2020, 10:23 p.m. UTC | #5
On Sun, 2020-01-26 at 17:12 -0500, Sean Anderson wrote:
> On 1/26/20 5:04 PM, Lukas Auer wrote:
> > asm/u-boot.h is usually included with common.h. ulong is defined in
> > linux/types.h (also included in common.h). It should be sufficient to
> > include common.h in your source files.
> > 
> > Thanks,
> > Lukas
> 
> So shouldn't asm/u-boot.h include common.h? Or is that header implicitly
> assumed to be included with every source file? Is that documented
> anywhere? To me, the "default" assumption is that any header should be
> able to be included anywhere and to pull in all of its own dependencies.
> 

You are right, it is not entirely correct like this. I think common.h
is assumed to always be included. Unfortunately, I don't know if this
is documented anywhere.

Thanks,
Lukas
diff mbox series

Patch

diff --git a/arch/riscv/include/asm/global_data.h b/arch/riscv/include/asm/global_data.h
index b74bd7e738..4f0c12b402 100644
--- a/arch/riscv/include/asm/global_data.h
+++ b/arch/riscv/include/asm/global_data.h
@@ -11,6 +11,8 @@ 
 #define __ASM_GBL_DATA_H
 
 #include <asm/smp.h>
+#include <asm/u-boot.h>
+#include <linux/compiler.h>
 
 /* Architecture-specific global data */
 struct arch_global_data {