diff mbox series

[kvm-unit-tests,v2,1/7] README.md: add guideline for header guards format

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

Commit Message

Cornelia Huck June 9, 2021, 2:37 p.m. UTC
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
---
 README.md | 9 +++++++++
 1 file changed, 9 insertions(+)

Comments

David Hildenbrand June 9, 2021, 2:45 p.m. UTC | #1
On 09.06.21 16:37, Cornelia Huck wrote:
> Signed-off-by: Cornelia Huck <cohuck@redhat.com>
> ---
>   README.md | 9 +++++++++
>   1 file changed, 9 insertions(+)
> 
> diff --git a/README.md b/README.md
> index 24d4bdaaee0d..687ff50d0af1 100644
> --- a/README.md
> +++ b/README.md
> @@ -156,6 +156,15 @@ Exceptions:
>   
>     - While the kernel standard requires 80 columns, we allow up to 120.
>   
> +Header guards:
> +
> +Please try to adhere to adhere to the following patterns when adding
> +"#ifndef <...> #define <...>" header guards:
> +    ./lib:             _HEADER_H_
> +    ./lib/<ARCH>:      _ARCH_HEADER_H_
> +    ./lib/<ARCH>/asm:  _ASMARCH_HEADER_H_

I'd have used _ARCH_ASM_HEADER_H_

Reviewed-by: David Hildenbrand <david@redhat.com>
Laurent Vivier June 9, 2021, 3 p.m. UTC | #2
On 09/06/2021 16:37, Cornelia Huck wrote:
> Signed-off-by: Cornelia Huck <cohuck@redhat.com>
> ---
>  README.md | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/README.md b/README.md
> index 24d4bdaaee0d..687ff50d0af1 100644
> --- a/README.md
> +++ b/README.md
> @@ -156,6 +156,15 @@ Exceptions:
>  
>    - While the kernel standard requires 80 columns, we allow up to 120.
>  
> +Header guards:
> +
> +Please try to adhere to adhere to the following patterns when adding
> +"#ifndef <...> #define <...>" header guards:
> +    ./lib:             _HEADER_H_
> +    ./lib/<ARCH>:      _ARCH_HEADER_H_
> +    ./lib/<ARCH>/asm:  _ASMARCH_HEADER_H_
> +    ./<ARCH>:          ARCH_HEADER_H
> +
>  ## Patches
>  
>  Patches are welcome at the KVM mailing list <kvm@vger.kernel.org>.
> 

Reviewed-by: Laurent Vivier <lvivier@redhat.com>
Cornelia Huck June 9, 2021, 3:19 p.m. UTC | #3
On Wed, Jun 09 2021, David Hildenbrand <david@redhat.com> wrote:

> On 09.06.21 16:37, Cornelia Huck wrote:
>> Signed-off-by: Cornelia Huck <cohuck@redhat.com>
>> ---
>>   README.md | 9 +++++++++
>>   1 file changed, 9 insertions(+)
>> 
>> diff --git a/README.md b/README.md
>> index 24d4bdaaee0d..687ff50d0af1 100644
>> --- a/README.md
>> +++ b/README.md
>> @@ -156,6 +156,15 @@ Exceptions:
>>   
>>     - While the kernel standard requires 80 columns, we allow up to 120.
>>   
>> +Header guards:
>> +
>> +Please try to adhere to adhere to the following patterns when adding
>> +"#ifndef <...> #define <...>" header guards:
>> +    ./lib:             _HEADER_H_
>> +    ./lib/<ARCH>:      _ARCH_HEADER_H_
>> +    ./lib/<ARCH>/asm:  _ASMARCH_HEADER_H_
>
> I'd have used _ARCH_ASM_HEADER_H_

I had that first, but the pattern I ended up using caused way less churn
(this is basically what arm[64] uses.)

>
> Reviewed-by: David Hildenbrand <david@redhat.com>

Thanks!
Andrew Jones June 14, 2021, 9:01 a.m. UTC | #4
On Wed, Jun 09, 2021 at 04:37:06PM +0200, Cornelia Huck wrote:
> Signed-off-by: Cornelia Huck <cohuck@redhat.com>
> ---
>  README.md | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/README.md b/README.md
> index 24d4bdaaee0d..687ff50d0af1 100644
> --- a/README.md
> +++ b/README.md
> @@ -156,6 +156,15 @@ Exceptions:
>  
>    - While the kernel standard requires 80 columns, we allow up to 120.
>  
> +Header guards:
> +
> +Please try to adhere to adhere to the following patterns when adding

Double 'to adhere'

Thanks,
drew

> +"#ifndef <...> #define <...>" header guards:
> +    ./lib:             _HEADER_H_
> +    ./lib/<ARCH>:      _ARCH_HEADER_H_
> +    ./lib/<ARCH>/asm:  _ASMARCH_HEADER_H_
> +    ./<ARCH>:          ARCH_HEADER_H
> +
>  ## Patches
>  
>  Patches are welcome at the KVM mailing list <kvm@vger.kernel.org>.
> -- 
> 2.31.1
>
diff mbox series

Patch

diff --git a/README.md b/README.md
index 24d4bdaaee0d..687ff50d0af1 100644
--- a/README.md
+++ b/README.md
@@ -156,6 +156,15 @@  Exceptions:
 
   - While the kernel standard requires 80 columns, we allow up to 120.
 
+Header guards:
+
+Please try to adhere to adhere to the following patterns when adding
+"#ifndef <...> #define <...>" header guards:
+    ./lib:             _HEADER_H_
+    ./lib/<ARCH>:      _ARCH_HEADER_H_
+    ./lib/<ARCH>/asm:  _ASMARCH_HEADER_H_
+    ./<ARCH>:          ARCH_HEADER_H
+
 ## Patches
 
 Patches are welcome at the KVM mailing list <kvm@vger.kernel.org>.