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

2020-01-26 Thread Lukas Auer
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


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

2020-01-26 Thread Sean Anderson
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


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

2020-01-26 Thread Lukas Auer
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 
> ---
>  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 
> +#include 
> +#include 
>  

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


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

2020-01-20 Thread Sean Anderson
> I wonder why the compiling is OK without those appropriate headers.

It's likely that all the uses looked like

#include 
#include 

So it wasn't noticed until it was included first in some file.


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

2020-01-20 Thread Rick Chen
Hi Sean,

> From: Sean Anderson [mailto:sean...@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 
> ---
>  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 
> +#include 
> +#include 
>
>  /* Architecture-specific global data */  struct arch_global_data {
> --
> 2.24.1
>