[kvm-unit-tests PATCH v2 0/7] unify header guards

STALE1874d

28 messages, 5 authors, 2021-06-14 · open the first message on its own page

[kvm-unit-tests PATCH v2 0/7] unify header guards

From: Cornelia Huck <cohuck@redhat.com>
Date: 2021-06-09 14:37:27

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

-- 
2.31.1

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

From: Cornelia Huck <cohuck@redhat.com>
Date: 2021-06-09 14:37:30

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

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

From: David Hildenbrand <hidden>
Date: 2021-06-09 14:45:43

On 09.06.21 16:37, Cornelia Huck wrote:
quoted hunk
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 <redacted>

-- 
Thanks,

David / dhildenb

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

From: Cornelia Huck <cohuck@redhat.com>
Date: 2021-06-09 15:19:28

On Wed, Jun 09 2021, David Hildenbrand [off-list ref] wrote:
On 09.06.21 16:37, Cornelia Huck wrote:
quoted
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 <redacted>
Thanks!

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

From: Laurent Vivier <hidden>
Date: 2021-06-09 15:00:19

On 09/06/2021 16:37, Cornelia Huck wrote:
quoted hunk
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 <redacted>

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

From: Andrew Jones <hidden>
Date: 2021-06-14 09:01:55

On Wed, Jun 09, 2021 at 04:37:06PM +0200, Cornelia Huck wrote:
quoted hunk
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 [off-list ref].
-- 
2.31.1

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

From: Cornelia Huck <cohuck@redhat.com>
Date: 2021-06-09 14:37:33

Standardize header guards to _LIB_HEADER_H_.

Signed-off-by: Cornelia Huck <cohuck@redhat.com>
---
 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(-)
diff --git a/lib/alloc_page.h b/lib/alloc_page.h
index 1af1419d49b6..eed2ba06eeaf 100644
--- a/lib/alloc_page.h
+++ b/lib/alloc_page.h
@@ -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>
diff --git a/lib/libcflat.h b/lib/libcflat.h
index 460a1234ea6a..f40b431d1550 100644
--- a/lib/libcflat.h
+++ b/lib/libcflat.h
@@ -17,8 +17,8 @@
  * Authors: Hollis Blanchard <hollisb@us.ibm.com>
  */
 
-#ifndef __LIBCFLAT_H
-#define __LIBCFLAT_H
+#ifndef _LIBCFLAT_H_
+#define _LIBCFLAT_H_
 
 #ifndef __ASSEMBLY__
 
diff --git a/lib/list.h b/lib/list.h
index 7f9717ef6258..ed3e52b40075 100644
--- a/lib/list.h
+++ b/lib/list.h
@@ -1,5 +1,5 @@
-#ifndef LIST_H
-#define LIST_H
+#ifndef _LIST_H_
+#define _LIST_H_
 
 #include <stdbool.h>
 
diff --git a/lib/pci-edu.h b/lib/pci-edu.h
index 44b4ba168768..9db94aec0bc7 100644
--- a/lib/pci-edu.h
+++ b/lib/pci-edu.h
@@ -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"
diff --git a/lib/pci-host-generic.h b/lib/pci-host-generic.h
index 0ffe6380ec8f..3020ee22c837 100644
--- a/lib/pci-host-generic.h
+++ b/lib/pci-host-generic.h
@@ -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
  *
diff --git a/lib/setjmp.h b/lib/setjmp.h
index 2c56b4c68aaa..6afdf665681a 100644
--- a/lib/setjmp.h
+++ b/lib/setjmp.h
@@ -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];
diff --git a/lib/string.h b/lib/string.h
index e1febfed7fb2..b07763eaef10 100644
--- a/lib/string.h
+++ b/lib/string.h
@@ -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_ */
diff --git a/lib/vmalloc.h b/lib/vmalloc.h
index 8b158f591d75..346f94f198c5 100644
--- a/lib/vmalloc.h
+++ b/lib/vmalloc.h
@@ -1,5 +1,5 @@
-#ifndef VMALLOC_H
-#define VMALLOC_H 1
+#ifndef _VMALLOC_H_
+#define _VMALLOC_H_
 
 #include <asm/page.h>
 
-- 
2.31.1

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

From: David Hildenbrand <hidden>
Date: 2021-06-09 14:46:09

On 09.06.21 16:37, Cornelia Huck wrote:
quoted hunk
Standardize header guards to _LIB_HEADER_H_.

Signed-off-by: Cornelia Huck <cohuck@redhat.com>
---
  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(-)
diff --git a/lib/alloc_page.h b/lib/alloc_page.h
index 1af1419d49b6..eed2ba06eeaf 100644
--- a/lib/alloc_page.h
+++ b/lib/alloc_page.h
@@ -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>
diff --git a/lib/libcflat.h b/lib/libcflat.h
index 460a1234ea6a..f40b431d1550 100644
--- a/lib/libcflat.h
+++ b/lib/libcflat.h
@@ -17,8 +17,8 @@
   * Authors: Hollis Blanchard <hollisb@us.ibm.com>
   */
  
-#ifndef __LIBCFLAT_H
-#define __LIBCFLAT_H
+#ifndef _LIBCFLAT_H_
+#define _LIBCFLAT_H_
  
  #ifndef __ASSEMBLY__
  
diff --git a/lib/list.h b/lib/list.h
index 7f9717ef6258..ed3e52b40075 100644
--- a/lib/list.h
+++ b/lib/list.h
@@ -1,5 +1,5 @@
-#ifndef LIST_H
-#define LIST_H
+#ifndef _LIST_H_
+#define _LIST_H_
  
  #include <stdbool.h>
  
diff --git a/lib/pci-edu.h b/lib/pci-edu.h
index 44b4ba168768..9db94aec0bc7 100644
--- a/lib/pci-edu.h
+++ b/lib/pci-edu.h
@@ -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"
diff --git a/lib/pci-host-generic.h b/lib/pci-host-generic.h
index 0ffe6380ec8f..3020ee22c837 100644
--- a/lib/pci-host-generic.h
+++ b/lib/pci-host-generic.h
@@ -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
   *
diff --git a/lib/setjmp.h b/lib/setjmp.h
index 2c56b4c68aaa..6afdf665681a 100644
--- a/lib/setjmp.h
+++ b/lib/setjmp.h
@@ -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];
diff --git a/lib/string.h b/lib/string.h
index e1febfed7fb2..b07763eaef10 100644
--- a/lib/string.h
+++ b/lib/string.h
@@ -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_ */
diff --git a/lib/vmalloc.h b/lib/vmalloc.h
index 8b158f591d75..346f94f198c5 100644
--- a/lib/vmalloc.h
+++ b/lib/vmalloc.h
@@ -1,5 +1,5 @@
-#ifndef VMALLOC_H
-#define VMALLOC_H 1
+#ifndef _VMALLOC_H_
+#define _VMALLOC_H_
  
  #include <asm/page.h>
  
Reviewed-by: David Hildenbrand <redacted>

-- 
Thanks,

David / dhildenb

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

From: Laurent Vivier <hidden>
Date: 2021-06-09 15:14:07

On 09/06/2021 16:37, Cornelia Huck wrote:
Standardize header guards to _LIB_HEADER_H_.

Signed-off-by: Cornelia Huck <cohuck@redhat.com>
---
 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 hunk
diff --git a/lib/alloc_page.h b/lib/alloc_page.h
index 1af1419d49b6..eed2ba06eeaf 100644
--- a/lib/alloc_page.h
+++ b/lib/alloc_page.h
@@ -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>
diff --git a/lib/libcflat.h b/lib/libcflat.h
index 460a1234ea6a..f40b431d1550 100644
--- a/lib/libcflat.h
+++ b/lib/libcflat.h
@@ -17,8 +17,8 @@
  * Authors: Hollis Blanchard <hollisb@us.ibm.com>
  */
 
-#ifndef __LIBCFLAT_H
-#define __LIBCFLAT_H
+#ifndef _LIBCFLAT_H_
+#define _LIBCFLAT_H_
 
 #ifndef __ASSEMBLY__
 
diff --git a/lib/list.h b/lib/list.h
index 7f9717ef6258..ed3e52b40075 100644
--- a/lib/list.h
+++ b/lib/list.h
@@ -1,5 +1,5 @@
-#ifndef LIST_H
-#define LIST_H
+#ifndef _LIST_H_
+#define _LIST_H_
 
 #include <stdbool.h>
 
diff --git a/lib/pci-edu.h b/lib/pci-edu.h
index 44b4ba168768..9db94aec0bc7 100644
--- a/lib/pci-edu.h
+++ b/lib/pci-edu.h
@@ -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"
diff --git a/lib/pci-host-generic.h b/lib/pci-host-generic.h
index 0ffe6380ec8f..3020ee22c837 100644
--- a/lib/pci-host-generic.h
+++ b/lib/pci-host-generic.h
@@ -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
  *
diff --git a/lib/setjmp.h b/lib/setjmp.h
index 2c56b4c68aaa..6afdf665681a 100644
--- a/lib/setjmp.h
+++ b/lib/setjmp.h
@@ -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];
diff --git a/lib/string.h b/lib/string.h
index e1febfed7fb2..b07763eaef10 100644
--- a/lib/string.h
+++ b/lib/string.h
@@ -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_ */
diff --git a/lib/vmalloc.h b/lib/vmalloc.h
index 8b158f591d75..346f94f198c5 100644
--- a/lib/vmalloc.h
+++ b/lib/vmalloc.h
@@ -1,5 +1,5 @@
-#ifndef VMALLOC_H
-#define VMALLOC_H 1
+#ifndef _VMALLOC_H_
+#define _VMALLOC_H_
 
 #include <asm/page.h>
 

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

From: Cornelia Huck <cohuck@redhat.com>
Date: 2021-06-09 15:38:01

On Wed, Jun 09 2021, Laurent Vivier [off-list ref] wrote:
On 09/06/2021 16:37, Cornelia Huck wrote:
quoted
Standardize header guards to _LIB_HEADER_H_.

Signed-off-by: Cornelia Huck <cohuck@redhat.com>
---
 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?
argv.h does not have a header guard yet (it probably should?)

I forgot to commit my changes to pci.h, I think :(
And there is also this instance of CONFIG_H in lib/config.h generated
by configure.
Yeah, we should tweak the generator for that.

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

From: Laurent Vivier <hidden>
Date: 2021-06-09 15:49:32

On 09/06/2021 17:37, Cornelia Huck wrote:
On Wed, Jun 09 2021, Laurent Vivier [off-list ref] wrote:
quoted
On 09/06/2021 16:37, Cornelia Huck wrote:
quoted
Standardize header guards to _LIB_HEADER_H_.

Signed-off-by: Cornelia Huck <cohuck@redhat.com>
---
 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?
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

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

From: Cornelia Huck <cohuck@redhat.com>
Date: 2021-06-09 14:37:36

Standardize header guards to _ASM_GENERIC_HEADER_H_.

Signed-off-by: Cornelia Huck <cohuck@redhat.com>
---
 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(-)
diff --git a/lib/asm-generic/atomic.h b/lib/asm-generic/atomic.h
index 26b645a7cc18..b09ce95053e7 100644
--- a/lib/asm-generic/atomic.h
+++ b/lib/asm-generic/atomic.h
@@ -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)
diff --git a/lib/asm-generic/barrier.h b/lib/asm-generic/barrier.h
index 6a990ff8d5a5..5499a5664d4d 100644
--- a/lib/asm-generic/barrier.h
+++ b/lib/asm-generic/barrier.h
@@ -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_ */
diff --git a/lib/asm-generic/memory_areas.h b/lib/asm-generic/memory_areas.h
index 3074afe23393..c86db255ecee 100644
--- a/lib/asm-generic/memory_areas.h
+++ b/lib/asm-generic/memory_areas.h
@@ -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
diff --git a/lib/asm-generic/pci-host-bridge.h b/lib/asm-generic/pci-host-bridge.h
index 9e91499b9446..174ff341dd0d 100644
--- a/lib/asm-generic/pci-host-bridge.h
+++ b/lib/asm-generic/pci-host-bridge.h
@@ -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 <agordeev@redhat.com>
  *
-- 
2.31.1

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

From: David Hildenbrand <hidden>
Date: 2021-06-09 14:46:28

On 09.06.21 16:37, Cornelia Huck wrote:
quoted hunk
Standardize header guards to _ASM_GENERIC_HEADER_H_.

Signed-off-by: Cornelia Huck <cohuck@redhat.com>
---
  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(-)
diff --git a/lib/asm-generic/atomic.h b/lib/asm-generic/atomic.h
index 26b645a7cc18..b09ce95053e7 100644
--- a/lib/asm-generic/atomic.h
+++ b/lib/asm-generic/atomic.h
@@ -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)
diff --git a/lib/asm-generic/barrier.h b/lib/asm-generic/barrier.h
index 6a990ff8d5a5..5499a5664d4d 100644
--- a/lib/asm-generic/barrier.h
+++ b/lib/asm-generic/barrier.h
@@ -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_ */
diff --git a/lib/asm-generic/memory_areas.h b/lib/asm-generic/memory_areas.h
index 3074afe23393..c86db255ecee 100644
--- a/lib/asm-generic/memory_areas.h
+++ b/lib/asm-generic/memory_areas.h
@@ -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
diff --git a/lib/asm-generic/pci-host-bridge.h b/lib/asm-generic/pci-host-bridge.h
index 9e91499b9446..174ff341dd0d 100644
--- a/lib/asm-generic/pci-host-bridge.h
+++ b/lib/asm-generic/pci-host-bridge.h
@@ -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 <agordeev@redhat.com>
   *
Reviewed-by: David Hildenbrand <redacted>

-- 
Thanks,

David / dhildenb

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

From: Laurent Vivier <hidden>
Date: 2021-06-09 15:15:33

On 09/06/2021 16:37, Cornelia Huck wrote:
quoted hunk
Standardize header guards to _ASM_GENERIC_HEADER_H_.

Signed-off-by: Cornelia Huck <cohuck@redhat.com>
---
 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(-)
diff --git a/lib/asm-generic/atomic.h b/lib/asm-generic/atomic.h
index 26b645a7cc18..b09ce95053e7 100644
--- a/lib/asm-generic/atomic.h
+++ b/lib/asm-generic/atomic.h
@@ -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)
diff --git a/lib/asm-generic/barrier.h b/lib/asm-generic/barrier.h
index 6a990ff8d5a5..5499a5664d4d 100644
--- a/lib/asm-generic/barrier.h
+++ b/lib/asm-generic/barrier.h
@@ -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_ */
diff --git a/lib/asm-generic/memory_areas.h b/lib/asm-generic/memory_areas.h
index 3074afe23393..c86db255ecee 100644
--- a/lib/asm-generic/memory_areas.h
+++ b/lib/asm-generic/memory_areas.h
@@ -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
diff --git a/lib/asm-generic/pci-host-bridge.h b/lib/asm-generic/pci-host-bridge.h
index 9e91499b9446..174ff341dd0d 100644
--- a/lib/asm-generic/pci-host-bridge.h
+++ b/lib/asm-generic/pci-host-bridge.h
@@ -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 <agordeev@redhat.com>
  *
Reviewed-by: Laurent Vivier <redacted>

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

From: Cornelia Huck <cohuck@redhat.com>
Date: 2021-06-09 14:37:38

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_ */
-- 
2.31.1

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

From: David Hildenbrand <hidden>
Date: 2021-06-09 14:46:59

On 09.06.21 16:37, Cornelia Huck wrote:
quoted hunk
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 <redacted>

-- 
Thanks,

David / dhildenb

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

From: Laurent Vivier <hidden>
Date: 2021-06-09 15:25:10

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
quoted hunk
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_ */

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

From: Cornelia Huck <cohuck@redhat.com>
Date: 2021-06-09 15:47:43

On Wed, Jun 09 2021, Laurent Vivier [off-list ref] wrote:
On 09/06/2021 16:37, Cornelia Huck wrote:
quoted
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.

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

From: Laurent Vivier <hidden>
Date: 2021-06-09 15:51:49

On 09/06/2021 17:47, Cornelia Huck wrote:
On Wed, Jun 09 2021, Laurent Vivier [off-list ref] wrote:
quoted
On 09/06/2021 16:37, Cornelia Huck wrote:
quoted
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.
quoted
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

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

From: Cornelia Huck <cohuck@redhat.com>
Date: 2021-06-09 14:37:43

Only spapr.h needed a tweak.

Signed-off-by: Cornelia Huck <cohuck@redhat.com>
---
 powerpc/spapr.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/powerpc/spapr.h b/powerpc/spapr.h
index b41aece07968..3a29598be44f 100644
--- a/powerpc/spapr.h
+++ b/powerpc/spapr.h
@@ -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 */
-- 
2.31.1

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

From: David Hildenbrand <hidden>
Date: 2021-06-09 14:47:15

On 09.06.21 16:37, Cornelia Huck wrote:
quoted hunk
Only spapr.h needed a tweak.

Signed-off-by: Cornelia Huck <cohuck@redhat.com>
---
  powerpc/spapr.h | 6 +++---
  1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/powerpc/spapr.h b/powerpc/spapr.h
index b41aece07968..3a29598be44f 100644
--- a/powerpc/spapr.h
+++ b/powerpc/spapr.h
@@ -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 */
Reviewed-by: David Hildenbrand <redacted>

-- 
Thanks,

David / dhildenb

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

From: Laurent Vivier <hidden>
Date: 2021-06-09 14:59:39

On 09/06/2021 16:37, Cornelia Huck wrote:
quoted hunk
Only spapr.h needed a tweak.

Signed-off-by: Cornelia Huck <cohuck@redhat.com>
---
 powerpc/spapr.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/powerpc/spapr.h b/powerpc/spapr.h
index b41aece07968..3a29598be44f 100644
--- a/powerpc/spapr.h
+++ b/powerpc/spapr.h
@@ -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 */
Reviewed-by: Laurent Vivier <redacted>

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

From: Cornelia Huck <cohuck@redhat.com>
Date: 2021-06-09 14:37:51

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

Signed-off-by: Cornelia Huck <cohuck@redhat.com>
---
 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(-)
diff --git a/lib/s390x/asm/arch_def.h b/lib/s390x/asm/arch_def.h
index 7e2c5e623ab2..76f9e3862965 100644
--- a/lib/s390x/asm/arch_def.h
+++ b/lib/s390x/asm/arch_def.h
@@ -5,8 +5,8 @@
  * Authors:
  *  David Hildenbrand <david@redhat.com>
  */
-#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;
diff --git a/lib/s390x/asm/barrier.h b/lib/s390x/asm/barrier.h
index 8e2fd6d90034..9534f9e8fa96 100644
--- a/lib/s390x/asm/barrier.h
+++ b/lib/s390x/asm/barrier.h
@@ -6,8 +6,8 @@
  *  Thomas Huth <thuth@redhat.com>
  *  David Hildenbrand <david@redhat.com>
  */
-#ifndef _ASM_S390X_BARRIER_H_
-#define _ASM_S390X_BARRIER_H_
+#ifndef _ASMS390X_BARRIER_H_
+#define _ASMS390X_BARRIER_H_
 
 #include <asm-generic/barrier.h>
 
diff --git a/lib/s390x/asm/cpacf.h b/lib/s390x/asm/cpacf.h
index 805fcf1a2d71..685262b0ff62 100644
--- a/lib/s390x/asm/cpacf.h
+++ b/lib/s390x/asm/cpacf.h
@@ -8,8 +8,8 @@
  *	      Harald Freudenberger (freude@de.ibm.com)
  *	      Martin Schwidefsky <schwidefsky@de.ibm.com>
  */
-#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_ */
diff --git a/lib/s390x/asm/facility.h b/lib/s390x/asm/facility.h
index 95d4a15fe34f..ef0fd037ed35 100644
--- a/lib/s390x/asm/facility.h
+++ b/lib/s390x/asm/facility.h
@@ -5,8 +5,8 @@
  * Authors:
  *  David Hildenbrand <david@redhat.com>
  */
-#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>
diff --git a/lib/s390x/asm/float.h b/lib/s390x/asm/float.h
index 136794475849..eb752050b162 100644
--- a/lib/s390x/asm/float.h
+++ b/lib/s390x/asm/float.h
@@ -5,8 +5,8 @@
  * Authors:
  *  David Hildenbrand <david@redhat.com>
  */
-#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)
 {
diff --git a/lib/s390x/asm/mem.h b/lib/s390x/asm/mem.h
index 281390ebd816..1963cef7ec03 100644
--- a/lib/s390x/asm/mem.h
+++ b/lib/s390x/asm/mem.h
@@ -5,8 +5,8 @@
  * Copyright IBM Corp. 2018
  * Author(s): Janosch Frank <frankja@de.ibm.com>
  */
-#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
diff --git a/lib/s390x/asm/sigp.h b/lib/s390x/asm/sigp.h
index 00844d26d15a..61d2c6256fed 100644
--- a/lib/s390x/asm/sigp.h
+++ b/lib/s390x/asm/sigp.h
@@ -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_ */
diff --git a/lib/s390x/asm/spinlock.h b/lib/s390x/asm/spinlock.h
index 677d2cd6e287..22d4d3899569 100644
--- a/lib/s390x/asm/spinlock.h
+++ b/lib/s390x/asm/spinlock.h
@@ -6,8 +6,8 @@
  *  Thomas Huth <thuth@redhat.com>
  *  David Hildenbrand <david@redhat.com>
  */
-#ifndef __ASMS390X_SPINLOCK_H
-#define __ASMS390X_SPINLOCK_H
+#ifndef _ASMS390X_SPINLOCK_H_
+#define _ASMS390X_SPINLOCK_H_
 
 #include <asm-generic/spinlock.h>
 
diff --git a/lib/s390x/asm/time.h b/lib/s390x/asm/time.h
index 0d67f7231992..7652a151e87a 100644
--- a/lib/s390x/asm/time.h
+++ b/lib/s390x/asm/time.h
@@ -8,8 +8,8 @@
  * Copied from the s390/intercept test by:
  *  Pierre Morel <pmorel@linux.ibm.com>
  */
-#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)
diff --git a/lib/s390x/asm/uv.h b/lib/s390x/asm/uv.h
index b22cbaa87109..dc3e02dea1b4 100644
--- a/lib/s390x/asm/uv.h
+++ b/lib/s390x/asm/uv.h
@@ -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
diff --git a/lib/s390x/css.h b/lib/s390x/css.h
index 7e3d2613402e..d644971fb2b7 100644
--- a/lib/s390x/css.h
+++ b/lib/s390x/css.h
@@ -6,8 +6,8 @@
  * Author: Pierre Morel <pmorel@linux.ibm.com>
  */
 
-#ifndef CSS_H
-#define CSS_H
+#ifndef _S390X_CSS_H_
+#define _S390X_CSS_H_
 
 #define lowcore_ptr ((struct lowcore *)0x0)
 
diff --git a/lib/s390x/interrupt.h b/lib/s390x/interrupt.h
index 1973d267c2f1..99fa0beee9ad 100644
--- a/lib/s390x/interrupt.h
+++ b/lib/s390x/interrupt.h
@@ -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));
diff --git a/lib/s390x/mmu.h b/lib/s390x/mmu.h
index 603f289e8e00..b995f85b839f 100644
--- a/lib/s390x/mmu.h
+++ b/lib/s390x/mmu.h
@@ -7,8 +7,8 @@
  * Authors:
  *	Janosch Frank <frankja@de.ibm.com>
  */
-#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);
diff --git a/lib/s390x/sclp.h b/lib/s390x/sclp.h
index 7abf1038f5ee..28e526e2c915 100644
--- a/lib/s390x/sclp.h
+++ b/lib/s390x/sclp.h
@@ -10,8 +10,8 @@
  * Author: Christian Borntraeger <borntraeger@de.ibm.com>
  */
 
-#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_ */
diff --git a/lib/s390x/sie.h b/lib/s390x/sie.h
index 518613baf1fa..db30d6164ab6 100644
--- a/lib/s390x/sie.h
+++ b/lib/s390x/sie.h
@@ -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_ */
diff --git a/lib/s390x/smp.h b/lib/s390x/smp.h
index 67ff16ca3c52..a2609f11e40b 100644
--- a/lib/s390x/smp.h
+++ b/lib/s390x/smp.h
@@ -7,8 +7,8 @@
  * Authors:
  *  Janosch Frank <frankja@linux.ibm.com>
  */
-#ifndef SMP_H
-#define SMP_H
+#ifndef _S390X_SMP_H_
+#define _S390X_SMP_H_
 
 #include <asm/arch_def.h>
 
diff --git a/lib/s390x/uv.h b/lib/s390x/uv.h
index 42608a967a03..2b23407a2fcf 100644
--- a/lib/s390x/uv.h
+++ b/lib/s390x/uv.h
@@ -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);
diff --git a/lib/s390x/vm.h b/lib/s390x/vm.h
index 16722760cb46..7abba0ccae3d 100644
--- a/lib/s390x/vm.h
+++ b/lib/s390x/vm.h
@@ -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_ */
diff --git a/s390x/sthyi.h b/s390x/sthyi.h
index bbd74c6197c3..0a47c2385dc7 100644
--- a/s390x/sthyi.h
+++ b/s390x/sthyi.h
@@ -7,8 +7,8 @@
  * Authors:
  *    Janosch Frank <frankja@linux.vnet.ibm.com>
  */
-#ifndef _STHYI_H_
-#define _STHYI_H_
+#ifndef S390X_STHYI_H
+#define S390X_STHYI_H
 
 #include <stdint.h>
 
-- 
2.31.1

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

From: David Hildenbrand <hidden>
Date: 2021-06-09 14:48:16

On 09.06.21 16:37, Cornelia Huck wrote:
quoted hunk
Standardize header guards to _ASMS390X_HEADER_H_, _S390X_HEADER_H_,
and S390X_HEADER_H, respectively.

Signed-off-by: Cornelia Huck <cohuck@redhat.com>
---
  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(-)
diff --git a/lib/s390x/asm/arch_def.h b/lib/s390x/asm/arch_def.h
index 7e2c5e623ab2..76f9e3862965 100644
--- a/lib/s390x/asm/arch_def.h
+++ b/lib/s390x/asm/arch_def.h
@@ -5,8 +5,8 @@
   * Authors:
   *  David Hildenbrand <david@redhat.com>
   */
-#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;
diff --git a/lib/s390x/asm/barrier.h b/lib/s390x/asm/barrier.h
index 8e2fd6d90034..9534f9e8fa96 100644
--- a/lib/s390x/asm/barrier.h
+++ b/lib/s390x/asm/barrier.h
@@ -6,8 +6,8 @@
   *  Thomas Huth <thuth@redhat.com>
   *  David Hildenbrand <david@redhat.com>
   */
-#ifndef _ASM_S390X_BARRIER_H_
-#define _ASM_S390X_BARRIER_H_
+#ifndef _ASMS390X_BARRIER_H_
+#define _ASMS390X_BARRIER_H_
  
  #include <asm-generic/barrier.h>
  
diff --git a/lib/s390x/asm/cpacf.h b/lib/s390x/asm/cpacf.h
index 805fcf1a2d71..685262b0ff62 100644
--- a/lib/s390x/asm/cpacf.h
+++ b/lib/s390x/asm/cpacf.h
@@ -8,8 +8,8 @@
   *	      Harald Freudenberger (freude@de.ibm.com)
   *	      Martin Schwidefsky <schwidefsky@de.ibm.com>
   */
-#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_ */
diff --git a/lib/s390x/asm/facility.h b/lib/s390x/asm/facility.h
index 95d4a15fe34f..ef0fd037ed35 100644
--- a/lib/s390x/asm/facility.h
+++ b/lib/s390x/asm/facility.h
@@ -5,8 +5,8 @@
   * Authors:
   *  David Hildenbrand <david@redhat.com>
   */
-#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>
diff --git a/lib/s390x/asm/float.h b/lib/s390x/asm/float.h
index 136794475849..eb752050b162 100644
--- a/lib/s390x/asm/float.h
+++ b/lib/s390x/asm/float.h
@@ -5,8 +5,8 @@
   * Authors:
   *  David Hildenbrand <david@redhat.com>
   */
-#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)
  {
diff --git a/lib/s390x/asm/mem.h b/lib/s390x/asm/mem.h
index 281390ebd816..1963cef7ec03 100644
--- a/lib/s390x/asm/mem.h
+++ b/lib/s390x/asm/mem.h
@@ -5,8 +5,8 @@
   * Copyright IBM Corp. 2018
   * Author(s): Janosch Frank <frankja@de.ibm.com>
   */
-#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
diff --git a/lib/s390x/asm/sigp.h b/lib/s390x/asm/sigp.h
index 00844d26d15a..61d2c6256fed 100644
--- a/lib/s390x/asm/sigp.h
+++ b/lib/s390x/asm/sigp.h
@@ -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_ */
diff --git a/lib/s390x/asm/spinlock.h b/lib/s390x/asm/spinlock.h
index 677d2cd6e287..22d4d3899569 100644
--- a/lib/s390x/asm/spinlock.h
+++ b/lib/s390x/asm/spinlock.h
@@ -6,8 +6,8 @@
   *  Thomas Huth <thuth@redhat.com>
   *  David Hildenbrand <david@redhat.com>
   */
-#ifndef __ASMS390X_SPINLOCK_H
-#define __ASMS390X_SPINLOCK_H
+#ifndef _ASMS390X_SPINLOCK_H_
+#define _ASMS390X_SPINLOCK_H_
  
  #include <asm-generic/spinlock.h>
  
diff --git a/lib/s390x/asm/time.h b/lib/s390x/asm/time.h
index 0d67f7231992..7652a151e87a 100644
--- a/lib/s390x/asm/time.h
+++ b/lib/s390x/asm/time.h
@@ -8,8 +8,8 @@
   * Copied from the s390/intercept test by:
   *  Pierre Morel <pmorel@linux.ibm.com>
   */
-#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)
diff --git a/lib/s390x/asm/uv.h b/lib/s390x/asm/uv.h
index b22cbaa87109..dc3e02dea1b4 100644
--- a/lib/s390x/asm/uv.h
+++ b/lib/s390x/asm/uv.h
@@ -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
diff --git a/lib/s390x/css.h b/lib/s390x/css.h
index 7e3d2613402e..d644971fb2b7 100644
--- a/lib/s390x/css.h
+++ b/lib/s390x/css.h
@@ -6,8 +6,8 @@
   * Author: Pierre Morel <pmorel@linux.ibm.com>
   */
  
-#ifndef CSS_H
-#define CSS_H
+#ifndef _S390X_CSS_H_
+#define _S390X_CSS_H_
  
  #define lowcore_ptr ((struct lowcore *)0x0)
  
diff --git a/lib/s390x/interrupt.h b/lib/s390x/interrupt.h
index 1973d267c2f1..99fa0beee9ad 100644
--- a/lib/s390x/interrupt.h
+++ b/lib/s390x/interrupt.h
@@ -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));
diff --git a/lib/s390x/mmu.h b/lib/s390x/mmu.h
index 603f289e8e00..b995f85b839f 100644
--- a/lib/s390x/mmu.h
+++ b/lib/s390x/mmu.h
@@ -7,8 +7,8 @@
   * Authors:
   *	Janosch Frank <frankja@de.ibm.com>
   */
-#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);
diff --git a/lib/s390x/sclp.h b/lib/s390x/sclp.h
index 7abf1038f5ee..28e526e2c915 100644
--- a/lib/s390x/sclp.h
+++ b/lib/s390x/sclp.h
@@ -10,8 +10,8 @@
   * Author: Christian Borntraeger <borntraeger@de.ibm.com>
   */
  
-#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_ */
diff --git a/lib/s390x/sie.h b/lib/s390x/sie.h
index 518613baf1fa..db30d6164ab6 100644
--- a/lib/s390x/sie.h
+++ b/lib/s390x/sie.h
@@ -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_ */
diff --git a/lib/s390x/smp.h b/lib/s390x/smp.h
index 67ff16ca3c52..a2609f11e40b 100644
--- a/lib/s390x/smp.h
+++ b/lib/s390x/smp.h
@@ -7,8 +7,8 @@
   * Authors:
   *  Janosch Frank <frankja@linux.ibm.com>
   */
-#ifndef SMP_H
-#define SMP_H
+#ifndef _S390X_SMP_H_
+#define _S390X_SMP_H_
  
  #include <asm/arch_def.h>
  
diff --git a/lib/s390x/uv.h b/lib/s390x/uv.h
index 42608a967a03..2b23407a2fcf 100644
--- a/lib/s390x/uv.h
+++ b/lib/s390x/uv.h
@@ -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);
diff --git a/lib/s390x/vm.h b/lib/s390x/vm.h
index 16722760cb46..7abba0ccae3d 100644
--- a/lib/s390x/vm.h
+++ b/lib/s390x/vm.h
@@ -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_ */
diff --git a/s390x/sthyi.h b/s390x/sthyi.h
index bbd74c6197c3..0a47c2385dc7 100644
--- a/s390x/sthyi.h
+++ b/s390x/sthyi.h
@@ -7,8 +7,8 @@
   * Authors:
   *    Janosch Frank <frankja@linux.vnet.ibm.com>
   */
-#ifndef _STHYI_H_
-#define _STHYI_H_
+#ifndef S390X_STHYI_H
+#define S390X_STHYI_H
  
  #include <stdint.h>
  
Reviewed-by: David Hildenbrand <redacted>

-- 
Thanks,

David / dhildenb

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

From: Cornelia Huck <cohuck@redhat.com>
Date: 2021-06-09 14:37:55

Standardize header guards to _ASMX86_HEADER_H_, _X86_HEADER_H_,
and X86_HEADER_H.

Signed-off-by: Cornelia Huck <cohuck@redhat.com>
---
 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(-)
diff --git a/lib/x86/acpi.h b/lib/x86/acpi.h
index 08aaf57a7890..1b803740f331 100644
--- a/lib/x86/acpi.h
+++ b/lib/x86/acpi.h
@@ -1,5 +1,5 @@
-#ifndef KVM_ACPI_H
-#define KVM_ACPI_H 1
+#ifndef _X86_ACPI_H_
+#define _X86_ACPI_H_
 
 #include "libcflat.h"
 
diff --git a/lib/x86/apic-defs.h b/lib/x86/apic-defs.h
index b2014de800a7..dabefe7879ea 100644
--- a/lib/x86/apic-defs.h
+++ b/lib/x86/apic-defs.h
@@ -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_ */
diff --git a/lib/x86/apic.h b/lib/x86/apic.h
index a7eff6354a83..c4821716b352 100644
--- a/lib/x86/apic.h
+++ b/lib/x86/apic.h
@@ -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"
diff --git a/lib/x86/asm/barrier.h b/lib/x86/asm/barrier.h
index 193fb4c2e712..66c8f56f1c9a 100644
--- a/lib/x86/asm/barrier.h
+++ b/lib/x86/asm/barrier.h
@@ -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 <agordeev@redhat.com>
  *
diff --git a/lib/x86/asm/debugreg.h b/lib/x86/asm/debugreg.h
index d95d080b30e3..e86f5a629480 100644
--- a/lib/x86/asm/debugreg.h
+++ b/lib/x86/asm/debugreg.h
@@ -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_ */
diff --git a/lib/x86/asm/io.h b/lib/x86/asm/io.h
index 35a5c7347411..88734320aa93 100644
--- a/lib/x86/asm/io.h
+++ b/lib/x86/asm/io.h
@@ -1,5 +1,5 @@
-#ifndef _ASM_X86_IO_H_
-#define _ASM_X86_IO_H_
+#ifndef _ASMX86_IO_H_
+#define _ASMX86_IO_H_
 
 #define __iomem
 
diff --git a/lib/x86/asm/memory_areas.h b/lib/x86/asm/memory_areas.h
index e84016f8b060..bd47a89aba7d 100644
--- a/lib/x86/asm/memory_areas.h
+++ b/lib/x86/asm/memory_areas.h
@@ -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
diff --git a/lib/x86/asm/page.h b/lib/x86/asm/page.h
index 2cf8881e16d2..fc1416071ec9 100644
--- a/lib/x86/asm/page.h
+++ b/lib/x86/asm/page.h
@@ -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 <agordeev@redhat.com>
  *
diff --git a/lib/x86/asm/pci.h b/lib/x86/asm/pci.h
index c937e5cd71e1..03e55c277f12 100644
--- a/lib/x86/asm/pci.h
+++ b/lib/x86/asm/pci.h
@@ -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 <mst@redhat.com>
  *
diff --git a/lib/x86/asm/spinlock.h b/lib/x86/asm/spinlock.h
index 692020c5185c..34fadf771c11 100644
--- a/lib/x86/asm/spinlock.h
+++ b/lib/x86/asm/spinlock.h
@@ -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>
 
diff --git a/lib/x86/asm/stack.h b/lib/x86/asm/stack.h
index b14e2c0fa012..417695373801 100644
--- a/lib/x86/asm/stack.h
+++ b/lib/x86/asm/stack.h
@@ -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>.
diff --git a/lib/x86/atomic.h b/lib/x86/atomic.h
index c9ce489d3904..13e734bb464d 100644
--- a/lib/x86/atomic.h
+++ b/lib/x86/atomic.h
@@ -1,5 +1,5 @@
-#ifndef __ATOMIC_H
-#define __ATOMIC_H
+#ifndef _X86_ATOMIC_H_
+#define _X86_ATOMIC_H_
 
 #include "asm-generic/atomic.h"
 
diff --git a/lib/x86/delay.h b/lib/x86/delay.h
index a51eb34485d0..26270edb2156 100644
--- a/lib/x86/delay.h
+++ b/lib/x86/delay.h
@@ -1,5 +1,5 @@
-#ifndef __X86_DELAY__
-#define __X86_DELAY__
+#ifndef _X86_DELAY_H_
+#define _X86_DELAY_H_
 
 #include "libcflat.h"
 
diff --git a/lib/x86/desc.h b/lib/x86/desc.h
index 77b2c59d5551..a6ffb38c79a1 100644
--- a/lib/x86/desc.h
+++ b/lib/x86/desc.h
@@ -1,5 +1,5 @@
-#ifndef __IDT_TEST__
-#define __IDT_TEST__
+#ifndef _X86_DESC_H_
+#define _X86_DESC_H_
 
 #include <setjmp.h>
 
diff --git a/lib/x86/fault_test.h b/lib/x86/fault_test.h
index dfa715ba6720..07566365d57c 100644
--- a/lib/x86/fault_test.h
+++ b/lib/x86/fault_test.h
@@ -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"
diff --git a/lib/x86/fwcfg.h b/lib/x86/fwcfg.h
index ac4257e5d78e..2434cf62222a 100644
--- a/lib/x86/fwcfg.h
+++ b/lib/x86/fwcfg.h
@@ -1,5 +1,5 @@
-#ifndef FWCFG_H
-#define FWCFG_H
+#ifndef _X86_FWCFG_H_
+#define _X86_FWCFG_H_
 
 #include <stdint.h>
 #include <stdbool.h>
diff --git a/lib/x86/intel-iommu.h b/lib/x86/intel-iommu.h
index 05b9744b916b..e14f825e796d 100644
--- a/lib/x86/intel-iommu.h
+++ b/lib/x86/intel-iommu.h
@@ -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"
diff --git a/lib/x86/isr.h b/lib/x86/isr.h
index a50929190b64..746ac7af4a90 100644
--- a/lib/x86/isr.h
+++ b/lib/x86/isr.h
@@ -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];
diff --git a/lib/x86/msr.h b/lib/x86/msr.h
index 5213bcd55836..5001b169cc48 100644
--- a/lib/x86/msr.h
+++ b/lib/x86/msr.h
@@ -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_ */
diff --git a/lib/x86/processor.h b/lib/x86/processor.h
index abc04b08afb0..b6068f52d850 100644
--- a/lib/x86/processor.h
+++ b/lib/x86/processor.h
@@ -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"
diff --git a/lib/x86/smp.h b/lib/x86/smp.h
index 09dfa86f123b..f74845e6903c 100644
--- a/lib/x86/smp.h
+++ b/lib/x86/smp.h
@@ -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);
diff --git a/lib/x86/usermode.h b/lib/x86/usermode.h
index 4e005e65f917..04e358e2a3a3 100644
--- a/lib/x86/usermode.h
+++ b/lib/x86/usermode.h
@@ -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"
diff --git a/lib/x86/vm.h b/lib/x86/vm.h
index 3a1432f39d2a..d9753c3d4606 100644
--- a/lib/x86/vm.h
+++ b/lib/x86/vm.h
@@ -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"
diff --git a/x86/hyperv.h b/x86/hyperv.h
index e135221fa28a..e3803e02f4dc 100644
--- a/x86/hyperv.h
+++ b/x86/hyperv.h
@@ -1,5 +1,5 @@
-#ifndef __HYPERV_H
-#define __HYPERV_H
+#ifndef X86_HYPERV_H
+#define X86_HYPERV_H
 
 #include "libcflat.h"
 #include "processor.h"
diff --git a/x86/ioram.h b/x86/ioram.h
index 2938142b36d3..9c816a83eae5 100644
--- a/x86/ioram.h
+++ b/x86/ioram.h
@@ -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
diff --git a/x86/kvmclock.h b/x86/kvmclock.h
index f823c6dbb65d..1a40a7c0f6bc 100644
--- a/x86/kvmclock.h
+++ b/x86/kvmclock.h
@@ -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
diff --git a/x86/svm.h b/x86/svm.h
index 593e3b0f64b1..995b0f8ccbfe 100644
--- a/x86/svm.h
+++ b/x86/svm.h
@@ -1,5 +1,5 @@
-#ifndef __SVM_H
-#define __SVM_H
+#ifndef X86_SVM_H
+#define X86_SVM_H
 
 #include "libcflat.h"
 
diff --git a/x86/types.h b/x86/types.h
index 047556e854d6..56ce5ececdec 100644
--- a/x86/types.h
+++ b/x86/types.h
@@ -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
diff --git a/x86/vmx.h b/x86/vmx.h
index 7e39b843cafb..2c534ca4b801 100644
--- a/x86/vmx.h
+++ b/x86/vmx.h
@@ -1,5 +1,5 @@
-#ifndef __VMX_H
-#define __VMX_H
+#ifndef X86_VMX_H
+#define X86_VMX_H
 
 #include "libcflat.h"
 #include "processor.h"
-- 
2.31.1

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

From: David Hildenbrand <hidden>
Date: 2021-06-09 14:49:59

On 09.06.21 16:37, Cornelia Huck wrote:
quoted hunk
Standardize header guards to _ASMX86_HEADER_H_, _X86_HEADER_H_,
and X86_HEADER_H.

Signed-off-by: Cornelia Huck <cohuck@redhat.com>
---
  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(-)
diff --git a/lib/x86/acpi.h b/lib/x86/acpi.h
index 08aaf57a7890..1b803740f331 100644
--- a/lib/x86/acpi.h
+++ b/lib/x86/acpi.h
@@ -1,5 +1,5 @@
-#ifndef KVM_ACPI_H
-#define KVM_ACPI_H 1
+#ifndef _X86_ACPI_H_
+#define _X86_ACPI_H_
  
  #include "libcflat.h"
  
diff --git a/lib/x86/apic-defs.h b/lib/x86/apic-defs.h
index b2014de800a7..dabefe7879ea 100644
--- a/lib/x86/apic-defs.h
+++ b/lib/x86/apic-defs.h
@@ -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_ */
diff --git a/lib/x86/apic.h b/lib/x86/apic.h
index a7eff6354a83..c4821716b352 100644
--- a/lib/x86/apic.h
+++ b/lib/x86/apic.h
@@ -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"
diff --git a/lib/x86/asm/barrier.h b/lib/x86/asm/barrier.h
index 193fb4c2e712..66c8f56f1c9a 100644
--- a/lib/x86/asm/barrier.h
+++ b/lib/x86/asm/barrier.h
@@ -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 <agordeev@redhat.com>
   *
diff --git a/lib/x86/asm/debugreg.h b/lib/x86/asm/debugreg.h
index d95d080b30e3..e86f5a629480 100644
--- a/lib/x86/asm/debugreg.h
+++ b/lib/x86/asm/debugreg.h
@@ -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_ */
diff --git a/lib/x86/asm/io.h b/lib/x86/asm/io.h
index 35a5c7347411..88734320aa93 100644
--- a/lib/x86/asm/io.h
+++ b/lib/x86/asm/io.h
@@ -1,5 +1,5 @@
-#ifndef _ASM_X86_IO_H_
-#define _ASM_X86_IO_H_
+#ifndef _ASMX86_IO_H_
+#define _ASMX86_IO_H_
  
  #define __iomem
  
diff --git a/lib/x86/asm/memory_areas.h b/lib/x86/asm/memory_areas.h
index e84016f8b060..bd47a89aba7d 100644
--- a/lib/x86/asm/memory_areas.h
+++ b/lib/x86/asm/memory_areas.h
@@ -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
diff --git a/lib/x86/asm/page.h b/lib/x86/asm/page.h
index 2cf8881e16d2..fc1416071ec9 100644
--- a/lib/x86/asm/page.h
+++ b/lib/x86/asm/page.h
@@ -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 <agordeev@redhat.com>
   *
diff --git a/lib/x86/asm/pci.h b/lib/x86/asm/pci.h
index c937e5cd71e1..03e55c277f12 100644
--- a/lib/x86/asm/pci.h
+++ b/lib/x86/asm/pci.h
@@ -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 <mst@redhat.com>
   *
diff --git a/lib/x86/asm/spinlock.h b/lib/x86/asm/spinlock.h
index 692020c5185c..34fadf771c11 100644
--- a/lib/x86/asm/spinlock.h
+++ b/lib/x86/asm/spinlock.h
@@ -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>
  
diff --git a/lib/x86/asm/stack.h b/lib/x86/asm/stack.h
index b14e2c0fa012..417695373801 100644
--- a/lib/x86/asm/stack.h
+++ b/lib/x86/asm/stack.h
@@ -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>.
diff --git a/lib/x86/atomic.h b/lib/x86/atomic.h
index c9ce489d3904..13e734bb464d 100644
--- a/lib/x86/atomic.h
+++ b/lib/x86/atomic.h
@@ -1,5 +1,5 @@
-#ifndef __ATOMIC_H
-#define __ATOMIC_H
+#ifndef _X86_ATOMIC_H_
+#define _X86_ATOMIC_H_
  
  #include "asm-generic/atomic.h"
  
diff --git a/lib/x86/delay.h b/lib/x86/delay.h
index a51eb34485d0..26270edb2156 100644
--- a/lib/x86/delay.h
+++ b/lib/x86/delay.h
@@ -1,5 +1,5 @@
-#ifndef __X86_DELAY__
-#define __X86_DELAY__
+#ifndef _X86_DELAY_H_
+#define _X86_DELAY_H_
  
  #include "libcflat.h"
  
diff --git a/lib/x86/desc.h b/lib/x86/desc.h
index 77b2c59d5551..a6ffb38c79a1 100644
--- a/lib/x86/desc.h
+++ b/lib/x86/desc.h
@@ -1,5 +1,5 @@
-#ifndef __IDT_TEST__
-#define __IDT_TEST__
+#ifndef _X86_DESC_H_
+#define _X86_DESC_H_
  
  #include <setjmp.h>
  
diff --git a/lib/x86/fault_test.h b/lib/x86/fault_test.h
index dfa715ba6720..07566365d57c 100644
--- a/lib/x86/fault_test.h
+++ b/lib/x86/fault_test.h
@@ -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"
diff --git a/lib/x86/fwcfg.h b/lib/x86/fwcfg.h
index ac4257e5d78e..2434cf62222a 100644
--- a/lib/x86/fwcfg.h
+++ b/lib/x86/fwcfg.h
@@ -1,5 +1,5 @@
-#ifndef FWCFG_H
-#define FWCFG_H
+#ifndef _X86_FWCFG_H_
+#define _X86_FWCFG_H_
  
  #include <stdint.h>
  #include <stdbool.h>
diff --git a/lib/x86/intel-iommu.h b/lib/x86/intel-iommu.h
index 05b9744b916b..e14f825e796d 100644
--- a/lib/x86/intel-iommu.h
+++ b/lib/x86/intel-iommu.h
@@ -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"
diff --git a/lib/x86/isr.h b/lib/x86/isr.h
index a50929190b64..746ac7af4a90 100644
--- a/lib/x86/isr.h
+++ b/lib/x86/isr.h
@@ -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];
diff --git a/lib/x86/msr.h b/lib/x86/msr.h
index 5213bcd55836..5001b169cc48 100644
--- a/lib/x86/msr.h
+++ b/lib/x86/msr.h
@@ -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_ */
diff --git a/lib/x86/processor.h b/lib/x86/processor.h
index abc04b08afb0..b6068f52d850 100644
--- a/lib/x86/processor.h
+++ b/lib/x86/processor.h
@@ -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"
diff --git a/lib/x86/smp.h b/lib/x86/smp.h
index 09dfa86f123b..f74845e6903c 100644
--- a/lib/x86/smp.h
+++ b/lib/x86/smp.h
@@ -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);
diff --git a/lib/x86/usermode.h b/lib/x86/usermode.h
index 4e005e65f917..04e358e2a3a3 100644
--- a/lib/x86/usermode.h
+++ b/lib/x86/usermode.h
@@ -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"
diff --git a/lib/x86/vm.h b/lib/x86/vm.h
index 3a1432f39d2a..d9753c3d4606 100644
--- a/lib/x86/vm.h
+++ b/lib/x86/vm.h
@@ -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"
diff --git a/x86/hyperv.h b/x86/hyperv.h
index e135221fa28a..e3803e02f4dc 100644
--- a/x86/hyperv.h
+++ b/x86/hyperv.h
@@ -1,5 +1,5 @@
-#ifndef __HYPERV_H
-#define __HYPERV_H
+#ifndef X86_HYPERV_H
+#define X86_HYPERV_H
  
  #include "libcflat.h"
  #include "processor.h"
diff --git a/x86/ioram.h b/x86/ioram.h
index 2938142b36d3..9c816a83eae5 100644
--- a/x86/ioram.h
+++ b/x86/ioram.h
@@ -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
diff --git a/x86/kvmclock.h b/x86/kvmclock.h
index f823c6dbb65d..1a40a7c0f6bc 100644
--- a/x86/kvmclock.h
+++ b/x86/kvmclock.h
@@ -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
diff --git a/x86/svm.h b/x86/svm.h
index 593e3b0f64b1..995b0f8ccbfe 100644
--- a/x86/svm.h
+++ b/x86/svm.h
@@ -1,5 +1,5 @@
-#ifndef __SVM_H
-#define __SVM_H
+#ifndef X86_SVM_H
+#define X86_SVM_H
  
  #include "libcflat.h"
  
diff --git a/x86/types.h b/x86/types.h
index 047556e854d6..56ce5ececdec 100644
--- a/x86/types.h
+++ b/x86/types.h
@@ -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
diff --git a/x86/vmx.h b/x86/vmx.h
index 7e39b843cafb..2c534ca4b801 100644
--- a/x86/vmx.h
+++ b/x86/vmx.h
@@ -1,5 +1,5 @@
-#ifndef __VMX_H
-#define __VMX_H
+#ifndef X86_VMX_H
+#define X86_VMX_H
  
  #include "libcflat.h"
  #include "processor.h"
Reviewed-by: David Hildenbrand <redacted>

-- 
Thanks,

David / dhildenb

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

From: Paolo Bonzini <pbonzini@redhat.com>
Date: 2021-06-10 12:17:33

On Wed, 9 Jun 2021 16:37:05 +0200, Cornelia Huck wrote:
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,
-- 
Paolo Bonzini [off-list ref]

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

From: Cornelia Huck <cohuck@redhat.com>
Date: 2021-06-10 13:04:22

On Thu, Jun 10 2021, Paolo Bonzini [off-list ref] wrote:
On Wed, 9 Jun 2021 16:37:05 +0200, Cornelia Huck wrote:
quoted
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
Oh, that was quick :)

I'll do some further (small) updates on top, then.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help