Skip to contentSkip to conversation

unify header guards

PATCH Applied Cornelia Huck 5 participants 28 messages Jun 9, 2021 – Jun 14, 2021

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

v2 cover unify header guards

This is an extension of "s390x: unify header guards" to the rest of kvm-unit-tests. I tried to choose a pattern that minimizes the changes; most of them are for s390x and x86.

v1->v2:
- change the patterns and document them
- change other architectures and architecture-independent code as well

Cornelia Huck (7):
README.md: add guideline for header guards format
lib: unify header guards
asm-generic: unify header guards
arm: unify header guards
powerpc: unify header guards
s390x: unify header guards
x86: unify header guards

 README.md                         | 9 +++++++++
 lib/alloc_page.h                  | 4 ++--
 lib/arm/asm/assembler.h           | 6 +++---
 lib/arm64/asm/assembler.h         | 6 +++---
 lib/asm-generic/atomic.h          | 4 ++--
 lib/asm-generic/barrier.h         | 6 +++---
 lib/asm-generic/memory_areas.h    | 4 ++--
 lib/asm-generic/pci-host-bridge.h | 4 ++--
 lib/libcflat.h                    | 4 ++--
 lib/list.h                        | 4 ++--
 lib/pci-edu.h                     | 4 ++--
 lib/pci-host-generic.h            | 4 ++--
 lib/s390x/asm/arch_def.h          | 4 ++--
 lib/s390x/asm/barrier.h           | 4 ++--
 lib/s390x/asm/cpacf.h             | 6 +++---
 lib/s390x/asm/facility.h          | 4 ++--
 lib/s390x/asm/float.h             | 4 ++--
 lib/s390x/asm/mem.h               | 4 ++--
 lib/s390x/asm/sigp.h              | 6 +++---
 lib/s390x/asm/spinlock.h          | 4 ++--
 lib/s390x/asm/time.h              | 4 ++--
 lib/s390x/asm/uv.h                | 4 ++--
 lib/s390x/css.h                   | 4 ++--
 lib/s390x/interrupt.h             | 4 ++--
 lib/s390x/mmu.h                   | 4 ++--
 lib/s390x/sclp.h                  | 6 +++---
 lib/s390x/sie.h                   | 6 +++---
 lib/s390x/smp.h                   | 4 ++--
 lib/s390x/uv.h                    | 4 ++--
 lib/s390x/vm.h                    | 6 +++---
 lib/setjmp.h                      | 4 ++--
 lib/string.h                      | 6 +++---
 lib/vmalloc.h                     | 4 ++--
 lib/x86/acpi.h                    | 4 ++--
 lib/x86/apic-defs.h               | 6 +++---
 lib/x86/apic.h                    | 4 ++--
 lib/x86/asm/barrier.h             | 4 ++--
 lib/x86/asm/debugreg.h            | 6 +++---
 lib/x86/asm/io.h                  | 4 ++--
 lib/x86/asm/memory_areas.h        | 4 ++--
 lib/x86/asm/page.h                | 4 ++--
 lib/x86/asm/pci.h                 | 4 ++--
 lib/x86/asm/spinlock.h            | 4 ++--
 lib/x86/asm/stack.h               | 4 ++--
 lib/x86/atomic.h                  | 4 ++--
 lib/x86/delay.h                   | 4 ++--
 lib/x86/desc.h                    | 4 ++--
 lib/x86/fault_test.h              | 4 ++--
 lib/x86/fwcfg.h                   | 4 ++--
 lib/x86/intel-iommu.h             | 4 ++--
 lib/x86/isr.h                     | 4 ++--
 lib/x86/msr.h                     | 6 +++---
 lib/x86/processor.h               | 4 ++--
 lib/x86/smp.h                     | 4 ++--
 lib/x86/usermode.h                | 4 ++--
 lib/x86/vm.h                      | 4 ++--
 powerpc/spapr.h                   | 6 +++---
 s390x/sthyi.h                     | 4 ++--
 x86/hyperv.h                      | 4 ++--
 x86/ioram.h                       | 4 ++--
 x86/kvmclock.h                    | 4 ++--
 x86/svm.h                         | 4 ++--
 x86/types.h                       | 4 ++--
 x86/vmx.h                         | 4 ++--
 64 files changed, 148 insertions(+), 139 deletions(-)
Signature · 1 line
2.31.1
#1 lore raw

PATCH v2 1/7 README.md: add guideline for header guards format

---
 README.md | 9 +++++++++
 1 file changed, 9 insertions(+)
README.md +9 -0
index 24d4bdaaee0d..687ff50d0af1 100644
@@ -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 <[email protected]>.
Signature · 1 line
2.31.1
Reviewed-by on v2 1/7
#2 lore raw

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

Quoted 10 lines · Cornelia Huck
---
  README.md | 9 +++++++++
  1 file changed, 9 insertions(+)
README.md +0 -0
index 24d4bdaaee0d..687ff50d0af1 100644

README.md Exceptions: · line 165

Quoted 10 lines
README.md +7 -0
@@ -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_

Signature · 3 lines
Thanks,

David / dhildenb
#3 lore raw

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

Quoted 14 lines · David Hildenbrand
Quoted 13 lines · Cornelia Huck
---
  README.md | 9 +++++++++
  1 file changed, 9 insertions(+)
README.md +0 -0
index 24d4bdaaee0d..687ff50d0af1 100644
@@ -156,6 +156,15 @@ Exceptions:
 
    - While the kernel standard requires 80 columns, we allow up to 120.
 
Quoted 9 lines

README.md Exceptions: · line 165

Quoted 7 lines
README.md +7 -0
+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.)

Quoted 2 lines

Thanks!

Reviewed-by on v2 1/7
#4 lore raw

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

In reply to Cornelia Huck
Quoted 16 lines · Cornelia Huck
---
 README.md | 9 +++++++++
 1 file changed, 9 insertions(+)
README.md +2 -0
index 24d4bdaaee0d..687ff50d0af1 100644
@@ -156,6 +156,15 @@ Exceptions:
 
   - While the kernel standard requires 80 columns, we allow up to 120.
 
+Header guards:
+

README.md Exceptions: · line 170

Quoted 10 lines
README.md +7 -0
+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 <[email protected]>.
#5 lore raw

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

In reply to Cornelia Huck
Quoted 10 lines · Cornelia Huck
---
 README.md | 9 +++++++++
 1 file changed, 9 insertions(+)
README.md +0 -0
index 24d4bdaaee0d..687ff50d0af1 100644

README.md Exceptions: · line 161

Quoted 6 lines
README.md +3 -0
@@ -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

Quoted 12 lines
README.md +6 -0
+"#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 <[email protected]>.
Signature · 1 line
2.31.1
#6 lore raw

PATCH v2 2/7 lib: unify header guards

In reply to Cornelia Huck

Standardize header guards to _LIB_HEADER_H_.

---
 lib/alloc_page.h       | 4 ++--
 lib/libcflat.h         | 4 ++--
 lib/list.h             | 4 ++--
 lib/pci-edu.h          | 4 ++--
 lib/pci-host-generic.h | 4 ++--
 lib/setjmp.h           | 4 ++--
 lib/string.h           | 6 +++---
 lib/vmalloc.h          | 4 ++--
 8 files changed, 17 insertions(+), 17 deletions(-)
lib/alloc_page.h +2 -2
index 1af1419d49b6..eed2ba06eeaf 100644
@@ -5,8 +5,8 @@
  * with byte granularity.
  */
 
-#ifndef ALLOC_PAGE_H
-#define ALLOC_PAGE_H 1
+#ifndef _ALLOC_PAGE_H_
+#define _ALLOC_PAGE_H_
 
 #include <stdbool.h>
 #include <asm/memory_areas.h>
lib/libcflat.h +2 -2
index 460a1234ea6a..f40b431d1550 100644
@@ -17,8 +17,8 @@
  * Authors: Hollis Blanchard <[email protected]>
  */
 
-#ifndef __LIBCFLAT_H
-#define __LIBCFLAT_H
+#ifndef _LIBCFLAT_H_
+#define _LIBCFLAT_H_
 
 #ifndef __ASSEMBLY__
 
lib/list.h +2 -2
index 7f9717ef6258..ed3e52b40075 100644
@@ -1,5 +1,5 @@
-#ifndef LIST_H
-#define LIST_H
+#ifndef _LIST_H_
+#define _LIST_H_
 
 #include <stdbool.h>
 
lib/pci-edu.h +2 -2
index 44b4ba168768..9db94aec0bc7 100644
@@ -12,8 +12,8 @@
  * Edu device is a virtualized device in QEMU. Please refer to
  * docs/specs/edu.txt in QEMU repository for EDU device manual.
  */
-#ifndef __PCI_EDU_H__
-#define __PCI_EDU_H__
+#ifndef _PCI_EDU_H_
+#define _PCI_EDU_H_
 
 #include "pci.h"
 #include "asm/io.h"
lib/pci-host-generic.h +2 -2
index 0ffe6380ec8f..3020ee22c837 100644
@@ -1,5 +1,5 @@
-#ifndef PCI_HOST_GENERIC_H
-#define PCI_HOST_GENERIC_H
+#ifndef _PCI_HOST_GENERIC_H_
+#define _PCI_HOST_GENERIC_H_
 /*
  * PCI host bridge supporting structures and constants
  *
lib/setjmp.h +2 -2
index 2c56b4c68aaa..6afdf665681a 100644
@@ -4,8 +4,8 @@
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU Library General Public License version 2.
  */
-#ifndef LIBCFLAT_SETJMP_H
-#define LIBCFLAT_SETJMP_H 1
+#ifndef _LIBCFLAT_SETJMP_H_
+#define _LIBCFLAT_SETJMP_H_
 
 typedef struct jmp_buf_tag {
 	long int regs[8];
lib/string.h +3 -3
index e1febfed7fb2..b07763eaef10 100644
@@ -4,8 +4,8 @@
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU Library General Public License version 2.
  */
-#ifndef __STRING_H
-#define __STRING_H
+#ifndef _STRING_H_
+#define _STRING_H_
 
 extern size_t strlen(const char *buf);
 extern size_t strnlen(const char *buf, size_t maxlen);
@@ -23,4 +23,4 @@ extern int memcmp(const void *s1, const void *s2, size_t n);
 extern void *memmove(void *dest, const void *src, size_t n);
 extern void *memchr(const void *s, int c, size_t n);
 
-#endif /* _STRING_H */
+#endif /* _STRING_H_ */
lib/vmalloc.h +2 -2
index 8b158f591d75..346f94f198c5 100644
@@ -1,5 +1,5 @@
-#ifndef VMALLOC_H
-#define VMALLOC_H 1
+#ifndef _VMALLOC_H_
+#define _VMALLOC_H_
 
 #include <asm/page.h>
 
Signature · 1 line
2.31.1
Reviewed-by on v2 2/7
#7 lore raw

Re: [kvm-unit-tests PATCH v2 2/7] lib: unify header guards

Quoted 125 lines · Cornelia Huck

Standardize header guards to _LIB_HEADER_H_.

---
  lib/alloc_page.h       | 4 ++--
  lib/libcflat.h         | 4 ++--
  lib/list.h             | 4 ++--
  lib/pci-edu.h          | 4 ++--
  lib/pci-host-generic.h | 4 ++--
  lib/setjmp.h           | 4 ++--
  lib/string.h           | 6 +++---
  lib/vmalloc.h          | 4 ++--
  8 files changed, 17 insertions(+), 17 deletions(-)
lib/alloc_page.h +2 -2
index 1af1419d49b6..eed2ba06eeaf 100644
@@ -5,8 +5,8 @@
   * with byte granularity.
   */
 
-#ifndef ALLOC_PAGE_H
-#define ALLOC_PAGE_H 1
+#ifndef _ALLOC_PAGE_H_
+#define _ALLOC_PAGE_H_
 
  #include <stdbool.h>
  #include <asm/memory_areas.h>
lib/libcflat.h +2 -2
index 460a1234ea6a..f40b431d1550 100644
@@ -17,8 +17,8 @@
   * Authors: Hollis Blanchard <[email protected]>
   */
 
-#ifndef __LIBCFLAT_H
-#define __LIBCFLAT_H
+#ifndef _LIBCFLAT_H_
+#define _LIBCFLAT_H_
 
  #ifndef __ASSEMBLY__
 
lib/list.h +2 -2
index 7f9717ef6258..ed3e52b40075 100644
@@ -1,5 +1,5 @@
-#ifndef LIST_H
-#define LIST_H
+#ifndef _LIST_H_
+#define _LIST_H_
 
  #include <stdbool.h>
 
lib/pci-edu.h +2 -2
index 44b4ba168768..9db94aec0bc7 100644
@@ -12,8 +12,8 @@
   * Edu device is a virtualized device in QEMU. Please refer to
   * docs/specs/edu.txt in QEMU repository for EDU device manual.
   */
-#ifndef __PCI_EDU_H__
-#define __PCI_EDU_H__
+#ifndef _PCI_EDU_H_
+#define _PCI_EDU_H_
 
  #include "pci.h"
  #include "asm/io.h"
lib/pci-host-generic.h +2 -2
index 0ffe6380ec8f..3020ee22c837 100644
@@ -1,5 +1,5 @@
-#ifndef PCI_HOST_GENERIC_H
-#define PCI_HOST_GENERIC_H
+#ifndef _PCI_HOST_GENERIC_H_
+#define _PCI_HOST_GENERIC_H_
  /*
   * PCI host bridge supporting structures and constants
   *
lib/setjmp.h +2 -2
index 2c56b4c68aaa..6afdf665681a 100644
@@ -4,8 +4,8 @@
   * This code is free software; you can redistribute it and/or modify it
   * under the terms of the GNU Library General Public License version 2.
   */
-#ifndef LIBCFLAT_SETJMP_H
-#define LIBCFLAT_SETJMP_H 1
+#ifndef _LIBCFLAT_SETJMP_H_
+#define _LIBCFLAT_SETJMP_H_
 
  typedef struct jmp_buf_tag {
  	long int regs[8];
lib/string.h +3 -3
index e1febfed7fb2..b07763eaef10 100644
@@ -4,8 +4,8 @@
   * This code is free software; you can redistribute it and/or modify it
   * under the terms of the GNU Library General Public License version 2.
   */
-#ifndef __STRING_H
-#define __STRING_H
+#ifndef _STRING_H_
+#define _STRING_H_
 
  extern size_t strlen(const char *buf);
  extern size_t strnlen(const char *buf, size_t maxlen);
@@ -23,4 +23,4 @@ extern int memcmp(const void *s1, const void *s2, size_t n);
  extern void *memmove(void *dest, const void *src, size_t n);
  extern void *memchr(const void *s, int c, size_t n);
 
-#endif /* _STRING_H */
+#endif /* _STRING_H_ */
lib/vmalloc.h +0 -0
index 8b158f591d75..346f94f198c5 100644

lib/vmalloc.h line 5

Quoted 7 lines
lib/vmalloc.h +2 -2
@@ -1,5 +1,5 @@
-#ifndef VMALLOC_H
-#define VMALLOC_H 1
+#ifndef _VMALLOC_H_
+#define _VMALLOC_H_
 
  #include <asm/page.h>
 
Signature · 3 lines
Thanks,

David / dhildenb
#8 lore raw

Re: [kvm-unit-tests PATCH v2 2/7] lib: unify header guards

In reply to Cornelia Huck
Quoted 13 lines · Cornelia Huck

Standardize header guards to _LIB_HEADER_H_.

---
 lib/alloc_page.h       | 4 ++--
 lib/libcflat.h         | 4 ++--
 lib/list.h             | 4 ++--
 lib/pci-edu.h          | 4 ++--
 lib/pci-host-generic.h | 4 ++--
 lib/setjmp.h           | 4 ++--
 lib/string.h           | 6 +++---
 lib/vmalloc.h          | 4 ++--
 8 files changed, 17 insertions(+), 17 deletions(-)

What about lib/argv.h and lib/pci.h?

And there is also this instance of CONFIG_H in lib/config.h generated by configure.

Thanks,
Laurent

Quoted 119 lines
lib/alloc_page.h +2 -2
index 1af1419d49b6..eed2ba06eeaf 100644
@@ -5,8 +5,8 @@
  * with byte granularity.
  */
 
-#ifndef ALLOC_PAGE_H
-#define ALLOC_PAGE_H 1
+#ifndef _ALLOC_PAGE_H_
+#define _ALLOC_PAGE_H_
 
 #include <stdbool.h>
 #include <asm/memory_areas.h>
lib/libcflat.h +2 -2
index 460a1234ea6a..f40b431d1550 100644
@@ -17,8 +17,8 @@
  * Authors: Hollis Blanchard <[email protected]>
  */
 
-#ifndef __LIBCFLAT_H
-#define __LIBCFLAT_H
+#ifndef _LIBCFLAT_H_
+#define _LIBCFLAT_H_
 
 #ifndef __ASSEMBLY__
 
lib/list.h +2 -2
index 7f9717ef6258..ed3e52b40075 100644
@@ -1,5 +1,5 @@
-#ifndef LIST_H
-#define LIST_H
+#ifndef _LIST_H_
+#define _LIST_H_
 
 #include <stdbool.h>
 
lib/pci-edu.h +2 -2
index 44b4ba168768..9db94aec0bc7 100644
@@ -12,8 +12,8 @@
  * Edu device is a virtualized device in QEMU. Please refer to
  * docs/specs/edu.txt in QEMU repository for EDU device manual.
  */
-#ifndef __PCI_EDU_H__
-#define __PCI_EDU_H__
+#ifndef _PCI_EDU_H_
+#define _PCI_EDU_H_
 
 #include "pci.h"
 #include "asm/io.h"
lib/pci-host-generic.h +2 -2
index 0ffe6380ec8f..3020ee22c837 100644
@@ -1,5 +1,5 @@
-#ifndef PCI_HOST_GENERIC_H
-#define PCI_HOST_GENERIC_H
+#ifndef _PCI_HOST_GENERIC_H_
+#define _PCI_HOST_GENERIC_H_
 /*
  * PCI host bridge supporting structures and constants
  *
lib/setjmp.h +2 -2
index 2c56b4c68aaa..6afdf665681a 100644
@@ -4,8 +4,8 @@
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU Library General Public License version 2.
  */
-#ifndef LIBCFLAT_SETJMP_H
-#define LIBCFLAT_SETJMP_H 1
+#ifndef _LIBCFLAT_SETJMP_H_
+#define _LIBCFLAT_SETJMP_H_
 
 typedef struct jmp_buf_tag {
 	long int regs[8];
lib/string.h +3 -3
index e1febfed7fb2..b07763eaef10 100644
@@ -4,8 +4,8 @@
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU Library General Public License version 2.
  */
-#ifndef __STRING_H
-#define __STRING_H
+#ifndef _STRING_H_
+#define _STRING_H_
 
 extern size_t strlen(const char *buf);
 extern size_t strnlen(const char *buf, size_t maxlen);
@@ -23,4 +23,4 @@ extern int memcmp(const void *s1, const void *s2, size_t n);
 extern void *memmove(void *dest, const void *src, size_t n);
 extern void *memchr(const void *s, int c, size_t n);
 
-#endif /* _STRING_H */
+#endif /* _STRING_H_ */
lib/vmalloc.h +2 -2
index 8b158f591d75..346f94f198c5 100644
@@ -1,5 +1,5 @@
-#ifndef VMALLOC_H
-#define VMALLOC_H 1
+#ifndef _VMALLOC_H_
+#define _VMALLOC_H_
 
 #include <asm/page.h>
 
#9 lore raw

Re: [kvm-unit-tests PATCH v2 2/7] lib: unify header guards

Quoted 15 lines · Laurent Vivier
Quoted 13 lines · Cornelia Huck

Standardize header guards to _LIB_HEADER_H_.

---
 lib/alloc_page.h       | 4 ++--
 lib/libcflat.h         | 4 ++--
 lib/list.h             | 4 ++--
 lib/pci-edu.h          | 4 ++--
 lib/pci-host-generic.h | 4 ++--
 lib/setjmp.h           | 4 ++--
 lib/string.h           | 6 +++---
 lib/vmalloc.h          | 4 ++--
 8 files changed, 17 insertions(+), 17 deletions(-)
Quoted 1 line

What about lib/argv.h and lib/pci.h?

argv.h does not have a header guard yet (it probably should?)

I forgot to commit my changes to pci.h, I think :(

Quoted 3 lines

And there is also this instance of CONFIG_H in lib/config.h generated by configure.

Yeah, we should tweak the generator for that.

#10 lore raw

Re: [kvm-unit-tests PATCH v2 2/7] lib: unify header guards

Quoted 17 lines · Cornelia Huck
Quoted 15 lines · Laurent Vivier
Quoted 13 lines · Cornelia Huck

Standardize header guards to _LIB_HEADER_H_.

---
 lib/alloc_page.h       | 4 ++--
 lib/libcflat.h         | 4 ++--
 lib/list.h             | 4 ++--
 lib/pci-edu.h          | 4 ++--
 lib/pci-host-generic.h | 4 ++--
 lib/setjmp.h           | 4 ++--
 lib/string.h           | 6 +++---
 lib/vmalloc.h          | 4 ++--
 8 files changed, 17 insertions(+), 17 deletions(-)
Quoted 3 lines
Quoted 1 line

What about lib/argv.h and lib/pci.h?

argv.h does not have a header guard yet (it probably should?)

I think if we want to standardize header guards we should add them where they are not.

But no real strong opinion on that...

Thanks,
Laurent

#11 lore raw

PATCH v2 3/7 asm-generic: unify header guards

In reply to Cornelia Huck

Standardize header guards to _ASM_GENERIC_HEADER_H_.

---
 lib/asm-generic/atomic.h          | 4 ++--
 lib/asm-generic/barrier.h         | 6 +++---
 lib/asm-generic/memory_areas.h    | 4 ++--
 lib/asm-generic/pci-host-bridge.h | 4 ++--
 4 files changed, 9 insertions(+), 9 deletions(-)
lib/asm-generic/atomic.h +2 -2
index 26b645a7cc18..b09ce95053e7 100644
@@ -1,5 +1,5 @@
-#ifndef __ASM_GENERIC_ATOMIC_H__
-#define __ASM_GENERIC_ATOMIC_H__
+#ifndef _ASM_GENERIC_ATOMIC_H_
+#define _ASM_GENERIC_ATOMIC_H_
 
 /* From QEMU include/qemu/atomic.h */
 #define atomic_fetch_inc(ptr)  __sync_fetch_and_add(ptr, 1)
lib/asm-generic/barrier.h +3 -3
index 6a990ff8d5a5..5499a5664d4d 100644
@@ -1,5 +1,5 @@
-#ifndef _ASM_BARRIER_H_
-#define _ASM_BARRIER_H_
+#ifndef _ASM_GENERIC_BARRIER_H_
+#define _ASM_GENERIC_BARRIER_H_
 /*
  * asm-generic/barrier.h
  *
@@ -32,4 +32,4 @@
 #define cpu_relax()	asm volatile ("":::"memory")
 #endif
 
-#endif /* _ASM_BARRIER_H_ */
+#endif /* _ASM_GENERIC_BARRIER_H_ */
lib/asm-generic/memory_areas.h +2 -2
index 3074afe23393..c86db255ecee 100644
@@ -1,5 +1,5 @@
-#ifndef __ASM_GENERIC_MEMORY_AREAS_H__
-#define __ASM_GENERIC_MEMORY_AREAS_H__
+#ifndef _ASM_GENERIC_MEMORY_AREAS_H_
+#define _ASM_GENERIC_MEMORY_AREAS_H_
 
 #define AREA_NORMAL_PFN 0
 #define AREA_NORMAL_NUMBER 0
lib/asm-generic/pci-host-bridge.h +2 -2
index 9e91499b9446..174ff341dd0d 100644
@@ -1,5 +1,5 @@
-#ifndef _ASM_PCI_HOST_BRIDGE_H_
-#define _ASM_PCI_HOST_BRIDGE_H_
+#ifndef _ASM_GENERIC_PCI_HOST_BRIDGE_H_
+#define _ASM_GENERIC_PCI_HOST_BRIDGE_H_
 /*
  * Copyright (C) 2016, Red Hat Inc, Alexander Gordeev <[email protected]>
  *
Signature · 1 line
2.31.1
Reviewed-by on v2 3/7
#12 lore raw

Re: [kvm-unit-tests PATCH v2 3/7] asm-generic: unify header guards

Quoted 58 lines · Cornelia Huck

Standardize header guards to _ASM_GENERIC_HEADER_H_.

---
  lib/asm-generic/atomic.h          | 4 ++--
  lib/asm-generic/barrier.h         | 6 +++---
  lib/asm-generic/memory_areas.h    | 4 ++--
  lib/asm-generic/pci-host-bridge.h | 4 ++--
  4 files changed, 9 insertions(+), 9 deletions(-)
lib/asm-generic/atomic.h +2 -2
index 26b645a7cc18..b09ce95053e7 100644
@@ -1,5 +1,5 @@
-#ifndef __ASM_GENERIC_ATOMIC_H__
-#define __ASM_GENERIC_ATOMIC_H__
+#ifndef _ASM_GENERIC_ATOMIC_H_
+#define _ASM_GENERIC_ATOMIC_H_
 
  /* From QEMU include/qemu/atomic.h */
  #define atomic_fetch_inc(ptr)  __sync_fetch_and_add(ptr, 1)
lib/asm-generic/barrier.h +3 -3
index 6a990ff8d5a5..5499a5664d4d 100644
@@ -1,5 +1,5 @@
-#ifndef _ASM_BARRIER_H_
-#define _ASM_BARRIER_H_
+#ifndef _ASM_GENERIC_BARRIER_H_
+#define _ASM_GENERIC_BARRIER_H_
  /*
   * asm-generic/barrier.h
   *
@@ -32,4 +32,4 @@
  #define cpu_relax()	asm volatile ("":::"memory")
  #endif
 
-#endif /* _ASM_BARRIER_H_ */
+#endif /* _ASM_GENERIC_BARRIER_H_ */
lib/asm-generic/memory_areas.h +2 -2
index 3074afe23393..c86db255ecee 100644
@@ -1,5 +1,5 @@
-#ifndef __ASM_GENERIC_MEMORY_AREAS_H__
-#define __ASM_GENERIC_MEMORY_AREAS_H__
+#ifndef _ASM_GENERIC_MEMORY_AREAS_H_
+#define _ASM_GENERIC_MEMORY_AREAS_H_
 
  #define AREA_NORMAL_PFN 0
  #define AREA_NORMAL_NUMBER 0
lib/asm-generic/pci-host-bridge.h +0 -0
index 9e91499b9446..174ff341dd0d 100644

lib/asm-generic/pci-host-bridge.h line 5

Quoted 7 lines
lib/asm-generic/pci-host-bridge.h +2 -2
@@ -1,5 +1,5 @@
-#ifndef _ASM_PCI_HOST_BRIDGE_H_
-#define _ASM_PCI_HOST_BRIDGE_H_
+#ifndef _ASM_GENERIC_PCI_HOST_BRIDGE_H_
+#define _ASM_GENERIC_PCI_HOST_BRIDGE_H_
  /*
   * Copyright (C) 2016, Red Hat Inc, Alexander Gordeev <[email protected]>
   *
Signature · 3 lines
Thanks,

David / dhildenb
Reviewed-by on v2 3/7
#13 lore raw

Re: [kvm-unit-tests PATCH v2 3/7] asm-generic: unify header guards

In reply to Cornelia Huck
Quoted 58 lines · Cornelia Huck

Standardize header guards to _ASM_GENERIC_HEADER_H_.

---
 lib/asm-generic/atomic.h          | 4 ++--
 lib/asm-generic/barrier.h         | 6 +++---
 lib/asm-generic/memory_areas.h    | 4 ++--
 lib/asm-generic/pci-host-bridge.h | 4 ++--
 4 files changed, 9 insertions(+), 9 deletions(-)
lib/asm-generic/atomic.h +2 -2
index 26b645a7cc18..b09ce95053e7 100644
@@ -1,5 +1,5 @@
-#ifndef __ASM_GENERIC_ATOMIC_H__
-#define __ASM_GENERIC_ATOMIC_H__
+#ifndef _ASM_GENERIC_ATOMIC_H_
+#define _ASM_GENERIC_ATOMIC_H_
 
 /* From QEMU include/qemu/atomic.h */
 #define atomic_fetch_inc(ptr)  __sync_fetch_and_add(ptr, 1)
lib/asm-generic/barrier.h +3 -3
index 6a990ff8d5a5..5499a5664d4d 100644
@@ -1,5 +1,5 @@
-#ifndef _ASM_BARRIER_H_
-#define _ASM_BARRIER_H_
+#ifndef _ASM_GENERIC_BARRIER_H_
+#define _ASM_GENERIC_BARRIER_H_
 /*
  * asm-generic/barrier.h
  *
@@ -32,4 +32,4 @@
 #define cpu_relax()	asm volatile ("":::"memory")
 #endif
 
-#endif /* _ASM_BARRIER_H_ */
+#endif /* _ASM_GENERIC_BARRIER_H_ */
lib/asm-generic/memory_areas.h +2 -2
index 3074afe23393..c86db255ecee 100644
@@ -1,5 +1,5 @@
-#ifndef __ASM_GENERIC_MEMORY_AREAS_H__
-#define __ASM_GENERIC_MEMORY_AREAS_H__
+#ifndef _ASM_GENERIC_MEMORY_AREAS_H_
+#define _ASM_GENERIC_MEMORY_AREAS_H_
 
 #define AREA_NORMAL_PFN 0
 #define AREA_NORMAL_NUMBER 0
lib/asm-generic/pci-host-bridge.h +0 -0
index 9e91499b9446..174ff341dd0d 100644

lib/asm-generic/pci-host-bridge.h line 5

Quoted 7 lines
lib/asm-generic/pci-host-bridge.h +2 -2
@@ -1,5 +1,5 @@
-#ifndef _ASM_PCI_HOST_BRIDGE_H_
-#define _ASM_PCI_HOST_BRIDGE_H_
+#ifndef _ASM_GENERIC_PCI_HOST_BRIDGE_H_
+#define _ASM_GENERIC_PCI_HOST_BRIDGE_H_
 /*
  * Copyright (C) 2016, Red Hat Inc, Alexander Gordeev <[email protected]>
  *
#14 lore raw

PATCH v2 4/7 arm: unify header guards

In reply to Cornelia Huck

The assembler.h files were the only ones not already following the convention.

---
 lib/arm/asm/assembler.h   | 6 +++---
 lib/arm64/asm/assembler.h | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)
lib/arm/asm/assembler.h +3 -3
index dfd3c51bf6ad..4200252dd14d 100644
@@ -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_ */
lib/arm64/asm/assembler.h +3 -3
index 0a6ab9720bdd..a271e4ceefe6 100644
@@ -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_ */
Signature · 1 line
2.31.1
Reviewed-by on v2 4/7
#15 lore raw

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

Quoted 47 lines · Cornelia Huck

The assembler.h files were the only ones not already following the convention.

---
  lib/arm/asm/assembler.h   | 6 +++---
  lib/arm64/asm/assembler.h | 6 +++---
  2 files changed, 6 insertions(+), 6 deletions(-)
lib/arm/asm/assembler.h +3 -3
index dfd3c51bf6ad..4200252dd14d 100644
@@ -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_ */
lib/arm64/asm/assembler.h +2 -2
index 0a6ab9720bdd..a271e4ceefe6 100644
@@ -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

lib/arm64/asm/assembler.h line 54

Quoted 5 lines
lib/arm64/asm/assembler.h +1 -1
@@ -51,4 +51,4 @@
  	dsb	\domain
  	.endm
 
-#endif	/* __ASM_ASSEMBLER_H */
+#endif	/* _ASMARM64_ASSEMBLER_H_ */
Signature · 3 lines
Thanks,

David / dhildenb
#16 lore raw

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

In reply to Cornelia Huck
Quoted 8 lines · Cornelia Huck

The assembler.h files were the only ones not already following the convention.

---
 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

Quoted 44 lines
lib/arm/asm/assembler.h +3 -3
index dfd3c51bf6ad..4200252dd14d 100644
@@ -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_ */
lib/arm64/asm/assembler.h +3 -3
index 0a6ab9720bdd..a271e4ceefe6 100644
@@ -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_ */
#17 lore raw

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

Quoted 11 lines · Laurent Vivier
Quoted 8 lines · Cornelia Huck

The assembler.h files were the only ones not already following the convention.

---
 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.

Quoted 6 lines

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?

Quoted 2 lines

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

Oops, overlooked the extra underscore there.

#18 lore raw

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

Quoted 17 lines · Cornelia Huck
Quoted 11 lines · Laurent Vivier
Quoted 8 lines · Cornelia Huck

The assembler.h files were the only ones not already following the convention.

---
 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.

Quoted 1 line
Quoted 8 lines
Quoted 5 lines

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

#19 lore raw

PATCH v2 5/7 powerpc: unify header guards

In reply to Cornelia Huck

Only spapr.h needed a tweak.

---
 powerpc/spapr.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
powerpc/spapr.h +3 -3
index b41aece07968..3a29598be44f 100644
@@ -1,6 +1,6 @@
-#ifndef _ASMPOWERPC_SPAPR_H_
-#define _ASMPOWERPC_SPAPR_H_
+#ifndef POWERPC_SPAPR_H
+#define POWERPC_SPAPR_H
 
 #define SPAPR_KERNEL_LOAD_ADDR 0x400000
 
-#endif /* _ASMPOWERPC_SPAPR_H_ */
+#endif /* POWERPC_SPAPR_H */
Signature · 1 line
2.31.1
Reviewed-by on v2 5/7
#20 lore raw

Re: [kvm-unit-tests PATCH v2 5/7] powerpc: unify header guards

Quoted 13 lines · Cornelia Huck

Only spapr.h needed a tweak.

---
  powerpc/spapr.h | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)
powerpc/spapr.h +0 -0
index b41aece07968..3a29598be44f 100644

powerpc/spapr.h line 6

Quoted 9 lines
powerpc/spapr.h +3 -3
@@ -1,6 +1,6 @@
-#ifndef _ASMPOWERPC_SPAPR_H_
-#define _ASMPOWERPC_SPAPR_H_
+#ifndef POWERPC_SPAPR_H
+#define POWERPC_SPAPR_H
 
  #define SPAPR_KERNEL_LOAD_ADDR 0x400000
 
-#endif /* _ASMPOWERPC_SPAPR_H_ */
+#endif /* POWERPC_SPAPR_H */
Signature · 3 lines
Thanks,

David / dhildenb
Reviewed-by on v2 5/7
#21 lore raw

Re: [kvm-unit-tests PATCH v2 5/7] powerpc: unify header guards

In reply to Cornelia Huck
Quoted 13 lines · Cornelia Huck

Only spapr.h needed a tweak.

---
 powerpc/spapr.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
powerpc/spapr.h +0 -0
index b41aece07968..3a29598be44f 100644

powerpc/spapr.h line 6

Quoted 9 lines
powerpc/spapr.h +3 -3
@@ -1,6 +1,6 @@
-#ifndef _ASMPOWERPC_SPAPR_H_
-#define _ASMPOWERPC_SPAPR_H_
+#ifndef POWERPC_SPAPR_H
+#define POWERPC_SPAPR_H
 
 #define SPAPR_KERNEL_LOAD_ADDR 0x400000
 
-#endif /* _ASMPOWERPC_SPAPR_H_ */
+#endif /* POWERPC_SPAPR_H */
#22 lore raw

PATCH v2 6/7 s390x: unify header guards

In reply to Cornelia Huck

Standardize header guards to _ASMS390X_HEADER_H_, _S390X_HEADER_H_, and S390X_HEADER_H, respectively.

---
 lib/s390x/asm/arch_def.h | 4 ++--
 lib/s390x/asm/barrier.h  | 4 ++--
 lib/s390x/asm/cpacf.h    | 6 +++---
 lib/s390x/asm/facility.h | 4 ++--
 lib/s390x/asm/float.h    | 4 ++--
 lib/s390x/asm/mem.h      | 4 ++--
 lib/s390x/asm/sigp.h     | 6 +++---
 lib/s390x/asm/spinlock.h | 4 ++--
 lib/s390x/asm/time.h     | 4 ++--
 lib/s390x/asm/uv.h       | 4 ++--
 lib/s390x/css.h          | 4 ++--
 lib/s390x/interrupt.h    | 4 ++--
 lib/s390x/mmu.h          | 4 ++--
 lib/s390x/sclp.h         | 6 +++---
 lib/s390x/sie.h          | 6 +++---
 lib/s390x/smp.h          | 4 ++--
 lib/s390x/uv.h           | 4 ++--
 lib/s390x/vm.h           | 6 +++---
 s390x/sthyi.h            | 4 ++--
 19 files changed, 43 insertions(+), 43 deletions(-)
lib/s390x/asm/arch_def.h +2 -2
index 7e2c5e623ab2..76f9e3862965 100644
@@ -5,8 +5,8 @@
  * Authors:
  *  David Hildenbrand <[email protected]>
  */
-#ifndef _ASM_S390X_ARCH_DEF_H_
-#define _ASM_S390X_ARCH_DEF_H_
+#ifndef _ASMS390X_ARCH_DEF_H_
+#define _ASMS390X_ARCH_DEF_H_
 
 struct stack_frame {
 	struct stack_frame *back_chain;
lib/s390x/asm/barrier.h +2 -2
index 8e2fd6d90034..9534f9e8fa96 100644
@@ -6,8 +6,8 @@
  *  Thomas Huth <[email protected]>
  *  David Hildenbrand <[email protected]>
  */
-#ifndef _ASM_S390X_BARRIER_H_
-#define _ASM_S390X_BARRIER_H_
+#ifndef _ASMS390X_BARRIER_H_
+#define _ASMS390X_BARRIER_H_
 
 #include <asm-generic/barrier.h>
 
lib/s390x/asm/cpacf.h +3 -3
index 805fcf1a2d71..685262b0ff62 100644
@@ -8,8 +8,8 @@
  *	      Harald Freudenberger ([email protected])
  *	      Martin Schwidefsky <[email protected]>
  */
-#ifndef _ASM_S390_CPACF_H
-#define _ASM_S390_CPACF_H
+#ifndef _ASMS390X_CPACF_H_
+#define _ASMS390X_CPACF_H_
 
 #include <asm/facility.h>
 #include <linux/compiler.h>
@@ -471,4 +471,4 @@ static inline void cpacf_pckmo(long func, void *param)
 		: "cc", "memory");
 }
 
-#endif	/* _ASM_S390_CPACF_H */
+#endif	/* _ASMS390X_CPACF_H_ */
lib/s390x/asm/facility.h +2 -2
index 95d4a15fe34f..ef0fd037ed35 100644
@@ -5,8 +5,8 @@
  * Authors:
  *  David Hildenbrand <[email protected]>
  */
-#ifndef _ASM_S390X_FACILITY_H_
-#define _ASM_S390X_FACILITY_H_
+#ifndef _ASMS390X_FACILITY_H_
+#define _ASMS390X_FACILITY_H_
 
 #include <libcflat.h>
 #include <asm/facility.h>
lib/s390x/asm/float.h +2 -2
index 136794475849..eb752050b162 100644
@@ -5,8 +5,8 @@
  * Authors:
  *  David Hildenbrand <[email protected]>
  */
-#ifndef _ASM_S390X_FLOAT_H_
-#define _ASM_S390X_FLOAT_H_
+#ifndef _ASMS390X_FLOAT_H_
+#define _ASMS390X_FLOAT_H_
 
 static inline void set_fpc(uint32_t fpc)
 {
lib/s390x/asm/mem.h +2 -2
index 281390ebd816..1963cef7ec03 100644
@@ -5,8 +5,8 @@
  * Copyright IBM Corp. 2018
  * Author(s): Janosch Frank <[email protected]>
  */
-#ifndef _ASM_S390_MEM_H
-#define _ASM_S390_MEM_H
+#ifndef _ASMS390X_MEM_H_
+#define _ASMS390X_MEM_H_
 
 #define SKEY_ACC	0xf0
 #define SKEY_FP		0x08
lib/s390x/asm/sigp.h +3 -3
index 00844d26d15a..61d2c6256fed 100644
@@ -5,8 +5,8 @@
  * Copied from the Linux kernel file arch/s390/include/asm/sigp.h
  */
 
-#ifndef ASM_S390X_SIGP_H
-#define ASM_S390X_SIGP_H
+#ifndef _ASMS390X_SIGP_H_
+#define _ASMS390X_SIGP_H_
 
 /* SIGP order codes */
 #define SIGP_SENSE			1
@@ -73,4 +73,4 @@ static inline int sigp_retry(uint16_t addr, uint8_t order, unsigned long parm,
 }
 
 #endif /* __ASSEMBLER__ */
-#endif /* ASM_S390X_SIGP_H */
+#endif /* _ASMS390X_SIGP_H_ */
lib/s390x/asm/spinlock.h +2 -2
index 677d2cd6e287..22d4d3899569 100644
@@ -6,8 +6,8 @@
  *  Thomas Huth <[email protected]>
  *  David Hildenbrand <[email protected]>
  */
-#ifndef __ASMS390X_SPINLOCK_H
-#define __ASMS390X_SPINLOCK_H
+#ifndef _ASMS390X_SPINLOCK_H_
+#define _ASMS390X_SPINLOCK_H_
 
 #include <asm-generic/spinlock.h>
 
lib/s390x/asm/time.h +2 -2
index 0d67f7231992..7652a151e87a 100644
@@ -8,8 +8,8 @@
  * Copied from the s390/intercept test by:
  *  Pierre Morel <[email protected]>
  */
-#ifndef ASM_S390X_TIME_H
-#define ASM_S390X_TIME_H
+#ifndef _ASMS390X_TIME_H_
+#define _ASMS390X_TIME_H_
 
 #define STCK_SHIFT_US	(63 - 51)
 #define STCK_MAX	((1UL << 52) - 1)
lib/s390x/asm/uv.h +2 -2
index b22cbaa87109..dc3e02dea1b4 100644
@@ -9,8 +9,8 @@
  * This code is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License version 2.
  */
-#ifndef ASM_S390X_UV_H
-#define ASM_S390X_UV_H
+#ifndef _ASMS390X_UV_H_
+#define _ASMS390X_UV_H_
 
 #define UVC_RC_EXECUTED		0x0001
 #define UVC_RC_INV_CMD		0x0002
lib/s390x/css.h +2 -2
index 7e3d2613402e..d644971fb2b7 100644
@@ -6,8 +6,8 @@
  * Author: Pierre Morel <[email protected]>
  */
 
-#ifndef CSS_H
-#define CSS_H
+#ifndef _S390X_CSS_H_
+#define _S390X_CSS_H_
 
 #define lowcore_ptr ((struct lowcore *)0x0)
 
lib/s390x/interrupt.h +2 -2
index 1973d267c2f1..99fa0beee9ad 100644
@@ -1,5 +1,5 @@
-#ifndef INTERRUPT_H
-#define INTERRUPT_H
+#ifndef _S390X_INTERRUPT_H_
+#define _S390X_INTERRUPT_H_
 #include <asm/interrupt.h>
 
 int register_io_int_func(void (*f)(void));
lib/s390x/mmu.h +2 -2
index 603f289e8e00..b995f85b839f 100644
@@ -7,8 +7,8 @@
  * Authors:
  *	Janosch Frank <[email protected]>
  */
-#ifndef _ASMS390X_MMU_H_
-#define _ASMS390X_MMU_H_
+#ifndef _S390X_MMU_H_
+#define _S390X_MMU_H_
 
 void protect_page(void *vaddr, unsigned long prot);
 void protect_range(void *start, unsigned long len, unsigned long prot);
lib/s390x/sclp.h +3 -3
index 7abf1038f5ee..28e526e2c915 100644
@@ -10,8 +10,8 @@
  * Author: Christian Borntraeger <[email protected]>
  */
 
-#ifndef SCLP_H
-#define SCLP_H
+#ifndef _S390X_SCLP_H_
+#define _S390X_SCLP_H_
 
 #define SCLP_CMD_CODE_MASK                      0xffff00ff
 
@@ -329,4 +329,4 @@ void sclp_memory_setup(void);
 uint64_t get_ram_size(void);
 uint64_t get_max_ram_size(void);
 
-#endif /* SCLP_H */
+#endif /* _S390X_SCLP_H_ */
lib/s390x/sie.h +3 -3
index 518613baf1fa..db30d6164ab6 100644
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0-or-later */
-#ifndef SIE_H
-#define SIE_H
+#ifndef _S390X_SIE_H_
+#define _S390X_SIE_H_
 
 #define CPUSTAT_STOPPED    0x80000000
 #define CPUSTAT_WAIT       0x10000000
@@ -195,4 +195,4 @@ extern void sie_entry(void);
 extern void sie_exit(void);
 extern void sie64a(struct kvm_s390_sie_block *sblk, struct vm_save_area *save_area);
 
-#endif /* SIE_H */
+#endif /* _S390X_SIE_H_ */
lib/s390x/smp.h +2 -2
index 67ff16ca3c52..a2609f11e40b 100644
@@ -7,8 +7,8 @@
  * Authors:
  *  Janosch Frank <[email protected]>
  */
-#ifndef SMP_H
-#define SMP_H
+#ifndef _S390X_SMP_H_
+#define _S390X_SMP_H_
 
 #include <asm/arch_def.h>
 
lib/s390x/uv.h +2 -2
index 42608a967a03..2b23407a2fcf 100644
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0-or-later */
-#ifndef UV_H
-#define UV_H
+#ifndef _S390X_UV_H_
+#define _S390X_UV_H_
 
 bool uv_os_is_guest(void);
 bool uv_os_is_host(void);
lib/s390x/vm.h +3 -3
index 16722760cb46..7abba0ccae3d 100644
@@ -5,9 +5,9 @@
  * Copyright (c) 2020 Red Hat Inc
  */
 
-#ifndef S390X_VM_H
-#define S390X_VM_H
+#ifndef _S390X_VM_H_
+#define _S390X_VM_H_
 
 bool vm_is_tcg(void);
 
-#endif  /* S390X_VM_H */
+#endif  /* _S390X_VM_H_ */
s390x/sthyi.h +2 -2
index bbd74c6197c3..0a47c2385dc7 100644
@@ -7,8 +7,8 @@
  * Authors:
  *    Janosch Frank <[email protected]>
  */
-#ifndef _STHYI_H_
-#define _STHYI_H_
+#ifndef S390X_STHYI_H
+#define S390X_STHYI_H
 
 #include <stdint.h>
 
Signature · 1 line
2.31.1
Reviewed-by on v2 6/7
#23 lore raw

Re: [kvm-unit-tests PATCH v2 6/7] s390x: unify header guards

Quoted 321 lines · Cornelia Huck

Standardize header guards to _ASMS390X_HEADER_H_, _S390X_HEADER_H_, and S390X_HEADER_H, respectively.

---
  lib/s390x/asm/arch_def.h | 4 ++--
  lib/s390x/asm/barrier.h  | 4 ++--
  lib/s390x/asm/cpacf.h    | 6 +++---
  lib/s390x/asm/facility.h | 4 ++--
  lib/s390x/asm/float.h    | 4 ++--
  lib/s390x/asm/mem.h      | 4 ++--
  lib/s390x/asm/sigp.h     | 6 +++---
  lib/s390x/asm/spinlock.h | 4 ++--
  lib/s390x/asm/time.h     | 4 ++--
  lib/s390x/asm/uv.h       | 4 ++--
  lib/s390x/css.h          | 4 ++--
  lib/s390x/interrupt.h    | 4 ++--
  lib/s390x/mmu.h          | 4 ++--
  lib/s390x/sclp.h         | 6 +++---
  lib/s390x/sie.h          | 6 +++---
  lib/s390x/smp.h          | 4 ++--
  lib/s390x/uv.h           | 4 ++--
  lib/s390x/vm.h           | 6 +++---
  s390x/sthyi.h            | 4 ++--
  19 files changed, 43 insertions(+), 43 deletions(-)
lib/s390x/asm/arch_def.h +2 -2
index 7e2c5e623ab2..76f9e3862965 100644
@@ -5,8 +5,8 @@
   * Authors:
   *  David Hildenbrand <[email protected]>
   */
-#ifndef _ASM_S390X_ARCH_DEF_H_
-#define _ASM_S390X_ARCH_DEF_H_
+#ifndef _ASMS390X_ARCH_DEF_H_
+#define _ASMS390X_ARCH_DEF_H_
 
  struct stack_frame {
  	struct stack_frame *back_chain;
lib/s390x/asm/barrier.h +2 -2
index 8e2fd6d90034..9534f9e8fa96 100644
@@ -6,8 +6,8 @@
   *  Thomas Huth <[email protected]>
   *  David Hildenbrand <[email protected]>
   */
-#ifndef _ASM_S390X_BARRIER_H_
-#define _ASM_S390X_BARRIER_H_
+#ifndef _ASMS390X_BARRIER_H_
+#define _ASMS390X_BARRIER_H_
 
  #include <asm-generic/barrier.h>
 
lib/s390x/asm/cpacf.h +3 -3
index 805fcf1a2d71..685262b0ff62 100644
@@ -8,8 +8,8 @@
   *	      Harald Freudenberger ([email protected])
   *	      Martin Schwidefsky <[email protected]>
   */
-#ifndef _ASM_S390_CPACF_H
-#define _ASM_S390_CPACF_H
+#ifndef _ASMS390X_CPACF_H_
+#define _ASMS390X_CPACF_H_
 
  #include <asm/facility.h>
  #include <linux/compiler.h>
@@ -471,4 +471,4 @@ static inline void cpacf_pckmo(long func, void *param)
  		: "cc", "memory");
  }
 
-#endif	/* _ASM_S390_CPACF_H */
+#endif	/* _ASMS390X_CPACF_H_ */
lib/s390x/asm/facility.h +2 -2
index 95d4a15fe34f..ef0fd037ed35 100644
@@ -5,8 +5,8 @@
   * Authors:
   *  David Hildenbrand <[email protected]>
   */
-#ifndef _ASM_S390X_FACILITY_H_
-#define _ASM_S390X_FACILITY_H_
+#ifndef _ASMS390X_FACILITY_H_
+#define _ASMS390X_FACILITY_H_
 
  #include <libcflat.h>
  #include <asm/facility.h>
lib/s390x/asm/float.h +2 -2
index 136794475849..eb752050b162 100644
@@ -5,8 +5,8 @@
   * Authors:
   *  David Hildenbrand <[email protected]>
   */
-#ifndef _ASM_S390X_FLOAT_H_
-#define _ASM_S390X_FLOAT_H_
+#ifndef _ASMS390X_FLOAT_H_
+#define _ASMS390X_FLOAT_H_
 
  static inline void set_fpc(uint32_t fpc)
  {
lib/s390x/asm/mem.h +2 -2
index 281390ebd816..1963cef7ec03 100644
@@ -5,8 +5,8 @@
   * Copyright IBM Corp. 2018
   * Author(s): Janosch Frank <[email protected]>
   */
-#ifndef _ASM_S390_MEM_H
-#define _ASM_S390_MEM_H
+#ifndef _ASMS390X_MEM_H_
+#define _ASMS390X_MEM_H_
 
  #define SKEY_ACC	0xf0
  #define SKEY_FP		0x08
lib/s390x/asm/sigp.h +3 -3
index 00844d26d15a..61d2c6256fed 100644
@@ -5,8 +5,8 @@
   * Copied from the Linux kernel file arch/s390/include/asm/sigp.h
   */
 
-#ifndef ASM_S390X_SIGP_H
-#define ASM_S390X_SIGP_H
+#ifndef _ASMS390X_SIGP_H_
+#define _ASMS390X_SIGP_H_
 
  /* SIGP order codes */
  #define SIGP_SENSE			1
@@ -73,4 +73,4 @@ static inline int sigp_retry(uint16_t addr, uint8_t order, unsigned long parm,
  }
 
  #endif /* __ASSEMBLER__ */
-#endif /* ASM_S390X_SIGP_H */
+#endif /* _ASMS390X_SIGP_H_ */
lib/s390x/asm/spinlock.h +2 -2
index 677d2cd6e287..22d4d3899569 100644
@@ -6,8 +6,8 @@
   *  Thomas Huth <[email protected]>
   *  David Hildenbrand <[email protected]>
   */
-#ifndef __ASMS390X_SPINLOCK_H
-#define __ASMS390X_SPINLOCK_H
+#ifndef _ASMS390X_SPINLOCK_H_
+#define _ASMS390X_SPINLOCK_H_
 
  #include <asm-generic/spinlock.h>
 
lib/s390x/asm/time.h +2 -2
index 0d67f7231992..7652a151e87a 100644
@@ -8,8 +8,8 @@
   * Copied from the s390/intercept test by:
   *  Pierre Morel <[email protected]>
   */
-#ifndef ASM_S390X_TIME_H
-#define ASM_S390X_TIME_H
+#ifndef _ASMS390X_TIME_H_
+#define _ASMS390X_TIME_H_
 
  #define STCK_SHIFT_US	(63 - 51)
  #define STCK_MAX	((1UL << 52) - 1)
lib/s390x/asm/uv.h +2 -2
index b22cbaa87109..dc3e02dea1b4 100644
@@ -9,8 +9,8 @@
   * This code is free software; you can redistribute it and/or modify it
   * under the terms of the GNU General Public License version 2.
   */
-#ifndef ASM_S390X_UV_H
-#define ASM_S390X_UV_H
+#ifndef _ASMS390X_UV_H_
+#define _ASMS390X_UV_H_
 
  #define UVC_RC_EXECUTED		0x0001
  #define UVC_RC_INV_CMD		0x0002
lib/s390x/css.h +2 -2
index 7e3d2613402e..d644971fb2b7 100644
@@ -6,8 +6,8 @@
   * Author: Pierre Morel <[email protected]>
   */
 
-#ifndef CSS_H
-#define CSS_H
+#ifndef _S390X_CSS_H_
+#define _S390X_CSS_H_
 
  #define lowcore_ptr ((struct lowcore *)0x0)
 
lib/s390x/interrupt.h +2 -2
index 1973d267c2f1..99fa0beee9ad 100644
@@ -1,5 +1,5 @@
-#ifndef INTERRUPT_H
-#define INTERRUPT_H
+#ifndef _S390X_INTERRUPT_H_
+#define _S390X_INTERRUPT_H_
  #include <asm/interrupt.h>
 
  int register_io_int_func(void (*f)(void));
lib/s390x/mmu.h +2 -2
index 603f289e8e00..b995f85b839f 100644
@@ -7,8 +7,8 @@
   * Authors:
   *	Janosch Frank <[email protected]>
   */
-#ifndef _ASMS390X_MMU_H_
-#define _ASMS390X_MMU_H_
+#ifndef _S390X_MMU_H_
+#define _S390X_MMU_H_
 
  void protect_page(void *vaddr, unsigned long prot);
  void protect_range(void *start, unsigned long len, unsigned long prot);
lib/s390x/sclp.h +3 -3
index 7abf1038f5ee..28e526e2c915 100644
@@ -10,8 +10,8 @@
   * Author: Christian Borntraeger <[email protected]>
   */
 
-#ifndef SCLP_H
-#define SCLP_H
+#ifndef _S390X_SCLP_H_
+#define _S390X_SCLP_H_
 
  #define SCLP_CMD_CODE_MASK                      0xffff00ff
 
@@ -329,4 +329,4 @@ void sclp_memory_setup(void);
  uint64_t get_ram_size(void);
  uint64_t get_max_ram_size(void);
 
-#endif /* SCLP_H */
+#endif /* _S390X_SCLP_H_ */
lib/s390x/sie.h +3 -3
index 518613baf1fa..db30d6164ab6 100644
@@ -1,6 +1,6 @@
  /* SPDX-License-Identifier: GPL-2.0-or-later */
-#ifndef SIE_H
-#define SIE_H
+#ifndef _S390X_SIE_H_
+#define _S390X_SIE_H_
 
  #define CPUSTAT_STOPPED    0x80000000
  #define CPUSTAT_WAIT       0x10000000
@@ -195,4 +195,4 @@ extern void sie_entry(void);
  extern void sie_exit(void);
  extern void sie64a(struct kvm_s390_sie_block *sblk, struct vm_save_area *save_area);
 
-#endif /* SIE_H */
+#endif /* _S390X_SIE_H_ */
lib/s390x/smp.h +2 -2
index 67ff16ca3c52..a2609f11e40b 100644
@@ -7,8 +7,8 @@
   * Authors:
   *  Janosch Frank <[email protected]>
   */
-#ifndef SMP_H
-#define SMP_H
+#ifndef _S390X_SMP_H_
+#define _S390X_SMP_H_
 
  #include <asm/arch_def.h>
 
lib/s390x/uv.h +2 -2
index 42608a967a03..2b23407a2fcf 100644
@@ -1,6 +1,6 @@
  /* SPDX-License-Identifier: GPL-2.0-or-later */
-#ifndef UV_H
-#define UV_H
+#ifndef _S390X_UV_H_
+#define _S390X_UV_H_
 
  bool uv_os_is_guest(void);
  bool uv_os_is_host(void);
lib/s390x/vm.h +3 -3
index 16722760cb46..7abba0ccae3d 100644
@@ -5,9 +5,9 @@
   * Copyright (c) 2020 Red Hat Inc
   */
 
-#ifndef S390X_VM_H
-#define S390X_VM_H
+#ifndef _S390X_VM_H_
+#define _S390X_VM_H_
 
  bool vm_is_tcg(void);
 
-#endif  /* S390X_VM_H */
+#endif  /* _S390X_VM_H_ */
s390x/sthyi.h +0 -0
index bbd74c6197c3..0a47c2385dc7 100644

s390x/sthyi.h line 14

Quoted 10 lines
s390x/sthyi.h +2 -2
@@ -7,8 +7,8 @@
   * Authors:
   *    Janosch Frank <[email protected]>
   */
-#ifndef _STHYI_H_
-#define _STHYI_H_
+#ifndef S390X_STHYI_H
+#define S390X_STHYI_H
 
  #include <stdint.h>
 
Signature · 3 lines
Thanks,

David / dhildenb
#24 lore raw

PATCH v2 7/7 x86: unify header guards

In reply to Cornelia Huck

Standardize header guards to _ASMX86_HEADER_H_, _X86_HEADER_H_, and X86_HEADER_H.

---
 lib/x86/acpi.h             | 4 ++--
 lib/x86/apic-defs.h        | 6 +++---
 lib/x86/apic.h             | 4 ++--
 lib/x86/asm/barrier.h      | 4 ++--
 lib/x86/asm/debugreg.h     | 6 +++---
 lib/x86/asm/io.h           | 4 ++--
 lib/x86/asm/memory_areas.h | 4 ++--
 lib/x86/asm/page.h         | 4 ++--
 lib/x86/asm/pci.h          | 4 ++--
 lib/x86/asm/spinlock.h     | 4 ++--
 lib/x86/asm/stack.h        | 4 ++--
 lib/x86/atomic.h           | 4 ++--
 lib/x86/delay.h            | 4 ++--
 lib/x86/desc.h             | 4 ++--
 lib/x86/fault_test.h       | 4 ++--
 lib/x86/fwcfg.h            | 4 ++--
 lib/x86/intel-iommu.h      | 4 ++--
 lib/x86/isr.h              | 4 ++--
 lib/x86/msr.h              | 6 +++---
 lib/x86/processor.h        | 4 ++--
 lib/x86/smp.h              | 4 ++--
 lib/x86/usermode.h         | 4 ++--
 lib/x86/vm.h               | 4 ++--
 x86/hyperv.h               | 4 ++--
 x86/ioram.h                | 4 ++--
 x86/kvmclock.h             | 4 ++--
 x86/svm.h                  | 4 ++--
 x86/types.h                | 4 ++--
 x86/vmx.h                  | 4 ++--
 29 files changed, 61 insertions(+), 61 deletions(-)
lib/x86/acpi.h +2 -2
index 08aaf57a7890..1b803740f331 100644
@@ -1,5 +1,5 @@
-#ifndef KVM_ACPI_H
-#define KVM_ACPI_H 1
+#ifndef _X86_ACPI_H_
+#define _X86_ACPI_H_
 
 #include "libcflat.h"
 
lib/x86/apic-defs.h +3 -3
index b2014de800a7..dabefe7879ea 100644
@@ -1,5 +1,5 @@
-#ifndef _ASM_X86_APICDEF_H
-#define _ASM_X86_APICDEF_H
+#ifndef _X86_APIC_DEFS_H_
+#define _X86_APIC_DEFS_H_
 
 /*
  * Abuse this header file to hold the number of max-cpus, making it available
@@ -144,4 +144,4 @@
 
 #define APIC_BASE_MSR	0x800
 
-#endif /* _ASM_X86_APICDEF_H */
+#endif /* _X86_APIC_DEFS_H_ */
lib/x86/apic.h +2 -2
index a7eff6354a83..c4821716b352 100644
@@ -1,5 +1,5 @@
-#ifndef CFLAT_APIC_H
-#define CFLAT_APIC_H
+#ifndef _X86_APIC_H_
+#define _X86_APIC_H_
 
 #include <stdint.h>
 #include "apic-defs.h"
lib/x86/asm/barrier.h +2 -2
index 193fb4c2e712..66c8f56f1c9a 100644
@@ -1,5 +1,5 @@
-#ifndef _ASM_X86_BARRIER_H_
-#define _ASM_X86_BARRIER_H_
+#ifndef _ASMX86_BARRIER_H_
+#define _ASMX86_BARRIER_H_
 /*
  * Copyright (C) 2016, Red Hat Inc, Alexander Gordeev <[email protected]>
  *
lib/x86/asm/debugreg.h +3 -3
index d95d080b30e3..e86f5a629480 100644
@@ -1,6 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
-#ifndef _UAPI_ASM_X86_DEBUGREG_H
-#define _UAPI_ASM_X86_DEBUGREG_H
+#ifndef _ASMX86_DEBUGREG_H_
+#define _ASMX86_DEBUGREG_H_
 
 
 /* Indicate the register numbers for a number of the specific
@@ -78,4 +78,4 @@
  * HW breakpoint additions
  */
 
-#endif /* _UAPI_ASM_X86_DEBUGREG_H */
+#endif /* _ASMX86_DEBUGREG_H_ */
lib/x86/asm/io.h +2 -2
index 35a5c7347411..88734320aa93 100644
@@ -1,5 +1,5 @@
-#ifndef _ASM_X86_IO_H_
-#define _ASM_X86_IO_H_
+#ifndef _ASMX86_IO_H_
+#define _ASMX86_IO_H_
 
 #define __iomem
 
lib/x86/asm/memory_areas.h +2 -2
index e84016f8b060..bd47a89aba7d 100644
@@ -1,5 +1,5 @@
-#ifndef _ASM_X86_MEMORY_AREAS_H_
-#define _ASM_X86_MEMORY_AREAS_H_
+#ifndef _ASMX86_MEMORY_AREAS_H_
+#define _ASMX86_MEMORY_AREAS_H_
 
 #define AREA_NORMAL_PFN BIT(36-12)
 #define AREA_NORMAL_NUMBER 0
lib/x86/asm/page.h +2 -2
index 2cf8881e16d2..fc1416071ec9 100644
@@ -1,5 +1,5 @@
-#ifndef _ASM_X86_PAGE_H_
-#define _ASM_X86_PAGE_H_
+#ifndef _ASMX86_PAGE_H_
+#define _ASMX86_PAGE_H_
 /*
  * Copyright (C) 2016, Red Hat Inc, Alexander Gordeev <[email protected]>
  *
lib/x86/asm/pci.h +2 -2
index c937e5cd71e1..03e55c277f12 100644
@@ -1,5 +1,5 @@
-#ifndef ASM_PCI_H
-#define ASM_PCI_H
+#ifndef _ASMX86_PCI_H_
+#define _ASMX86_PCI_H_
 /*
  * Copyright (C) 2013, Red Hat Inc, Michael S. Tsirkin <[email protected]>
  *
lib/x86/asm/spinlock.h +2 -2
index 692020c5185c..34fadf771c11 100644
@@ -1,5 +1,5 @@
-#ifndef __ASM_SPINLOCK_H
-#define __ASM_SPINLOCK_H
+#ifndef _ASMX86_SPINLOCK_H_
+#define _ASMX86_SPINLOCK_H_
 
 #include <asm-generic/spinlock.h>
 
lib/x86/asm/stack.h +2 -2
index b14e2c0fa012..417695373801 100644
@@ -1,5 +1,5 @@
-#ifndef _X86ASM_STACK_H_
-#define _X86ASM_STACK_H_
+#ifndef _ASMX86_STACK_H_
+#define _ASMX86_STACK_H_
 
 #ifndef _STACK_H_
 #error Do not directly include <asm/stack.h>. Just use <stack.h>.
lib/x86/atomic.h +2 -2
index c9ce489d3904..13e734bb464d 100644
@@ -1,5 +1,5 @@
-#ifndef __ATOMIC_H
-#define __ATOMIC_H
+#ifndef _X86_ATOMIC_H_
+#define _X86_ATOMIC_H_
 
 #include "asm-generic/atomic.h"
 
lib/x86/delay.h +2 -2
index a51eb34485d0..26270edb2156 100644
@@ -1,5 +1,5 @@
-#ifndef __X86_DELAY__
-#define __X86_DELAY__
+#ifndef _X86_DELAY_H_
+#define _X86_DELAY_H_
 
 #include "libcflat.h"
 
lib/x86/desc.h +2 -2
index 77b2c59d5551..a6ffb38c79a1 100644
@@ -1,5 +1,5 @@
-#ifndef __IDT_TEST__
-#define __IDT_TEST__
+#ifndef _X86_DESC_H_
+#define _X86_DESC_H_
 
 #include <setjmp.h>
 
lib/x86/fault_test.h +2 -2
index dfa715ba6720..07566365d57c 100644
@@ -1,5 +1,5 @@
-#ifndef __FAULT_TEST__
-#define __FAULT_TEST__
+#ifndef _X86_FAULT_TEST_H_
+#define _X86_FAULT_TEST_H_
 
 #include "x86/msr.h"
 #include "x86/processor.h"
lib/x86/fwcfg.h +2 -2
index ac4257e5d78e..2434cf62222a 100644
@@ -1,5 +1,5 @@
-#ifndef FWCFG_H
-#define FWCFG_H
+#ifndef _X86_FWCFG_H_
+#define _X86_FWCFG_H_
 
 #include <stdint.h>
 #include <stdbool.h>
lib/x86/intel-iommu.h +2 -2
index 05b9744b916b..e14f825e796d 100644
@@ -12,8 +12,8 @@
  * (From include/linux/intel-iommu.h)
  */
 
-#ifndef __INTEL_IOMMU_H__
-#define __INTEL_IOMMU_H__
+#ifndef _X86_INTEL_IOMMU_H_
+#define _X86_INTEL_IOMMU_H_
 
 #include "libcflat.h"
 #include "isr.h"
lib/x86/isr.h +2 -2
index a50929190b64..746ac7af4a90 100644
@@ -1,5 +1,5 @@
-#ifndef __ISR_TEST__
-#define __ISR_TEST__
+#ifndef _X86_ISR_H_
+#define _X86_ISR_H_
 
 typedef struct {
     ulong regs[sizeof(ulong)*2];
lib/x86/msr.h +3 -3
index 5213bcd55836..5001b169cc48 100644
@@ -1,5 +1,5 @@
-#ifndef _ASM_X86_MSR_INDEX_H
-#define _ASM_X86_MSR_INDEX_H
+#ifndef _X86_MSR_H_
+#define _X86_MSR_H_
 
 /* CPU model specific register (MSR) numbers */
 
@@ -435,4 +435,4 @@
 #define MSR_VM_IGNNE                    0xc0010115
 #define MSR_VM_HSAVE_PA                 0xc0010117
 
-#endif /* _ASM_X86_MSR_INDEX_H */
+#endif /* _X86_MSR_H_ */
lib/x86/processor.h +2 -2
index abc04b08afb0..b6068f52d850 100644
@@ -1,5 +1,5 @@
-#ifndef LIBCFLAT_PROCESSOR_H
-#define LIBCFLAT_PROCESSOR_H
+#ifndef _X86_PROCESSOR_H_
+#define _X86_PROCESSOR_H_
 
 #include "libcflat.h"
 #include "desc.h"
lib/x86/smp.h +2 -2
index 09dfa86f123b..f74845e6903c 100644
@@ -1,5 +1,5 @@
-#ifndef __SMP_H
-#define __SMP_H
+#ifndef _X86_SMP_H_
+#define _X86_SMP_H_
 #include <asm/spinlock.h>
 
 void smp_init(void);
lib/x86/usermode.h +2 -2
index 4e005e65f917..04e358e2a3a3 100644
@@ -1,5 +1,5 @@
-#ifndef _USERMODE_H_
-#define _USERMODE_H_
+#ifndef _X86_USERMODE_H_
+#define _X86_USERMODE_H_
 
 #include "x86/msr.h"
 #include "x86/processor.h"
lib/x86/vm.h +2 -2
index 3a1432f39d2a..d9753c3d4606 100644
@@ -1,5 +1,5 @@
-#ifndef VM_H
-#define VM_H
+#ifndef _X86_VM_H_
+#define _X86_VM_H_
 
 #include "processor.h"
 #include "asm/page.h"
x86/hyperv.h +2 -2
index e135221fa28a..e3803e02f4dc 100644
@@ -1,5 +1,5 @@
-#ifndef __HYPERV_H
-#define __HYPERV_H
+#ifndef X86_HYPERV_H
+#define X86_HYPERV_H
 
 #include "libcflat.h"
 #include "processor.h"
x86/ioram.h +2 -2
index 2938142b36d3..9c816a83eae5 100644
@@ -1,5 +1,5 @@
-#ifndef __IO_RAM_H
-#define __IO_RAM_H
+#ifndef X86_IORAM_H
+#define X86_IORAM_H
 
 #define IORAM_BASE_PHYS 0xff000000UL
 #define IORAM_LEN       0x10000UL
x86/kvmclock.h +2 -2
index f823c6dbb65d..1a40a7c0f6bc 100644
@@ -1,5 +1,5 @@
-#ifndef KVMCLOCK_H
-#define KVMCLOCK_H
+#ifndef X86_KVMCLOCK_H
+#define X86_KVMCLOCK_H
 
 #define MSR_KVM_WALL_CLOCK_NEW  0x4b564d00
 #define MSR_KVM_SYSTEM_TIME_NEW 0x4b564d01
x86/svm.h +2 -2
index 593e3b0f64b1..995b0f8ccbfe 100644
@@ -1,5 +1,5 @@
-#ifndef __SVM_H
-#define __SVM_H
+#ifndef X86_SVM_H
+#define X86_SVM_H
 
 #include "libcflat.h"
 
x86/types.h +2 -2
index 047556e854d6..56ce5ececdec 100644
@@ -1,5 +1,5 @@
-#ifndef __TYPES_H
-#define __TYPES_H
+#ifndef X86_TYPES_H
+#define X86_TYPES_H
 
 #define DE_VECTOR 0
 #define DB_VECTOR 1
x86/vmx.h +2 -2
index 7e39b843cafb..2c534ca4b801 100644
@@ -1,5 +1,5 @@
-#ifndef __VMX_H
-#define __VMX_H
+#ifndef X86_VMX_H
+#define X86_VMX_H
 
 #include "libcflat.h"
 #include "processor.h"
Signature · 1 line
2.31.1
Reviewed-by on v2 7/7
#25 lore raw

Re: [kvm-unit-tests PATCH v2 7/7] x86: unify header guards

Quoted 400 lines · Cornelia Huck

Standardize header guards to _ASMX86_HEADER_H_, _X86_HEADER_H_, and X86_HEADER_H.

---
  lib/x86/acpi.h             | 4 ++--
  lib/x86/apic-defs.h        | 6 +++---
  lib/x86/apic.h             | 4 ++--
  lib/x86/asm/barrier.h      | 4 ++--
  lib/x86/asm/debugreg.h     | 6 +++---
  lib/x86/asm/io.h           | 4 ++--
  lib/x86/asm/memory_areas.h | 4 ++--
  lib/x86/asm/page.h         | 4 ++--
  lib/x86/asm/pci.h          | 4 ++--
  lib/x86/asm/spinlock.h     | 4 ++--
  lib/x86/asm/stack.h        | 4 ++--
  lib/x86/atomic.h           | 4 ++--
  lib/x86/delay.h            | 4 ++--
  lib/x86/desc.h             | 4 ++--
  lib/x86/fault_test.h       | 4 ++--
  lib/x86/fwcfg.h            | 4 ++--
  lib/x86/intel-iommu.h      | 4 ++--
  lib/x86/isr.h              | 4 ++--
  lib/x86/msr.h              | 6 +++---
  lib/x86/processor.h        | 4 ++--
  lib/x86/smp.h              | 4 ++--
  lib/x86/usermode.h         | 4 ++--
  lib/x86/vm.h               | 4 ++--
  x86/hyperv.h               | 4 ++--
  x86/ioram.h                | 4 ++--
  x86/kvmclock.h             | 4 ++--
  x86/svm.h                  | 4 ++--
  x86/types.h                | 4 ++--
  x86/vmx.h                  | 4 ++--
  29 files changed, 61 insertions(+), 61 deletions(-)
lib/x86/acpi.h +2 -2
index 08aaf57a7890..1b803740f331 100644
@@ -1,5 +1,5 @@
-#ifndef KVM_ACPI_H
-#define KVM_ACPI_H 1
+#ifndef _X86_ACPI_H_
+#define _X86_ACPI_H_
 
  #include "libcflat.h"
 
lib/x86/apic-defs.h +3 -3
index b2014de800a7..dabefe7879ea 100644
@@ -1,5 +1,5 @@
-#ifndef _ASM_X86_APICDEF_H
-#define _ASM_X86_APICDEF_H
+#ifndef _X86_APIC_DEFS_H_
+#define _X86_APIC_DEFS_H_
 
  /*
   * Abuse this header file to hold the number of max-cpus, making it available
@@ -144,4 +144,4 @@
 
  #define APIC_BASE_MSR	0x800
 
-#endif /* _ASM_X86_APICDEF_H */
+#endif /* _X86_APIC_DEFS_H_ */
lib/x86/apic.h +2 -2
index a7eff6354a83..c4821716b352 100644
@@ -1,5 +1,5 @@
-#ifndef CFLAT_APIC_H
-#define CFLAT_APIC_H
+#ifndef _X86_APIC_H_
+#define _X86_APIC_H_
 
  #include <stdint.h>
  #include "apic-defs.h"
lib/x86/asm/barrier.h +2 -2
index 193fb4c2e712..66c8f56f1c9a 100644
@@ -1,5 +1,5 @@
-#ifndef _ASM_X86_BARRIER_H_
-#define _ASM_X86_BARRIER_H_
+#ifndef _ASMX86_BARRIER_H_
+#define _ASMX86_BARRIER_H_
  /*
   * Copyright (C) 2016, Red Hat Inc, Alexander Gordeev <[email protected]>
   *
lib/x86/asm/debugreg.h +3 -3
index d95d080b30e3..e86f5a629480 100644
@@ -1,6 +1,6 @@
  /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
-#ifndef _UAPI_ASM_X86_DEBUGREG_H
-#define _UAPI_ASM_X86_DEBUGREG_H
+#ifndef _ASMX86_DEBUGREG_H_
+#define _ASMX86_DEBUGREG_H_
 
 
  /* Indicate the register numbers for a number of the specific
@@ -78,4 +78,4 @@
   * HW breakpoint additions
   */
 
-#endif /* _UAPI_ASM_X86_DEBUGREG_H */
+#endif /* _ASMX86_DEBUGREG_H_ */
lib/x86/asm/io.h +2 -2
index 35a5c7347411..88734320aa93 100644
@@ -1,5 +1,5 @@
-#ifndef _ASM_X86_IO_H_
-#define _ASM_X86_IO_H_
+#ifndef _ASMX86_IO_H_
+#define _ASMX86_IO_H_
 
  #define __iomem
 
lib/x86/asm/memory_areas.h +2 -2
index e84016f8b060..bd47a89aba7d 100644
@@ -1,5 +1,5 @@
-#ifndef _ASM_X86_MEMORY_AREAS_H_
-#define _ASM_X86_MEMORY_AREAS_H_
+#ifndef _ASMX86_MEMORY_AREAS_H_
+#define _ASMX86_MEMORY_AREAS_H_
 
  #define AREA_NORMAL_PFN BIT(36-12)
  #define AREA_NORMAL_NUMBER 0
lib/x86/asm/page.h +2 -2
index 2cf8881e16d2..fc1416071ec9 100644
@@ -1,5 +1,5 @@
-#ifndef _ASM_X86_PAGE_H_
-#define _ASM_X86_PAGE_H_
+#ifndef _ASMX86_PAGE_H_
+#define _ASMX86_PAGE_H_
  /*
   * Copyright (C) 2016, Red Hat Inc, Alexander Gordeev <[email protected]>
   *
lib/x86/asm/pci.h +2 -2
index c937e5cd71e1..03e55c277f12 100644
@@ -1,5 +1,5 @@
-#ifndef ASM_PCI_H
-#define ASM_PCI_H
+#ifndef _ASMX86_PCI_H_
+#define _ASMX86_PCI_H_
  /*
   * Copyright (C) 2013, Red Hat Inc, Michael S. Tsirkin <[email protected]>
   *
lib/x86/asm/spinlock.h +2 -2
index 692020c5185c..34fadf771c11 100644
@@ -1,5 +1,5 @@
-#ifndef __ASM_SPINLOCK_H
-#define __ASM_SPINLOCK_H
+#ifndef _ASMX86_SPINLOCK_H_
+#define _ASMX86_SPINLOCK_H_
 
  #include <asm-generic/spinlock.h>
 
lib/x86/asm/stack.h +2 -2
index b14e2c0fa012..417695373801 100644
@@ -1,5 +1,5 @@
-#ifndef _X86ASM_STACK_H_
-#define _X86ASM_STACK_H_
+#ifndef _ASMX86_STACK_H_
+#define _ASMX86_STACK_H_
 
  #ifndef _STACK_H_
  #error Do not directly include <asm/stack.h>. Just use <stack.h>.
lib/x86/atomic.h +2 -2
index c9ce489d3904..13e734bb464d 100644
@@ -1,5 +1,5 @@
-#ifndef __ATOMIC_H
-#define __ATOMIC_H
+#ifndef _X86_ATOMIC_H_
+#define _X86_ATOMIC_H_
 
  #include "asm-generic/atomic.h"
 
lib/x86/delay.h +2 -2
index a51eb34485d0..26270edb2156 100644
@@ -1,5 +1,5 @@
-#ifndef __X86_DELAY__
-#define __X86_DELAY__
+#ifndef _X86_DELAY_H_
+#define _X86_DELAY_H_
 
  #include "libcflat.h"
 
lib/x86/desc.h +2 -2
index 77b2c59d5551..a6ffb38c79a1 100644
@@ -1,5 +1,5 @@
-#ifndef __IDT_TEST__
-#define __IDT_TEST__
+#ifndef _X86_DESC_H_
+#define _X86_DESC_H_
 
  #include <setjmp.h>
 
lib/x86/fault_test.h +2 -2
index dfa715ba6720..07566365d57c 100644
@@ -1,5 +1,5 @@
-#ifndef __FAULT_TEST__
-#define __FAULT_TEST__
+#ifndef _X86_FAULT_TEST_H_
+#define _X86_FAULT_TEST_H_
 
  #include "x86/msr.h"
  #include "x86/processor.h"
lib/x86/fwcfg.h +2 -2
index ac4257e5d78e..2434cf62222a 100644
@@ -1,5 +1,5 @@
-#ifndef FWCFG_H
-#define FWCFG_H
+#ifndef _X86_FWCFG_H_
+#define _X86_FWCFG_H_
 
  #include <stdint.h>
  #include <stdbool.h>
lib/x86/intel-iommu.h +2 -2
index 05b9744b916b..e14f825e796d 100644
@@ -12,8 +12,8 @@
   * (From include/linux/intel-iommu.h)
   */
 
-#ifndef __INTEL_IOMMU_H__
-#define __INTEL_IOMMU_H__
+#ifndef _X86_INTEL_IOMMU_H_
+#define _X86_INTEL_IOMMU_H_
 
  #include "libcflat.h"
  #include "isr.h"
lib/x86/isr.h +2 -2
index a50929190b64..746ac7af4a90 100644
@@ -1,5 +1,5 @@
-#ifndef __ISR_TEST__
-#define __ISR_TEST__
+#ifndef _X86_ISR_H_
+#define _X86_ISR_H_
 
  typedef struct {
      ulong regs[sizeof(ulong)*2];
lib/x86/msr.h +3 -3
index 5213bcd55836..5001b169cc48 100644
@@ -1,5 +1,5 @@
-#ifndef _ASM_X86_MSR_INDEX_H
-#define _ASM_X86_MSR_INDEX_H
+#ifndef _X86_MSR_H_
+#define _X86_MSR_H_
 
  /* CPU model specific register (MSR) numbers */
 
@@ -435,4 +435,4 @@
  #define MSR_VM_IGNNE                    0xc0010115
  #define MSR_VM_HSAVE_PA                 0xc0010117
 
-#endif /* _ASM_X86_MSR_INDEX_H */
+#endif /* _X86_MSR_H_ */
lib/x86/processor.h +2 -2
index abc04b08afb0..b6068f52d850 100644
@@ -1,5 +1,5 @@
-#ifndef LIBCFLAT_PROCESSOR_H
-#define LIBCFLAT_PROCESSOR_H
+#ifndef _X86_PROCESSOR_H_
+#define _X86_PROCESSOR_H_
 
  #include "libcflat.h"
  #include "desc.h"
lib/x86/smp.h +2 -2
index 09dfa86f123b..f74845e6903c 100644
@@ -1,5 +1,5 @@
-#ifndef __SMP_H
-#define __SMP_H
+#ifndef _X86_SMP_H_
+#define _X86_SMP_H_
  #include <asm/spinlock.h>
 
  void smp_init(void);
lib/x86/usermode.h +2 -2
index 4e005e65f917..04e358e2a3a3 100644
@@ -1,5 +1,5 @@
-#ifndef _USERMODE_H_
-#define _USERMODE_H_
+#ifndef _X86_USERMODE_H_
+#define _X86_USERMODE_H_
 
  #include "x86/msr.h"
  #include "x86/processor.h"
lib/x86/vm.h +2 -2
index 3a1432f39d2a..d9753c3d4606 100644
@@ -1,5 +1,5 @@
-#ifndef VM_H
-#define VM_H
+#ifndef _X86_VM_H_
+#define _X86_VM_H_
 
  #include "processor.h"
  #include "asm/page.h"
x86/hyperv.h +2 -2
index e135221fa28a..e3803e02f4dc 100644
@@ -1,5 +1,5 @@
-#ifndef __HYPERV_H
-#define __HYPERV_H
+#ifndef X86_HYPERV_H
+#define X86_HYPERV_H
 
  #include "libcflat.h"
  #include "processor.h"
x86/ioram.h +2 -2
index 2938142b36d3..9c816a83eae5 100644
@@ -1,5 +1,5 @@
-#ifndef __IO_RAM_H
-#define __IO_RAM_H
+#ifndef X86_IORAM_H
+#define X86_IORAM_H
 
  #define IORAM_BASE_PHYS 0xff000000UL
  #define IORAM_LEN       0x10000UL
x86/kvmclock.h +2 -2
index f823c6dbb65d..1a40a7c0f6bc 100644
@@ -1,5 +1,5 @@
-#ifndef KVMCLOCK_H
-#define KVMCLOCK_H
+#ifndef X86_KVMCLOCK_H
+#define X86_KVMCLOCK_H
 
  #define MSR_KVM_WALL_CLOCK_NEW  0x4b564d00
  #define MSR_KVM_SYSTEM_TIME_NEW 0x4b564d01
x86/svm.h +2 -2
index 593e3b0f64b1..995b0f8ccbfe 100644
@@ -1,5 +1,5 @@
-#ifndef __SVM_H
-#define __SVM_H
+#ifndef X86_SVM_H
+#define X86_SVM_H
 
  #include "libcflat.h"
 
x86/types.h +2 -2
index 047556e854d6..56ce5ececdec 100644
@@ -1,5 +1,5 @@
-#ifndef __TYPES_H
-#define __TYPES_H
+#ifndef X86_TYPES_H
+#define X86_TYPES_H
 
  #define DE_VECTOR 0
  #define DB_VECTOR 1
x86/vmx.h +0 -0
index 7e39b843cafb..2c534ca4b801 100644

x86/vmx.h line 5

Quoted 7 lines
x86/vmx.h +2 -2
@@ -1,5 +1,5 @@
-#ifndef __VMX_H
-#define __VMX_H
+#ifndef X86_VMX_H
+#define X86_VMX_H
 
  #include "libcflat.h"
  #include "processor.h"
Signature · 3 lines
Thanks,

David / dhildenb
maintainer Applied
#26 lore raw
In reply to Cornelia Huck
Quoted 9 lines · Cornelia Huck

This is an extension of "s390x: unify header guards" to the rest of kvm-unit-tests. I tried to choose a pattern that minimizes the changes; most of them are for s390x and x86.

v1->v2:
- change the patterns and document them
- change other architectures and architecture-independent code as well

[...]

Applied, thanks!

[1/7] README.md: add guideline for header guards format

      commit: 844669a9631d78a54b47f6667c9a2750b65d101c
[2/7] lib: unify header guards
      commit: 9f0ae3012430ed7072d04247fb674125c616a6b4
[3/7] asm-generic: unify header guards
      commit: 951e6299b30016bf04a343973296c4274e87f0e2
[4/7] arm: unify header guards
      commit: 16f52ec9a4763e62e35453497e4f077031abcbfb
[5/7] powerpc: unify header guards
      commit: 040ee6d9aee563b2b1f28e810c5e36fbbcc17bd9
[6/7] s390x: unify header guards
      commit: eb5a1bbab00619256b76177e7a88cfe05834b026
[7/7] x86: unify header guards
      commit: c865f654ffe4c5955038aaf74f702ba62f3eb014

Best regards,

Signature · 1 line
Paolo Bonzini <[email protected]>
#27 lore raw
Quoted 14 lines · Paolo Bonzini
Quoted 9 lines · Cornelia Huck

This is an extension of "s390x: unify header guards" to the rest of kvm-unit-tests. I tried to choose a pattern that minimizes the changes; most of them are for s390x and x86.

v1->v2:
- change the patterns and document them
- change other architectures and architecture-independent code as well

[...]

Applied, thanks!

[1/7] README.md: add guideline for header guards format

Quoted 13 lines
      commit: 844669a9631d78a54b47f6667c9a2750b65d101c
[2/7] lib: unify header guards
      commit: 9f0ae3012430ed7072d04247fb674125c616a6b4
[3/7] asm-generic: unify header guards
      commit: 951e6299b30016bf04a343973296c4274e87f0e2
[4/7] arm: unify header guards
      commit: 16f52ec9a4763e62e35453497e4f077031abcbfb
[5/7] powerpc: unify header guards
      commit: 040ee6d9aee563b2b1f28e810c5e36fbbcc17bd9
[6/7] s390x: unify header guards
      commit: eb5a1bbab00619256b76177e7a88cfe05834b026
[7/7] x86: unify header guards
      commit: c865f654ffe4c5955038aaf74f702ba62f3eb014

Oh, that was quick :)

I'll do some further (small) updates on top, then.