kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [kvm-unit-tests PATCH 0/2] header guards: further cleanup
@ 2021-06-10 13:59 Cornelia Huck
  2021-06-10 13:59 ` [kvm-unit-tests PATCH 1/2] header guards: clean up some stragglers Cornelia Huck
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Cornelia Huck @ 2021-06-10 13:59 UTC (permalink / raw)
  To: Paolo Bonzini, Thomas Huth, Andrew Jones
  Cc: kvm, Laurent Vivier, Cornelia Huck

Laurent had notices some further issues in my header guards series,
so I
- fixed some header guards I missed initially
- added header guards to some headers that actually define something
  (and don't just include another header)

I did not actually remove any header guards that might be unneeded.

Cornelia Huck (2):
  header guards: clean up some stragglers
  add header guards for non-trivial headers

 configure             | 4 ++--
 lib/argv.h            | 5 +++++
 lib/arm/asm/mmu-api.h | 4 ++--
 lib/arm/asm/mmu.h     | 6 +++---
 lib/arm/io.h          | 5 +++++
 lib/arm64/asm/mmu.h   | 6 +++---
 lib/pci.h             | 6 +++---
 lib/powerpc/io.h      | 5 +++++
 8 files changed, 28 insertions(+), 13 deletions(-)

-- 
2.31.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [kvm-unit-tests PATCH 1/2] header guards: clean up some stragglers
  2021-06-10 13:59 [kvm-unit-tests PATCH 0/2] header guards: further cleanup Cornelia Huck
@ 2021-06-10 13:59 ` Cornelia Huck
  2021-06-10 14:29   ` Laurent Vivier
  2021-06-10 13:59 ` [kvm-unit-tests PATCH 2/2] add header guards for non-trivial headers Cornelia Huck
  2021-06-10 16:58 ` [kvm-unit-tests PATCH 0/2] header guards: further cleanup Paolo Bonzini
  2 siblings, 1 reply; 6+ messages in thread
From: Cornelia Huck @ 2021-06-10 13:59 UTC (permalink / raw)
  To: Paolo Bonzini, Thomas Huth, Andrew Jones
  Cc: kvm, Laurent Vivier, Cornelia Huck

Some headers had been missed during the initial header guard
standardization.

Signed-off-by: Cornelia Huck <cohuck@redhat.com>
---
 configure             | 4 ++--
 lib/arm/asm/mmu-api.h | 4 ++--
 lib/arm/asm/mmu.h     | 6 +++---
 lib/arm64/asm/mmu.h   | 6 +++---
 lib/pci.h             | 6 +++---
 5 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/configure b/configure
index 4ad5a4bcd782..b8442d61fb60 100755
--- a/configure
+++ b/configure
@@ -332,8 +332,8 @@ if [ "$arch" = "arm" ] || [ "$arch" = "arm64" ]; then
 fi
 
 cat <<EOF > lib/config.h
-#ifndef CONFIG_H
-#define CONFIG_H 1
+#ifndef _CONFIG_H_
+#define _CONFIG_H_
 /*
  * Generated file. DO NOT MODIFY.
  *
diff --git a/lib/arm/asm/mmu-api.h b/lib/arm/asm/mmu-api.h
index 05fc12b5afb8..3d77cbfd8b24 100644
--- a/lib/arm/asm/mmu-api.h
+++ b/lib/arm/asm/mmu-api.h
@@ -1,5 +1,5 @@
-#ifndef __ASMARM_MMU_API_H_
-#define __ASMARM_MMU_API_H_
+#ifndef _ASMARM_MMU_API_H_
+#define _ASMARM_MMU_API_H_
 
 #include <asm/page.h>
 #include <stdbool.h>
diff --git a/lib/arm/asm/mmu.h b/lib/arm/asm/mmu.h
index 94e70f0a84bf..b24b97e554e2 100644
--- a/lib/arm/asm/mmu.h
+++ b/lib/arm/asm/mmu.h
@@ -1,5 +1,5 @@
-#ifndef __ASMARM_MMU_H_
-#define __ASMARM_MMU_H_
+#ifndef _ASMARM_MMU_H_
+#define _ASMARM_MMU_H_
 /*
  * Copyright (C) 2014, Red Hat Inc, Andrew Jones <drjones@redhat.com>
  *
@@ -53,4 +53,4 @@ static inline void flush_dcache_addr(unsigned long vaddr)
 
 #include <asm/mmu-api.h>
 
-#endif /* __ASMARM_MMU_H_ */
+#endif /* _ASMARM_MMU_H_ */
diff --git a/lib/arm64/asm/mmu.h b/lib/arm64/asm/mmu.h
index 72371b2d9fe3..5c27edb24d2e 100644
--- a/lib/arm64/asm/mmu.h
+++ b/lib/arm64/asm/mmu.h
@@ -1,5 +1,5 @@
-#ifndef __ASMARM64_MMU_H_
-#define __ASMARM64_MMU_H_
+#ifndef _ASMARM64_MMU_H_
+#define _ASMARM64_MMU_H_
 /*
  * Copyright (C) 2014, Red Hat Inc, Andrew Jones <drjones@redhat.com>
  *
@@ -35,4 +35,4 @@ static inline void flush_dcache_addr(unsigned long vaddr)
 
 #include <asm/mmu-api.h>
 
-#endif /* __ASMARM64_MMU_H_ */
+#endif /* _ASMARM64_MMU_H_ */
diff --git a/lib/pci.h b/lib/pci.h
index 689f03ca7647..e201711dfe18 100644
--- a/lib/pci.h
+++ b/lib/pci.h
@@ -1,5 +1,5 @@
-#ifndef PCI_H
-#define PCI_H
+#ifndef _PCI_H_
+#define _PCI_H_
 /*
  * API for scanning a PCI bus for a given device, as well to access
  * BAR registers.
@@ -102,4 +102,4 @@ struct pci_test_dev_hdr {
 
 #define  PCI_HEADER_TYPE_MASK		0x7f
 
-#endif /* PCI_H */
+#endif /* _PCI_H_ */
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [kvm-unit-tests PATCH 2/2] add header guards for non-trivial headers
  2021-06-10 13:59 [kvm-unit-tests PATCH 0/2] header guards: further cleanup Cornelia Huck
  2021-06-10 13:59 ` [kvm-unit-tests PATCH 1/2] header guards: clean up some stragglers Cornelia Huck
@ 2021-06-10 13:59 ` Cornelia Huck
  2021-06-10 14:30   ` Laurent Vivier
  2021-06-10 16:58 ` [kvm-unit-tests PATCH 0/2] header guards: further cleanup Paolo Bonzini
  2 siblings, 1 reply; 6+ messages in thread
From: Cornelia Huck @ 2021-06-10 13:59 UTC (permalink / raw)
  To: Paolo Bonzini, Thomas Huth, Andrew Jones
  Cc: kvm, Laurent Vivier, Cornelia Huck

Add header guards to headers that do not simply include another one.

Signed-off-by: Cornelia Huck <cohuck@redhat.com>
---
 lib/argv.h       | 5 +++++
 lib/arm/io.h     | 5 +++++
 lib/powerpc/io.h | 5 +++++
 3 files changed, 15 insertions(+)

diff --git a/lib/argv.h b/lib/argv.h
index e5fcf8482ca8..1fd746dc2177 100644
--- a/lib/argv.h
+++ b/lib/argv.h
@@ -5,7 +5,12 @@
  * under the terms of the GNU Library General Public License version 2.
  */
 
+#ifndef _ARGV_H_
+#define _ARGV_H_
+
 extern void __setup_args(void);
 extern void setup_args_progname(const char *args);
 extern void setup_env(char *env, int size);
 extern void add_setup_arg(const char *arg);
+
+#endif
diff --git a/lib/arm/io.h b/lib/arm/io.h
index 2746d72e8280..183479c899a9 100644
--- a/lib/arm/io.h
+++ b/lib/arm/io.h
@@ -4,4 +4,9 @@
  * This work is licensed under the terms of the GNU GPL, version 2.
  */
 
+#ifndef _ARM_IO_H_
+#define _ARM_IO_H_
+
 extern void io_init(void);
+
+#endif
diff --git a/lib/powerpc/io.h b/lib/powerpc/io.h
index 1f5a7bd6d745..d4f21ba15a54 100644
--- a/lib/powerpc/io.h
+++ b/lib/powerpc/io.h
@@ -4,5 +4,10 @@
  * This work is licensed under the terms of the GNU GPL, version 2.
  */
 
+#ifndef _POWERPC_IO_H_
+#define _POWERPC_IO_H_
+
 extern void io_init(void);
 extern void putchar(int c);
+
+#endif
-- 
2.31.1


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [kvm-unit-tests PATCH 1/2] header guards: clean up some stragglers
  2021-06-10 13:59 ` [kvm-unit-tests PATCH 1/2] header guards: clean up some stragglers Cornelia Huck
@ 2021-06-10 14:29   ` Laurent Vivier
  0 siblings, 0 replies; 6+ messages in thread
From: Laurent Vivier @ 2021-06-10 14:29 UTC (permalink / raw)
  To: Cornelia Huck, Paolo Bonzini, Thomas Huth, Andrew Jones; +Cc: kvm

On 10/06/2021 15:59, Cornelia Huck wrote:
> Some headers had been missed during the initial header guard
> standardization.
> 
> Signed-off-by: Cornelia Huck <cohuck@redhat.com>
> ---
>  configure             | 4 ++--
>  lib/arm/asm/mmu-api.h | 4 ++--
>  lib/arm/asm/mmu.h     | 6 +++---
>  lib/arm64/asm/mmu.h   | 6 +++---
>  lib/pci.h             | 6 +++---
>  5 files changed, 13 insertions(+), 13 deletions(-)
> 
> diff --git a/configure b/configure
> index 4ad5a4bcd782..b8442d61fb60 100755
> --- a/configure
> +++ b/configure
> @@ -332,8 +332,8 @@ if [ "$arch" = "arm" ] || [ "$arch" = "arm64" ]; then
>  fi
>  
>  cat <<EOF > lib/config.h
> -#ifndef CONFIG_H
> -#define CONFIG_H 1
> +#ifndef _CONFIG_H_
> +#define _CONFIG_H_
>  /*
>   * Generated file. DO NOT MODIFY.
>   *
> diff --git a/lib/arm/asm/mmu-api.h b/lib/arm/asm/mmu-api.h
> index 05fc12b5afb8..3d77cbfd8b24 100644
> --- a/lib/arm/asm/mmu-api.h
> +++ b/lib/arm/asm/mmu-api.h
> @@ -1,5 +1,5 @@
> -#ifndef __ASMARM_MMU_API_H_
> -#define __ASMARM_MMU_API_H_
> +#ifndef _ASMARM_MMU_API_H_
> +#define _ASMARM_MMU_API_H_
>  
>  #include <asm/page.h>
>  #include <stdbool.h>
> diff --git a/lib/arm/asm/mmu.h b/lib/arm/asm/mmu.h
> index 94e70f0a84bf..b24b97e554e2 100644
> --- a/lib/arm/asm/mmu.h
> +++ b/lib/arm/asm/mmu.h
> @@ -1,5 +1,5 @@
> -#ifndef __ASMARM_MMU_H_
> -#define __ASMARM_MMU_H_
> +#ifndef _ASMARM_MMU_H_
> +#define _ASMARM_MMU_H_
>  /*
>   * Copyright (C) 2014, Red Hat Inc, Andrew Jones <drjones@redhat.com>
>   *
> @@ -53,4 +53,4 @@ static inline void flush_dcache_addr(unsigned long vaddr)
>  
>  #include <asm/mmu-api.h>
>  
> -#endif /* __ASMARM_MMU_H_ */
> +#endif /* _ASMARM_MMU_H_ */
> diff --git a/lib/arm64/asm/mmu.h b/lib/arm64/asm/mmu.h
> index 72371b2d9fe3..5c27edb24d2e 100644
> --- a/lib/arm64/asm/mmu.h
> +++ b/lib/arm64/asm/mmu.h
> @@ -1,5 +1,5 @@
> -#ifndef __ASMARM64_MMU_H_
> -#define __ASMARM64_MMU_H_
> +#ifndef _ASMARM64_MMU_H_
> +#define _ASMARM64_MMU_H_
>  /*
>   * Copyright (C) 2014, Red Hat Inc, Andrew Jones <drjones@redhat.com>
>   *
> @@ -35,4 +35,4 @@ static inline void flush_dcache_addr(unsigned long vaddr)
>  
>  #include <asm/mmu-api.h>
>  
> -#endif /* __ASMARM64_MMU_H_ */
> +#endif /* _ASMARM64_MMU_H_ */
> diff --git a/lib/pci.h b/lib/pci.h
> index 689f03ca7647..e201711dfe18 100644
> --- a/lib/pci.h
> +++ b/lib/pci.h
> @@ -1,5 +1,5 @@
> -#ifndef PCI_H
> -#define PCI_H
> +#ifndef _PCI_H_
> +#define _PCI_H_
>  /*
>   * API for scanning a PCI bus for a given device, as well to access
>   * BAR registers.
> @@ -102,4 +102,4 @@ struct pci_test_dev_hdr {
>  
>  #define  PCI_HEADER_TYPE_MASK		0x7f
>  
> -#endif /* PCI_H */
> +#endif /* _PCI_H_ */
> 

Reviewed-by: Laurent Vivier <lvivier@redhat.com>


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [kvm-unit-tests PATCH 2/2] add header guards for non-trivial headers
  2021-06-10 13:59 ` [kvm-unit-tests PATCH 2/2] add header guards for non-trivial headers Cornelia Huck
@ 2021-06-10 14:30   ` Laurent Vivier
  0 siblings, 0 replies; 6+ messages in thread
From: Laurent Vivier @ 2021-06-10 14:30 UTC (permalink / raw)
  To: Cornelia Huck, Paolo Bonzini, Thomas Huth, Andrew Jones; +Cc: kvm

On 10/06/2021 15:59, Cornelia Huck wrote:
> Add header guards to headers that do not simply include another one.
> 
> Signed-off-by: Cornelia Huck <cohuck@redhat.com>
> ---
>  lib/argv.h       | 5 +++++
>  lib/arm/io.h     | 5 +++++
>  lib/powerpc/io.h | 5 +++++
>  3 files changed, 15 insertions(+)
> 
> diff --git a/lib/argv.h b/lib/argv.h
> index e5fcf8482ca8..1fd746dc2177 100644
> --- a/lib/argv.h
> +++ b/lib/argv.h
> @@ -5,7 +5,12 @@
>   * under the terms of the GNU Library General Public License version 2.
>   */
>  
> +#ifndef _ARGV_H_
> +#define _ARGV_H_
> +
>  extern void __setup_args(void);
>  extern void setup_args_progname(const char *args);
>  extern void setup_env(char *env, int size);
>  extern void add_setup_arg(const char *arg);
> +
> +#endif
> diff --git a/lib/arm/io.h b/lib/arm/io.h
> index 2746d72e8280..183479c899a9 100644
> --- a/lib/arm/io.h
> +++ b/lib/arm/io.h
> @@ -4,4 +4,9 @@
>   * This work is licensed under the terms of the GNU GPL, version 2.
>   */
>  
> +#ifndef _ARM_IO_H_
> +#define _ARM_IO_H_
> +
>  extern void io_init(void);
> +
> +#endif
> diff --git a/lib/powerpc/io.h b/lib/powerpc/io.h
> index 1f5a7bd6d745..d4f21ba15a54 100644
> --- a/lib/powerpc/io.h
> +++ b/lib/powerpc/io.h
> @@ -4,5 +4,10 @@
>   * This work is licensed under the terms of the GNU GPL, version 2.
>   */
>  
> +#ifndef _POWERPC_IO_H_
> +#define _POWERPC_IO_H_
> +
>  extern void io_init(void);
>  extern void putchar(int c);
> +
> +#endif
> 

Reviewed-by: Laurent Vivier <lvivier@redhat.com>


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [kvm-unit-tests PATCH 0/2] header guards: further cleanup
  2021-06-10 13:59 [kvm-unit-tests PATCH 0/2] header guards: further cleanup Cornelia Huck
  2021-06-10 13:59 ` [kvm-unit-tests PATCH 1/2] header guards: clean up some stragglers Cornelia Huck
  2021-06-10 13:59 ` [kvm-unit-tests PATCH 2/2] add header guards for non-trivial headers Cornelia Huck
@ 2021-06-10 16:58 ` Paolo Bonzini
  2 siblings, 0 replies; 6+ messages in thread
From: Paolo Bonzini @ 2021-06-10 16:58 UTC (permalink / raw)
  To: Cornelia Huck, Thomas Huth, Andrew Jones; +Cc: kvm, Laurent Vivier

On 10/06/21 15:59, Cornelia Huck wrote:
> Laurent had notices some further issues in my header guards series,
> so I
> - fixed some header guards I missed initially
> - added header guards to some headers that actually define something
>    (and don't just include another header)
> 
> I did not actually remove any header guards that might be unneeded.
> 
> Cornelia Huck (2):
>    header guards: clean up some stragglers
>    add header guards for non-trivial headers
> 
>   configure             | 4 ++--
>   lib/argv.h            | 5 +++++
>   lib/arm/asm/mmu-api.h | 4 ++--
>   lib/arm/asm/mmu.h     | 6 +++---
>   lib/arm/io.h          | 5 +++++
>   lib/arm64/asm/mmu.h   | 6 +++---
>   lib/pci.h             | 6 +++---
>   lib/powerpc/io.h      | 5 +++++
>   8 files changed, 28 insertions(+), 13 deletions(-)
> 

Queued, thanks.

Paolo


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-06-10 16:58 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-10 13:59 [kvm-unit-tests PATCH 0/2] header guards: further cleanup Cornelia Huck
2021-06-10 13:59 ` [kvm-unit-tests PATCH 1/2] header guards: clean up some stragglers Cornelia Huck
2021-06-10 14:29   ` Laurent Vivier
2021-06-10 13:59 ` [kvm-unit-tests PATCH 2/2] add header guards for non-trivial headers Cornelia Huck
2021-06-10 14:30   ` Laurent Vivier
2021-06-10 16:58 ` [kvm-unit-tests PATCH 0/2] header guards: further cleanup Paolo Bonzini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).