diff mbox series

[kvm-unit-tests,v2,4/7] arm: unify header guards

Message ID 20210609143712.60933-5-cohuck@redhat.com
State New
Headers show
Series unify header guards | expand

Commit Message

Cornelia Huck June 9, 2021, 2:37 p.m. UTC
The assembler.h files were the only ones not already following
the convention.

Signed-off-by: Cornelia Huck <cohuck@redhat.com>
---
 lib/arm/asm/assembler.h   | 6 +++---
 lib/arm64/asm/assembler.h | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

Comments

David Hildenbrand June 9, 2021, 2:46 p.m. UTC | #1
On 09.06.21 16:37, Cornelia Huck wrote:
> The assembler.h files were the only ones not already following
> the convention.
> 
> Signed-off-by: Cornelia Huck <cohuck@redhat.com>
> ---
>   lib/arm/asm/assembler.h   | 6 +++---
>   lib/arm64/asm/assembler.h | 6 +++---
>   2 files changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/lib/arm/asm/assembler.h b/lib/arm/asm/assembler.h
> index dfd3c51bf6ad..4200252dd14d 100644
> --- a/lib/arm/asm/assembler.h
> +++ b/lib/arm/asm/assembler.h
> @@ -8,8 +8,8 @@
>   #error "Only include this from assembly code"
>   #endif
>   
> -#ifndef __ASM_ASSEMBLER_H
> -#define __ASM_ASSEMBLER_H
> +#ifndef _ASMARM_ASSEMBLER_H_
> +#define _ASMARM_ASSEMBLER_H_
>   
>   /*
>    * dcache_line_size - get the minimum D-cache line size from the CTR register
> @@ -50,4 +50,4 @@
>   	dsb	\domain
>   	.endm
>   
> -#endif	/* __ASM_ASSEMBLER_H */
> +#endif	/* _ASMARM_ASSEMBLER_H_ */
> diff --git a/lib/arm64/asm/assembler.h b/lib/arm64/asm/assembler.h
> index 0a6ab9720bdd..a271e4ceefe6 100644
> --- a/lib/arm64/asm/assembler.h
> +++ b/lib/arm64/asm/assembler.h
> @@ -12,8 +12,8 @@
>   #error "Only include this from assembly code"
>   #endif
>   
> -#ifndef __ASM_ASSEMBLER_H
> -#define __ASM_ASSEMBLER_H
> +#ifndef _ASMARM64_ASSEMBLER_H_
> +#define _ASMARM64_ASSEMBLER_H_
>   
>   /*
>    * raw_dcache_line_size - get the minimum D-cache line size on this CPU
> @@ -51,4 +51,4 @@
>   	dsb	\domain
>   	.endm
>   
> -#endif	/* __ASM_ASSEMBLER_H */
> +#endif	/* _ASMARM64_ASSEMBLER_H_ */
> 

Reviewed-by: David Hildenbrand <david@redhat.com>
Laurent Vivier June 9, 2021, 3:24 p.m. UTC | #2
On 09/06/2021 16:37, Cornelia Huck wrote:
> The assembler.h files were the only ones not already following
> the convention.
> 
> Signed-off-by: Cornelia Huck <cohuck@redhat.com>
> ---
>  lib/arm/asm/assembler.h   | 6 +++---
>  lib/arm64/asm/assembler.h | 6 +++---
>  2 files changed, 6 insertions(+), 6 deletions(-)

What about lib/arm/io.h?

I think you can remove the guard from

lib/arm/asm/memory_areas.h

as the other files including directly a header doesn't guard it.

Missing lib/arm/asm/mmu-api.h, lib/arm/asm/mmu.h, lib/arm64/asm/mmu.h

Thanks,
Laurent

> 
> diff --git a/lib/arm/asm/assembler.h b/lib/arm/asm/assembler.h
> index dfd3c51bf6ad..4200252dd14d 100644
> --- a/lib/arm/asm/assembler.h
> +++ b/lib/arm/asm/assembler.h
> @@ -8,8 +8,8 @@
>  #error "Only include this from assembly code"
>  #endif
>  
> -#ifndef __ASM_ASSEMBLER_H
> -#define __ASM_ASSEMBLER_H
> +#ifndef _ASMARM_ASSEMBLER_H_
> +#define _ASMARM_ASSEMBLER_H_
>  
>  /*
>   * dcache_line_size - get the minimum D-cache line size from the CTR register
> @@ -50,4 +50,4 @@
>  	dsb	\domain
>  	.endm
>  
> -#endif	/* __ASM_ASSEMBLER_H */
> +#endif	/* _ASMARM_ASSEMBLER_H_ */
> diff --git a/lib/arm64/asm/assembler.h b/lib/arm64/asm/assembler.h
> index 0a6ab9720bdd..a271e4ceefe6 100644
> --- a/lib/arm64/asm/assembler.h
> +++ b/lib/arm64/asm/assembler.h
> @@ -12,8 +12,8 @@
>  #error "Only include this from assembly code"
>  #endif
>  
> -#ifndef __ASM_ASSEMBLER_H
> -#define __ASM_ASSEMBLER_H
> +#ifndef _ASMARM64_ASSEMBLER_H_
> +#define _ASMARM64_ASSEMBLER_H_
>  
>  /*
>   * raw_dcache_line_size - get the minimum D-cache line size on this CPU
> @@ -51,4 +51,4 @@
>  	dsb	\domain
>  	.endm
>  
> -#endif	/* __ASM_ASSEMBLER_H */
> +#endif	/* _ASMARM64_ASSEMBLER_H_ */
>
Cornelia Huck June 9, 2021, 3:47 p.m. UTC | #3
On Wed, Jun 09 2021, Laurent Vivier <lvivier@redhat.com> wrote:

> On 09/06/2021 16:37, Cornelia Huck wrote:
>> The assembler.h files were the only ones not already following
>> the convention.
>> 
>> Signed-off-by: Cornelia Huck <cohuck@redhat.com>
>> ---
>>  lib/arm/asm/assembler.h   | 6 +++---
>>  lib/arm64/asm/assembler.h | 6 +++---
>>  2 files changed, 6 insertions(+), 6 deletions(-)
>
> What about lib/arm/io.h?

It didn't have a guard yet, so I didn't touch it.

>
> I think you can remove the guard from
>
> lib/arm/asm/memory_areas.h
>
> as the other files including directly a header doesn't guard it.

I see other architectures doing that, though. I guess it doesn't hurt,
but we can certainly also remove it. Other opinions?

>
> Missing lib/arm/asm/mmu-api.h, lib/arm/asm/mmu.h, lib/arm64/asm/mmu.h

Oops, overlooked the extra underscore there.
Laurent Vivier June 9, 2021, 3:51 p.m. UTC | #4
On 09/06/2021 17:47, Cornelia Huck wrote:
> On Wed, Jun 09 2021, Laurent Vivier <lvivier@redhat.com> wrote:
> 
>> On 09/06/2021 16:37, Cornelia Huck wrote:
>>> The assembler.h files were the only ones not already following
>>> the convention.
>>>
>>> Signed-off-by: Cornelia Huck <cohuck@redhat.com>
>>> ---
>>>  lib/arm/asm/assembler.h   | 6 +++---
>>>  lib/arm64/asm/assembler.h | 6 +++---
>>>  2 files changed, 6 insertions(+), 6 deletions(-)
>>
>> What about lib/arm/io.h?
> 
> It didn't have a guard yet, so I didn't touch it.
> 
>>
>> I think you can remove the guard from
>>
>> lib/arm/asm/memory_areas.h
>>
>> as the other files including directly a header doesn't guard it.
> 
> I see other architectures doing that, though. I guess it doesn't hurt,
> but we can certainly also remove it. Other opinions?

It doesn't hurt to remove it but I think what is important is to have the same rule
everywhere.

Thanks,
Laurent
diff mbox series

Patch

diff --git a/lib/arm/asm/assembler.h b/lib/arm/asm/assembler.h
index dfd3c51bf6ad..4200252dd14d 100644
--- a/lib/arm/asm/assembler.h
+++ b/lib/arm/asm/assembler.h
@@ -8,8 +8,8 @@ 
 #error "Only include this from assembly code"
 #endif
 
-#ifndef __ASM_ASSEMBLER_H
-#define __ASM_ASSEMBLER_H
+#ifndef _ASMARM_ASSEMBLER_H_
+#define _ASMARM_ASSEMBLER_H_
 
 /*
  * dcache_line_size - get the minimum D-cache line size from the CTR register
@@ -50,4 +50,4 @@ 
 	dsb	\domain
 	.endm
 
-#endif	/* __ASM_ASSEMBLER_H */
+#endif	/* _ASMARM_ASSEMBLER_H_ */
diff --git a/lib/arm64/asm/assembler.h b/lib/arm64/asm/assembler.h
index 0a6ab9720bdd..a271e4ceefe6 100644
--- a/lib/arm64/asm/assembler.h
+++ b/lib/arm64/asm/assembler.h
@@ -12,8 +12,8 @@ 
 #error "Only include this from assembly code"
 #endif
 
-#ifndef __ASM_ASSEMBLER_H
-#define __ASM_ASSEMBLER_H
+#ifndef _ASMARM64_ASSEMBLER_H_
+#define _ASMARM64_ASSEMBLER_H_
 
 /*
  * raw_dcache_line_size - get the minimum D-cache line size on this CPU
@@ -51,4 +51,4 @@ 
 	dsb	\domain
 	.endm
 
-#endif	/* __ASM_ASSEMBLER_H */
+#endif	/* _ASMARM64_ASSEMBLER_H_ */