header guards: further cleanup
Subsystems (2)
cover header guards: further cleanup
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(-)
Signature · 1 line
2.31.1
PATCH 1/2 header guards: clean up some stragglers
Some headers had been missed during the initial header guard standardization.
--- 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(-)
configure +2 -2
@@ -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. *
lib/arm/asm/mmu-api.h +2 -2
@@ -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>
lib/arm/asm/mmu.h +3 -3
@@ -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 <[email protected]> *
@@ -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_ */
lib/arm64/asm/mmu.h +3 -3
@@ -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 <[email protected]> *
@@ -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_ */
lib/pci.h +3 -3
@@ -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_ */
Signature · 1 line
2.31.1
Re: [kvm-unit-tests PATCH 1/2] header guards: clean up some stragglers
Quoted 89 lines · Cornelia Huck
Some headers had been missed during the initial header guard standardization.
Signed-off-by Cornelia Huck <[email protected]>--- 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(-)configure +2
-2@@ -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. *lib/arm/asm/mmu-api.h +2
-2@@ -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> lib/arm/asm/mmu.h +3
-3@@ -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 <[email protected]> * @@ -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_ */ lib/arm64/asm/mmu.h +3
-3@@ -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 <[email protected]> * @@ -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_ */ lib/pci.h +2
-2@@ -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.
lib/pci.h struct pci_test_dev_hdr { · line 105
Quoted 5 lines
lib/pci.h +1
-1@@ -102,4 +102,4 @@ struct pci_test_dev_hdr {#define PCI_HEADER_TYPE_MASK 0x7f -#endif /* PCI_H */ +#endif /* _PCI_H_ */
PATCH 2/2 add header guards for non-trivial headers
In reply to Cornelia HuckAdd header guards to headers that do not simply include another one.
--- lib/argv.h | 5 +++++ lib/arm/io.h | 5 +++++ lib/powerpc/io.h | 5 +++++ 3 files changed, 15 insertions(+)
lib/argv.h +5 -0
@@ -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
lib/arm/io.h +5 -0
@@ -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
lib/powerpc/io.h +5 -0
@@ -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
Signature · 1 line
2.31.1
Re: [kvm-unit-tests PATCH 2/2] add header guards for non-trivial headers
Quoted 46 lines · Cornelia Huck
Add header guards to headers that do not simply include another one.
Signed-off-by Cornelia Huck <[email protected]>--- lib/argv.h | 5 +++++ lib/arm/io.h | 5 +++++ lib/powerpc/io.h | 5 +++++ 3 files changed, 15 insertions(+)lib/argv.h +5
-0@@ -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 lib/arm/io.h +5
-0@@ -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 lib/powerpc/io.h +0
-0
lib/powerpc/io.h line 13
Quoted 10 lines
lib/powerpc/io.h +5
-0@@ -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
Quoted 12 lines · 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
Quoted 10 lines
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