* [PATCH 0/4] asm-generic: fix minor include guard issues
@ 2013-08-08 21:06 Rasmus Villemoes
2013-08-08 21:06 ` [PATCH 1/4] asm-generic: Make sure include guards contain the substring ASM_GENERIC Rasmus Villemoes
` (3 more replies)
0 siblings, 4 replies; 10+ messages in thread
From: Rasmus Villemoes @ 2013-08-08 21:06 UTC (permalink / raw)
To: Arnd Bergmann, Roland McGrath, Oleg Nesterov
Cc: linux-arch, linux-kernel, Rasmus Villemoes
I wrote a script to help find (potential) problems with include
guards, such as the same macro being used in different header
files. These patches are the result of applying that to
include/asm-generic. They are mostly trivial, but [1/4] fixes two
almost-problems.
I didn't touch include/asm-generic/rwsem.h, although it might need
some attention. It was introduced in dd472da38, seemingly a copy of
arch/powerpc/include/asm/rwsem.h, which was removed in 0766387bc. It
is not #included from anywhere, but is used in
arch/{hexagon,powerpc}/include/asm/Kbuild. Since it is no longer
powerpc-specific, the _ASM_POWERPC_RWSEM_H and #ifdef CONFIG_PPC64
seem malplaced.
Rasmus Villemoes (4):
asm-generic: Make sure include guards contain the substring
ASM_GENERIC
asm-generic: Use different include guards
asm-generic: Add missing include guards
asm-generic: Fix typo in comment after #endif
include/asm-generic/bitops/arch_hweight.h | 2 +-
include/asm-generic/bitops/atomic.h | 2 +-
include/asm-generic/cacheflush.h | 6 +++---
include/asm-generic/clkdev.h | 4 ++--
include/asm-generic/dma-coherent.h | 4 ++--
include/asm-generic/dma-contiguous.h | 4 ++--
include/asm-generic/dma-mapping-broken.h | 6 +++---
include/asm-generic/dma-mapping-common.h | 4 ++--
include/asm-generic/ide_iops.h | 4 ++++
include/asm-generic/io-64-nonatomic-hi-lo.h | 6 +++---
include/asm-generic/io-64-nonatomic-lo-hi.h | 6 +++---
include/asm-generic/iomap.h | 4 ++--
include/asm-generic/memory_model.h | 4 ++--
include/asm-generic/pci_iomap.h | 2 +-
include/asm-generic/rtc.h | 6 +++---
include/asm-generic/signal.h | 2 +-
include/asm-generic/statfs.h | 4 ++--
include/asm-generic/syscall.h | 6 +++---
include/asm-generic/unistd.h | 5 +++++
include/asm-generic/vga.h | 2 +-
include/asm-generic/word-at-a-time.h | 6 +++---
include/asm-generic/xor.h | 4 ++++
22 files changed, 53 insertions(+), 40 deletions(-)
--
1.7.9.5
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 1/4] asm-generic: Make sure include guards contain the substring ASM_GENERIC
2013-08-08 21:06 [PATCH 0/4] asm-generic: fix minor include guard issues Rasmus Villemoes
@ 2013-08-08 21:06 ` Rasmus Villemoes
2013-08-08 21:06 ` Rasmus Villemoes
2013-08-08 21:07 ` [PATCH 2/4] asm-generic: Use different include guards Rasmus Villemoes
` (2 subsequent siblings)
3 siblings, 1 reply; 10+ messages in thread
From: Rasmus Villemoes @ 2013-08-08 21:06 UTC (permalink / raw)
To: Arnd Bergmann, Roland McGrath, Oleg Nesterov
Cc: linux-arch, linux-kernel, Rasmus Villemoes
This patch ensures that the include guards used in various
include/asm-generic/*.h files contain the substring ASM_GENERIC. This
should reduce the risk of bugs arising from arch/*/asm/foo.h including
asm-generic/foo.h, while both use the same include guard. No such
instances exist, but two near-hits are:
arch/mn10300/include/asm/rtc.h uses _ASM_RTC_H and includes
asm-generic/rtc.h which uses __ASM_RTC_H__
arch/hexagon/include/asm/cacheflush.h uses _ASM_CACHEFLUSH_H and
includes asm-generic/cacheflush.h which uses __ASM_CACHEFLUSH_H
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
---
include/asm-generic/cacheflush.h | 6 +++---
include/asm-generic/clkdev.h | 4 ++--
include/asm-generic/dma-coherent.h | 4 ++--
include/asm-generic/dma-contiguous.h | 4 ++--
include/asm-generic/io-64-nonatomic-hi-lo.h | 6 +++---
include/asm-generic/io-64-nonatomic-lo-hi.h | 6 +++---
include/asm-generic/iomap.h | 4 ++--
include/asm-generic/memory_model.h | 4 ++--
include/asm-generic/rtc.h | 6 +++---
include/asm-generic/statfs.h | 4 ++--
include/asm-generic/syscall.h | 6 +++---
include/asm-generic/word-at-a-time.h | 6 +++---
12 files changed, 30 insertions(+), 30 deletions(-)
diff --git a/include/asm-generic/cacheflush.h b/include/asm-generic/cacheflush.h
index 87bc536..c9717ba 100644
--- a/include/asm-generic/cacheflush.h
+++ b/include/asm-generic/cacheflush.h
@@ -1,5 +1,5 @@
-#ifndef __ASM_CACHEFLUSH_H
-#define __ASM_CACHEFLUSH_H
+#ifndef __ASM_GENERIC_CACHEFLUSH_H
+#define __ASM_GENERIC_CACHEFLUSH_H
/* Keep includes the same across arches. */
#include <linux/mm.h>
@@ -31,4 +31,4 @@
#define copy_from_user_page(vma, page, vaddr, dst, src, len) \
memcpy(dst, src, len)
-#endif /* __ASM_CACHEFLUSH_H */
+#endif /* __ASM_GENERIC_CACHEFLUSH_H */
diff --git a/include/asm-generic/clkdev.h b/include/asm-generic/clkdev.h
index 90a32a6..fb1cad9 100644
--- a/include/asm-generic/clkdev.h
+++ b/include/asm-generic/clkdev.h
@@ -10,8 +10,8 @@
*
* Helper for the clk API to assist looking up a struct clk.
*/
-#ifndef __ASM_CLKDEV_H
-#define __ASM_CLKDEV_H
+#ifndef __ASM_GENERIC_CLKDEV_H
+#define __ASM_GENERIC_CLKDEV_H
#include <linux/slab.h>
diff --git a/include/asm-generic/dma-coherent.h b/include/asm-generic/dma-coherent.h
index 2be8a2d..33a971e 100644
--- a/include/asm-generic/dma-coherent.h
+++ b/include/asm-generic/dma-coherent.h
@@ -1,5 +1,5 @@
-#ifndef DMA_COHERENT_H
-#define DMA_COHERENT_H
+#ifndef _ASM_GENERIC_DMA_COHERENT_H
+#define _ASM_GENERIC_DMA_COHERENT_H
#ifdef CONFIG_HAVE_GENERIC_DMA_COHERENT
/*
diff --git a/include/asm-generic/dma-contiguous.h b/include/asm-generic/dma-contiguous.h
index 294b1e7..cedad6b 100644
--- a/include/asm-generic/dma-contiguous.h
+++ b/include/asm-generic/dma-contiguous.h
@@ -1,5 +1,5 @@
-#ifndef ASM_DMA_CONTIGUOUS_H
-#define ASM_DMA_CONTIGUOUS_H
+#ifndef _ASM_GENERIC_DMA_CONTIGUOUS_H
+#define _ASM_GENERIC_DMA_CONTIGUOUS_H
#ifdef __KERNEL__
#ifdef CONFIG_CMA
diff --git a/include/asm-generic/io-64-nonatomic-hi-lo.h b/include/asm-generic/io-64-nonatomic-hi-lo.h
index a6806a9..982cc29 100644
--- a/include/asm-generic/io-64-nonatomic-hi-lo.h
+++ b/include/asm-generic/io-64-nonatomic-hi-lo.h
@@ -1,5 +1,5 @@
-#ifndef _ASM_IO_64_NONATOMIC_HI_LO_H_
-#define _ASM_IO_64_NONATOMIC_HI_LO_H_
+#ifndef _ASM_GENERIC_IO_64_NONATOMIC_HI_LO_H_
+#define _ASM_GENERIC_IO_64_NONATOMIC_HI_LO_H_
#include <linux/io.h>
#include <asm-generic/int-ll64.h>
@@ -25,4 +25,4 @@ static inline void writeq(__u64 val, volatile void __iomem *addr)
}
#endif
-#endif /* _ASM_IO_64_NONATOMIC_HI_LO_H_ */
+#endif /* _ASM_GENERIC_IO_64_NONATOMIC_HI_LO_H_ */
diff --git a/include/asm-generic/io-64-nonatomic-lo-hi.h b/include/asm-generic/io-64-nonatomic-lo-hi.h
index ca546b1..abb1549 100644
--- a/include/asm-generic/io-64-nonatomic-lo-hi.h
+++ b/include/asm-generic/io-64-nonatomic-lo-hi.h
@@ -1,5 +1,5 @@
-#ifndef _ASM_IO_64_NONATOMIC_LO_HI_H_
-#define _ASM_IO_64_NONATOMIC_LO_HI_H_
+#ifndef _ASM_GENERIC_IO_64_NONATOMIC_LO_HI_H_
+#define _ASM_GENERIC_IO_64_NONATOMIC_LO_HI_H_
#include <linux/io.h>
#include <asm-generic/int-ll64.h>
@@ -25,4 +25,4 @@ static inline void writeq(__u64 val, volatile void __iomem *addr)
}
#endif
-#endif /* _ASM_IO_64_NONATOMIC_LO_HI_H_ */
+#endif /* _ASM_GENERIC_IO_64_NONATOMIC_LO_HI_H_ */
diff --git a/include/asm-generic/iomap.h b/include/asm-generic/iomap.h
index 6afd7d6..66b6798 100644
--- a/include/asm-generic/iomap.h
+++ b/include/asm-generic/iomap.h
@@ -1,5 +1,5 @@
-#ifndef __GENERIC_IO_H
-#define __GENERIC_IO_H
+#ifndef __ASM_GENERIC_IOMAP_H
+#define __ASM_GENERIC_IOMAP_H
#include <linux/linkage.h>
#include <asm/byteorder.h>
diff --git a/include/asm-generic/memory_model.h b/include/asm-generic/memory_model.h
index aea9e45..e40c952 100644
--- a/include/asm-generic/memory_model.h
+++ b/include/asm-generic/memory_model.h
@@ -1,5 +1,5 @@
-#ifndef __ASM_MEMORY_MODEL_H
-#define __ASM_MEMORY_MODEL_H
+#ifndef __ASM_GENERIC_MEMORY_MODEL_H
+#define __ASM_GENERIC_MEMORY_MODEL_H
#ifndef __ASSEMBLY__
diff --git a/include/asm-generic/rtc.h b/include/asm-generic/rtc.h
index fa86f24..4b15696 100644
--- a/include/asm-generic/rtc.h
+++ b/include/asm-generic/rtc.h
@@ -9,8 +9,8 @@
* Please read the COPYING file for all license details.
*/
-#ifndef __ASM_RTC_H__
-#define __ASM_RTC_H__
+#ifndef __ASM_GENERIC_RTC_H__
+#define __ASM_GENERIC_RTC_H__
#include <linux/mc146818rtc.h>
#include <linux/rtc.h>
@@ -215,4 +215,4 @@ static inline int set_rtc_pll(struct rtc_pll_info *pll)
return -EINVAL;
}
-#endif /* __ASM_RTC_H__ */
+#endif /* __ASM_GENERIC_RTC_H__ */
diff --git a/include/asm-generic/statfs.h b/include/asm-generic/statfs.h
index 4b934e9..5493871 100644
--- a/include/asm-generic/statfs.h
+++ b/include/asm-generic/statfs.h
@@ -1,5 +1,5 @@
-#ifndef _GENERIC_STATFS_H
-#define _GENERIC_STATFS_H
+#ifndef _ASM_GENERIC_STATFS_H
+#define _ASM_GENERIC_STATFS_H
#include <uapi/asm-generic/statfs.h>
diff --git a/include/asm-generic/syscall.h b/include/asm-generic/syscall.h
index 5b09392..1e1216b 100644
--- a/include/asm-generic/syscall.h
+++ b/include/asm-generic/syscall.h
@@ -16,8 +16,8 @@
* cannot return to user mode while we are looking at it.
*/
-#ifndef _ASM_SYSCALL_H
-#define _ASM_SYSCALL_H 1
+#ifndef _ASM_GENERIC_SYSCALL_H
+#define _ASM_GENERIC_SYSCALL_H 1
struct task_struct;
struct pt_regs;
@@ -156,4 +156,4 @@ void syscall_set_arguments(struct task_struct *task, struct pt_regs *regs,
* provide an implementation of this.
*/
int syscall_get_arch(struct task_struct *task, struct pt_regs *regs);
-#endif /* _ASM_SYSCALL_H */
+#endif /* _ASM_GENERIC_SYSCALL_H */
diff --git a/include/asm-generic/word-at-a-time.h b/include/asm-generic/word-at-a-time.h
index 3f21f1b..541bd0c 100644
--- a/include/asm-generic/word-at-a-time.h
+++ b/include/asm-generic/word-at-a-time.h
@@ -1,5 +1,5 @@
-#ifndef _ASM_WORD_AT_A_TIME_H
-#define _ASM_WORD_AT_A_TIME_H
+#ifndef _ASM_GENERIC_WORD_AT_A_TIME_H
+#define _ASM_GENERIC_WORD_AT_A_TIME_H
/*
* This says "generic", but it's actually big-endian only.
@@ -49,4 +49,4 @@ static inline bool has_zero(unsigned long val, unsigned long *data, const struct
return (val + c->high_bits) & ~rhs;
}
-#endif /* _ASM_WORD_AT_A_TIME_H */
+#endif /* _ASM_GENERIC_WORD_AT_A_TIME_H */
--
1.7.9.5
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 1/4] asm-generic: Make sure include guards contain the substring ASM_GENERIC
2013-08-08 21:06 ` [PATCH 1/4] asm-generic: Make sure include guards contain the substring ASM_GENERIC Rasmus Villemoes
@ 2013-08-08 21:06 ` Rasmus Villemoes
0 siblings, 0 replies; 10+ messages in thread
From: Rasmus Villemoes @ 2013-08-08 21:06 UTC (permalink / raw)
To: Arnd Bergmann, Roland McGrath, Oleg Nesterov
Cc: linux-arch, linux-kernel, Rasmus Villemoes
This patch ensures that the include guards used in various
include/asm-generic/*.h files contain the substring ASM_GENERIC. This
should reduce the risk of bugs arising from arch/*/asm/foo.h including
asm-generic/foo.h, while both use the same include guard. No such
instances exist, but two near-hits are:
arch/mn10300/include/asm/rtc.h uses _ASM_RTC_H and includes
asm-generic/rtc.h which uses __ASM_RTC_H__
arch/hexagon/include/asm/cacheflush.h uses _ASM_CACHEFLUSH_H and
includes asm-generic/cacheflush.h which uses __ASM_CACHEFLUSH_H
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
---
include/asm-generic/cacheflush.h | 6 +++---
include/asm-generic/clkdev.h | 4 ++--
include/asm-generic/dma-coherent.h | 4 ++--
include/asm-generic/dma-contiguous.h | 4 ++--
include/asm-generic/io-64-nonatomic-hi-lo.h | 6 +++---
include/asm-generic/io-64-nonatomic-lo-hi.h | 6 +++---
include/asm-generic/iomap.h | 4 ++--
include/asm-generic/memory_model.h | 4 ++--
include/asm-generic/rtc.h | 6 +++---
include/asm-generic/statfs.h | 4 ++--
include/asm-generic/syscall.h | 6 +++---
include/asm-generic/word-at-a-time.h | 6 +++---
12 files changed, 30 insertions(+), 30 deletions(-)
diff --git a/include/asm-generic/cacheflush.h b/include/asm-generic/cacheflush.h
index 87bc536..c9717ba 100644
--- a/include/asm-generic/cacheflush.h
+++ b/include/asm-generic/cacheflush.h
@@ -1,5 +1,5 @@
-#ifndef __ASM_CACHEFLUSH_H
-#define __ASM_CACHEFLUSH_H
+#ifndef __ASM_GENERIC_CACHEFLUSH_H
+#define __ASM_GENERIC_CACHEFLUSH_H
/* Keep includes the same across arches. */
#include <linux/mm.h>
@@ -31,4 +31,4 @@
#define copy_from_user_page(vma, page, vaddr, dst, src, len) \
memcpy(dst, src, len)
-#endif /* __ASM_CACHEFLUSH_H */
+#endif /* __ASM_GENERIC_CACHEFLUSH_H */
diff --git a/include/asm-generic/clkdev.h b/include/asm-generic/clkdev.h
index 90a32a6..fb1cad9 100644
--- a/include/asm-generic/clkdev.h
+++ b/include/asm-generic/clkdev.h
@@ -10,8 +10,8 @@
*
* Helper for the clk API to assist looking up a struct clk.
*/
-#ifndef __ASM_CLKDEV_H
-#define __ASM_CLKDEV_H
+#ifndef __ASM_GENERIC_CLKDEV_H
+#define __ASM_GENERIC_CLKDEV_H
#include <linux/slab.h>
diff --git a/include/asm-generic/dma-coherent.h b/include/asm-generic/dma-coherent.h
index 2be8a2d..33a971e 100644
--- a/include/asm-generic/dma-coherent.h
+++ b/include/asm-generic/dma-coherent.h
@@ -1,5 +1,5 @@
-#ifndef DMA_COHERENT_H
-#define DMA_COHERENT_H
+#ifndef _ASM_GENERIC_DMA_COHERENT_H
+#define _ASM_GENERIC_DMA_COHERENT_H
#ifdef CONFIG_HAVE_GENERIC_DMA_COHERENT
/*
diff --git a/include/asm-generic/dma-contiguous.h b/include/asm-generic/dma-contiguous.h
index 294b1e7..cedad6b 100644
--- a/include/asm-generic/dma-contiguous.h
+++ b/include/asm-generic/dma-contiguous.h
@@ -1,5 +1,5 @@
-#ifndef ASM_DMA_CONTIGUOUS_H
-#define ASM_DMA_CONTIGUOUS_H
+#ifndef _ASM_GENERIC_DMA_CONTIGUOUS_H
+#define _ASM_GENERIC_DMA_CONTIGUOUS_H
#ifdef __KERNEL__
#ifdef CONFIG_CMA
diff --git a/include/asm-generic/io-64-nonatomic-hi-lo.h b/include/asm-generic/io-64-nonatomic-hi-lo.h
index a6806a9..982cc29 100644
--- a/include/asm-generic/io-64-nonatomic-hi-lo.h
+++ b/include/asm-generic/io-64-nonatomic-hi-lo.h
@@ -1,5 +1,5 @@
-#ifndef _ASM_IO_64_NONATOMIC_HI_LO_H_
-#define _ASM_IO_64_NONATOMIC_HI_LO_H_
+#ifndef _ASM_GENERIC_IO_64_NONATOMIC_HI_LO_H_
+#define _ASM_GENERIC_IO_64_NONATOMIC_HI_LO_H_
#include <linux/io.h>
#include <asm-generic/int-ll64.h>
@@ -25,4 +25,4 @@ static inline void writeq(__u64 val, volatile void __iomem *addr)
}
#endif
-#endif /* _ASM_IO_64_NONATOMIC_HI_LO_H_ */
+#endif /* _ASM_GENERIC_IO_64_NONATOMIC_HI_LO_H_ */
diff --git a/include/asm-generic/io-64-nonatomic-lo-hi.h b/include/asm-generic/io-64-nonatomic-lo-hi.h
index ca546b1..abb1549 100644
--- a/include/asm-generic/io-64-nonatomic-lo-hi.h
+++ b/include/asm-generic/io-64-nonatomic-lo-hi.h
@@ -1,5 +1,5 @@
-#ifndef _ASM_IO_64_NONATOMIC_LO_HI_H_
-#define _ASM_IO_64_NONATOMIC_LO_HI_H_
+#ifndef _ASM_GENERIC_IO_64_NONATOMIC_LO_HI_H_
+#define _ASM_GENERIC_IO_64_NONATOMIC_LO_HI_H_
#include <linux/io.h>
#include <asm-generic/int-ll64.h>
@@ -25,4 +25,4 @@ static inline void writeq(__u64 val, volatile void __iomem *addr)
}
#endif
-#endif /* _ASM_IO_64_NONATOMIC_LO_HI_H_ */
+#endif /* _ASM_GENERIC_IO_64_NONATOMIC_LO_HI_H_ */
diff --git a/include/asm-generic/iomap.h b/include/asm-generic/iomap.h
index 6afd7d6..66b6798 100644
--- a/include/asm-generic/iomap.h
+++ b/include/asm-generic/iomap.h
@@ -1,5 +1,5 @@
-#ifndef __GENERIC_IO_H
-#define __GENERIC_IO_H
+#ifndef __ASM_GENERIC_IOMAP_H
+#define __ASM_GENERIC_IOMAP_H
#include <linux/linkage.h>
#include <asm/byteorder.h>
diff --git a/include/asm-generic/memory_model.h b/include/asm-generic/memory_model.h
index aea9e45..e40c952 100644
--- a/include/asm-generic/memory_model.h
+++ b/include/asm-generic/memory_model.h
@@ -1,5 +1,5 @@
-#ifndef __ASM_MEMORY_MODEL_H
-#define __ASM_MEMORY_MODEL_H
+#ifndef __ASM_GENERIC_MEMORY_MODEL_H
+#define __ASM_GENERIC_MEMORY_MODEL_H
#ifndef __ASSEMBLY__
diff --git a/include/asm-generic/rtc.h b/include/asm-generic/rtc.h
index fa86f24..4b15696 100644
--- a/include/asm-generic/rtc.h
+++ b/include/asm-generic/rtc.h
@@ -9,8 +9,8 @@
* Please read the COPYING file for all license details.
*/
-#ifndef __ASM_RTC_H__
-#define __ASM_RTC_H__
+#ifndef __ASM_GENERIC_RTC_H__
+#define __ASM_GENERIC_RTC_H__
#include <linux/mc146818rtc.h>
#include <linux/rtc.h>
@@ -215,4 +215,4 @@ static inline int set_rtc_pll(struct rtc_pll_info *pll)
return -EINVAL;
}
-#endif /* __ASM_RTC_H__ */
+#endif /* __ASM_GENERIC_RTC_H__ */
diff --git a/include/asm-generic/statfs.h b/include/asm-generic/statfs.h
index 4b934e9..5493871 100644
--- a/include/asm-generic/statfs.h
+++ b/include/asm-generic/statfs.h
@@ -1,5 +1,5 @@
-#ifndef _GENERIC_STATFS_H
-#define _GENERIC_STATFS_H
+#ifndef _ASM_GENERIC_STATFS_H
+#define _ASM_GENERIC_STATFS_H
#include <uapi/asm-generic/statfs.h>
diff --git a/include/asm-generic/syscall.h b/include/asm-generic/syscall.h
index 5b09392..1e1216b 100644
--- a/include/asm-generic/syscall.h
+++ b/include/asm-generic/syscall.h
@@ -16,8 +16,8 @@
* cannot return to user mode while we are looking at it.
*/
-#ifndef _ASM_SYSCALL_H
-#define _ASM_SYSCALL_H 1
+#ifndef _ASM_GENERIC_SYSCALL_H
+#define _ASM_GENERIC_SYSCALL_H 1
struct task_struct;
struct pt_regs;
@@ -156,4 +156,4 @@ void syscall_set_arguments(struct task_struct *task, struct pt_regs *regs,
* provide an implementation of this.
*/
int syscall_get_arch(struct task_struct *task, struct pt_regs *regs);
-#endif /* _ASM_SYSCALL_H */
+#endif /* _ASM_GENERIC_SYSCALL_H */
diff --git a/include/asm-generic/word-at-a-time.h b/include/asm-generic/word-at-a-time.h
index 3f21f1b..541bd0c 100644
--- a/include/asm-generic/word-at-a-time.h
+++ b/include/asm-generic/word-at-a-time.h
@@ -1,5 +1,5 @@
-#ifndef _ASM_WORD_AT_A_TIME_H
-#define _ASM_WORD_AT_A_TIME_H
+#ifndef _ASM_GENERIC_WORD_AT_A_TIME_H
+#define _ASM_GENERIC_WORD_AT_A_TIME_H
/*
* This says "generic", but it's actually big-endian only.
@@ -49,4 +49,4 @@ static inline bool has_zero(unsigned long val, unsigned long *data, const struct
return (val + c->high_bits) & ~rhs;
}
-#endif /* _ASM_WORD_AT_A_TIME_H */
+#endif /* _ASM_GENERIC_WORD_AT_A_TIME_H */
--
1.7.9.5
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 2/4] asm-generic: Use different include guards
2013-08-08 21:06 [PATCH 0/4] asm-generic: fix minor include guard issues Rasmus Villemoes
2013-08-08 21:06 ` [PATCH 1/4] asm-generic: Make sure include guards contain the substring ASM_GENERIC Rasmus Villemoes
@ 2013-08-08 21:07 ` Rasmus Villemoes
2013-08-08 21:07 ` Rasmus Villemoes
2013-08-08 21:07 ` [PATCH 3/4] asm-generic: Add missing " Rasmus Villemoes
2013-08-08 21:07 ` [PATCH 4/4] asm-generic: Fix typo in comment after #endif Rasmus Villemoes
3 siblings, 1 reply; 10+ messages in thread
From: Rasmus Villemoes @ 2013-08-08 21:07 UTC (permalink / raw)
To: Arnd Bergmann, Roland McGrath, Oleg Nesterov
Cc: linux-arch, linux-kernel, Rasmus Villemoes
For consistency, use different include guards in
include/asm-generic/dma-mapping-{broken,common}.h, even though it is
unlikely (if not outright a bug) to ever include both.
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
---
include/asm-generic/dma-mapping-broken.h | 6 +++---
include/asm-generic/dma-mapping-common.h | 4 ++--
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/include/asm-generic/dma-mapping-broken.h b/include/asm-generic/dma-mapping-broken.h
index 6c32af9..34621ea 100644
--- a/include/asm-generic/dma-mapping-broken.h
+++ b/include/asm-generic/dma-mapping-broken.h
@@ -1,5 +1,5 @@
-#ifndef _ASM_GENERIC_DMA_MAPPING_H
-#define _ASM_GENERIC_DMA_MAPPING_H
+#ifndef _ASM_GENERIC_DMA_MAPPING_BROKEN_H
+#define _ASM_GENERIC_DMA_MAPPING_BROKEN_H
/* define the dma api to allow compilation but not linking of
* dma dependent code. Code that depends on the dma-mapping
@@ -92,4 +92,4 @@ extern void
dma_cache_sync(struct device *dev, void *vaddr, size_t size,
enum dma_data_direction direction);
-#endif /* _ASM_GENERIC_DMA_MAPPING_H */
+#endif /* _ASM_GENERIC_DMA_MAPPING_BROKEN_H */
diff --git a/include/asm-generic/dma-mapping-common.h b/include/asm-generic/dma-mapping-common.h
index de8bf89..2ae73e6 100644
--- a/include/asm-generic/dma-mapping-common.h
+++ b/include/asm-generic/dma-mapping-common.h
@@ -1,5 +1,5 @@
-#ifndef _ASM_GENERIC_DMA_MAPPING_H
-#define _ASM_GENERIC_DMA_MAPPING_H
+#ifndef _ASM_GENERIC_DMA_MAPPING_COMMON_H
+#define _ASM_GENERIC_DMA_MAPPING_COMMON_H
#include <linux/kmemcheck.h>
#include <linux/bug.h>
--
1.7.9.5
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 2/4] asm-generic: Use different include guards
2013-08-08 21:07 ` [PATCH 2/4] asm-generic: Use different include guards Rasmus Villemoes
@ 2013-08-08 21:07 ` Rasmus Villemoes
0 siblings, 0 replies; 10+ messages in thread
From: Rasmus Villemoes @ 2013-08-08 21:07 UTC (permalink / raw)
To: Arnd Bergmann, Roland McGrath, Oleg Nesterov
Cc: linux-arch, linux-kernel, Rasmus Villemoes
For consistency, use different include guards in
include/asm-generic/dma-mapping-{broken,common}.h, even though it is
unlikely (if not outright a bug) to ever include both.
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
---
include/asm-generic/dma-mapping-broken.h | 6 +++---
include/asm-generic/dma-mapping-common.h | 4 ++--
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/include/asm-generic/dma-mapping-broken.h b/include/asm-generic/dma-mapping-broken.h
index 6c32af9..34621ea 100644
--- a/include/asm-generic/dma-mapping-broken.h
+++ b/include/asm-generic/dma-mapping-broken.h
@@ -1,5 +1,5 @@
-#ifndef _ASM_GENERIC_DMA_MAPPING_H
-#define _ASM_GENERIC_DMA_MAPPING_H
+#ifndef _ASM_GENERIC_DMA_MAPPING_BROKEN_H
+#define _ASM_GENERIC_DMA_MAPPING_BROKEN_H
/* define the dma api to allow compilation but not linking of
* dma dependent code. Code that depends on the dma-mapping
@@ -92,4 +92,4 @@ extern void
dma_cache_sync(struct device *dev, void *vaddr, size_t size,
enum dma_data_direction direction);
-#endif /* _ASM_GENERIC_DMA_MAPPING_H */
+#endif /* _ASM_GENERIC_DMA_MAPPING_BROKEN_H */
diff --git a/include/asm-generic/dma-mapping-common.h b/include/asm-generic/dma-mapping-common.h
index de8bf89..2ae73e6 100644
--- a/include/asm-generic/dma-mapping-common.h
+++ b/include/asm-generic/dma-mapping-common.h
@@ -1,5 +1,5 @@
-#ifndef _ASM_GENERIC_DMA_MAPPING_H
-#define _ASM_GENERIC_DMA_MAPPING_H
+#ifndef _ASM_GENERIC_DMA_MAPPING_COMMON_H
+#define _ASM_GENERIC_DMA_MAPPING_COMMON_H
#include <linux/kmemcheck.h>
#include <linux/bug.h>
--
1.7.9.5
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 3/4] asm-generic: Add missing include guards
2013-08-08 21:06 [PATCH 0/4] asm-generic: fix minor include guard issues Rasmus Villemoes
2013-08-08 21:06 ` [PATCH 1/4] asm-generic: Make sure include guards contain the substring ASM_GENERIC Rasmus Villemoes
2013-08-08 21:07 ` [PATCH 2/4] asm-generic: Use different include guards Rasmus Villemoes
@ 2013-08-08 21:07 ` Rasmus Villemoes
2013-08-08 21:07 ` Rasmus Villemoes
2013-08-27 13:08 ` James Hogan
2013-08-08 21:07 ` [PATCH 4/4] asm-generic: Fix typo in comment after #endif Rasmus Villemoes
3 siblings, 2 replies; 10+ messages in thread
From: Rasmus Villemoes @ 2013-08-08 21:07 UTC (permalink / raw)
To: Arnd Bergmann, Roland McGrath, Oleg Nesterov
Cc: linux-arch, linux-kernel, Rasmus Villemoes
Add include guards to include/asm-generic/{ide_iops,unistd,xor}.h.
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
---
include/asm-generic/ide_iops.h | 4 ++++
include/asm-generic/unistd.h | 5 +++++
include/asm-generic/xor.h | 4 ++++
3 files changed, 13 insertions(+)
diff --git a/include/asm-generic/ide_iops.h b/include/asm-generic/ide_iops.h
index 1b91d06..cfe2ab8 100644
--- a/include/asm-generic/ide_iops.h
+++ b/include/asm-generic/ide_iops.h
@@ -1,4 +1,6 @@
/* Generic I/O and MEMIO string operations. */
+#ifndef _ASM_GENERIC_IDE_IOPS_H
+#define _ASM_GENERIC_IDE_IOPS_H
#define __ide_insw insw
#define __ide_insl insl
@@ -36,3 +38,5 @@ static __inline__ void __ide_mm_outsl(void __iomem * port, void *addr, u32 count
addr += 4;
}
}
+
+#endif /* _ASM_GENERIC_IDE_IOPS_H */
diff --git a/include/asm-generic/unistd.h b/include/asm-generic/unistd.h
index cccc86e..0cff2e9 100644
--- a/include/asm-generic/unistd.h
+++ b/include/asm-generic/unistd.h
@@ -1,3 +1,6 @@
+#ifndef _ASM_GENERIC_UNISTD_H
+#define _ASM_GENERIC_UNISTD_H
+
#include <uapi/asm-generic/unistd.h>
#include <linux/export.h>
@@ -10,3 +13,5 @@
#define __ARCH_WANT_STAT64
#define __ARCH_WANT_SYS_LLSEEK
#endif
+
+#endif /* _ASM_GENERIC_UNISTD_H */
diff --git a/include/asm-generic/xor.h b/include/asm-generic/xor.h
index b4d8432..d063878 100644
--- a/include/asm-generic/xor.h
+++ b/include/asm-generic/xor.h
@@ -12,6 +12,8 @@
* (for example /usr/src/linux/COPYING); if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#ifndef _ASM_GENERIC_XOR_H
+#define _ASM_GENERIC_XOR_H
#include <linux/prefetch.h>
@@ -716,3 +718,5 @@ static struct xor_block_template xor_block_32regs_p __maybe_unused = {
xor_speed(&xor_block_32regs); \
xor_speed(&xor_block_32regs_p); \
} while (0)
+
+#endif /* _ASM_GENERIC_XOR_H */
--
1.7.9.5
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 3/4] asm-generic: Add missing include guards
2013-08-08 21:07 ` [PATCH 3/4] asm-generic: Add missing " Rasmus Villemoes
@ 2013-08-08 21:07 ` Rasmus Villemoes
2013-08-27 13:08 ` James Hogan
1 sibling, 0 replies; 10+ messages in thread
From: Rasmus Villemoes @ 2013-08-08 21:07 UTC (permalink / raw)
To: Arnd Bergmann, Roland McGrath, Oleg Nesterov
Cc: linux-arch, linux-kernel, Rasmus Villemoes
Add include guards to include/asm-generic/{ide_iops,unistd,xor}.h.
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
---
include/asm-generic/ide_iops.h | 4 ++++
include/asm-generic/unistd.h | 5 +++++
include/asm-generic/xor.h | 4 ++++
3 files changed, 13 insertions(+)
diff --git a/include/asm-generic/ide_iops.h b/include/asm-generic/ide_iops.h
index 1b91d06..cfe2ab8 100644
--- a/include/asm-generic/ide_iops.h
+++ b/include/asm-generic/ide_iops.h
@@ -1,4 +1,6 @@
/* Generic I/O and MEMIO string operations. */
+#ifndef _ASM_GENERIC_IDE_IOPS_H
+#define _ASM_GENERIC_IDE_IOPS_H
#define __ide_insw insw
#define __ide_insl insl
@@ -36,3 +38,5 @@ static __inline__ void __ide_mm_outsl(void __iomem * port, void *addr, u32 count
addr += 4;
}
}
+
+#endif /* _ASM_GENERIC_IDE_IOPS_H */
diff --git a/include/asm-generic/unistd.h b/include/asm-generic/unistd.h
index cccc86e..0cff2e9 100644
--- a/include/asm-generic/unistd.h
+++ b/include/asm-generic/unistd.h
@@ -1,3 +1,6 @@
+#ifndef _ASM_GENERIC_UNISTD_H
+#define _ASM_GENERIC_UNISTD_H
+
#include <uapi/asm-generic/unistd.h>
#include <linux/export.h>
@@ -10,3 +13,5 @@
#define __ARCH_WANT_STAT64
#define __ARCH_WANT_SYS_LLSEEK
#endif
+
+#endif /* _ASM_GENERIC_UNISTD_H */
diff --git a/include/asm-generic/xor.h b/include/asm-generic/xor.h
index b4d8432..d063878 100644
--- a/include/asm-generic/xor.h
+++ b/include/asm-generic/xor.h
@@ -12,6 +12,8 @@
* (for example /usr/src/linux/COPYING); if not, write to the Free
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
+#ifndef _ASM_GENERIC_XOR_H
+#define _ASM_GENERIC_XOR_H
#include <linux/prefetch.h>
@@ -716,3 +718,5 @@ static struct xor_block_template xor_block_32regs_p __maybe_unused = {
xor_speed(&xor_block_32regs); \
xor_speed(&xor_block_32regs_p); \
} while (0)
+
+#endif /* _ASM_GENERIC_XOR_H */
--
1.7.9.5
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 4/4] asm-generic: Fix typo in comment after #endif
2013-08-08 21:06 [PATCH 0/4] asm-generic: fix minor include guard issues Rasmus Villemoes
` (2 preceding siblings ...)
2013-08-08 21:07 ` [PATCH 3/4] asm-generic: Add missing " Rasmus Villemoes
@ 2013-08-08 21:07 ` Rasmus Villemoes
2013-08-08 21:07 ` Rasmus Villemoes
3 siblings, 1 reply; 10+ messages in thread
From: Rasmus Villemoes @ 2013-08-08 21:07 UTC (permalink / raw)
To: Arnd Bergmann, Roland McGrath, Oleg Nesterov
Cc: linux-arch, linux-kernel, Rasmus Villemoes
Fix the comment so that it matches the actual name of the include
guard used.
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
---
include/asm-generic/bitops/arch_hweight.h | 2 +-
include/asm-generic/bitops/atomic.h | 2 +-
include/asm-generic/pci_iomap.h | 2 +-
include/asm-generic/signal.h | 2 +-
include/asm-generic/vga.h | 2 +-
5 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/include/asm-generic/bitops/arch_hweight.h b/include/asm-generic/bitops/arch_hweight.h
index 6a211f4..d6be0af 100644
--- a/include/asm-generic/bitops/arch_hweight.h
+++ b/include/asm-generic/bitops/arch_hweight.h
@@ -22,4 +22,4 @@ static inline unsigned long __arch_hweight64(__u64 w)
{
return __sw_hweight64(w);
}
-#endif /* _ASM_GENERIC_BITOPS_HWEIGHT_H_ */
+#endif /* _ASM_GENERIC_BITOPS_ARCH_HWEIGHT_H_ */
diff --git a/include/asm-generic/bitops/atomic.h b/include/asm-generic/bitops/atomic.h
index 9ae6c34..d3ac7d5 100644
--- a/include/asm-generic/bitops/atomic.h
+++ b/include/asm-generic/bitops/atomic.h
@@ -186,4 +186,4 @@ static inline int test_and_change_bit(int nr, volatile unsigned long *addr)
return (old & mask) != 0;
}
-#endif /* _ASM_GENERIC_BITOPS_ATOMIC_H */
+#endif /* _ASM_GENERIC_BITOPS_ATOMIC_H_ */
diff --git a/include/asm-generic/pci_iomap.h b/include/asm-generic/pci_iomap.h
index ce37349..0b5f271 100644
--- a/include/asm-generic/pci_iomap.h
+++ b/include/asm-generic/pci_iomap.h
@@ -32,4 +32,4 @@ static inline void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned lon
}
#endif
-#endif /* __ASM_GENERIC_IO_H */
+#endif /* __ASM_GENERIC_PCI_IOMAP_H */
diff --git a/include/asm-generic/signal.h b/include/asm-generic/signal.h
index d840c90..1fc827f 100644
--- a/include/asm-generic/signal.h
+++ b/include/asm-generic/signal.h
@@ -11,4 +11,4 @@
#undef __HAVE_ARCH_SIG_BITOPS
#endif /* __ASSEMBLY__ */
-#endif /* _ASM_GENERIC_SIGNAL_H */
+#endif /* __ASM_GENERIC_SIGNAL_H */
diff --git a/include/asm-generic/vga.h b/include/asm-generic/vga.h
index 36c8ff5..93b8a80 100644
--- a/include/asm-generic/vga.h
+++ b/include/asm-generic/vga.h
@@ -21,4 +21,4 @@
#define vga_readb(x) (*(x))
#define vga_writeb(x, y) (*(y) = (x))
-#endif /* _ASM_GENERIC_VGA_H */
+#endif /* __ASM_GENERIC_VGA_H */
--
1.7.9.5
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 4/4] asm-generic: Fix typo in comment after #endif
2013-08-08 21:07 ` [PATCH 4/4] asm-generic: Fix typo in comment after #endif Rasmus Villemoes
@ 2013-08-08 21:07 ` Rasmus Villemoes
0 siblings, 0 replies; 10+ messages in thread
From: Rasmus Villemoes @ 2013-08-08 21:07 UTC (permalink / raw)
To: Arnd Bergmann, Roland McGrath, Oleg Nesterov
Cc: linux-arch, linux-kernel, Rasmus Villemoes
Fix the comment so that it matches the actual name of the include
guard used.
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
---
include/asm-generic/bitops/arch_hweight.h | 2 +-
include/asm-generic/bitops/atomic.h | 2 +-
include/asm-generic/pci_iomap.h | 2 +-
include/asm-generic/signal.h | 2 +-
include/asm-generic/vga.h | 2 +-
5 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/include/asm-generic/bitops/arch_hweight.h b/include/asm-generic/bitops/arch_hweight.h
index 6a211f4..d6be0af 100644
--- a/include/asm-generic/bitops/arch_hweight.h
+++ b/include/asm-generic/bitops/arch_hweight.h
@@ -22,4 +22,4 @@ static inline unsigned long __arch_hweight64(__u64 w)
{
return __sw_hweight64(w);
}
-#endif /* _ASM_GENERIC_BITOPS_HWEIGHT_H_ */
+#endif /* _ASM_GENERIC_BITOPS_ARCH_HWEIGHT_H_ */
diff --git a/include/asm-generic/bitops/atomic.h b/include/asm-generic/bitops/atomic.h
index 9ae6c34..d3ac7d5 100644
--- a/include/asm-generic/bitops/atomic.h
+++ b/include/asm-generic/bitops/atomic.h
@@ -186,4 +186,4 @@ static inline int test_and_change_bit(int nr, volatile unsigned long *addr)
return (old & mask) != 0;
}
-#endif /* _ASM_GENERIC_BITOPS_ATOMIC_H */
+#endif /* _ASM_GENERIC_BITOPS_ATOMIC_H_ */
diff --git a/include/asm-generic/pci_iomap.h b/include/asm-generic/pci_iomap.h
index ce37349..0b5f271 100644
--- a/include/asm-generic/pci_iomap.h
+++ b/include/asm-generic/pci_iomap.h
@@ -32,4 +32,4 @@ static inline void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned lon
}
#endif
-#endif /* __ASM_GENERIC_IO_H */
+#endif /* __ASM_GENERIC_PCI_IOMAP_H */
diff --git a/include/asm-generic/signal.h b/include/asm-generic/signal.h
index d840c90..1fc827f 100644
--- a/include/asm-generic/signal.h
+++ b/include/asm-generic/signal.h
@@ -11,4 +11,4 @@
#undef __HAVE_ARCH_SIG_BITOPS
#endif /* __ASSEMBLY__ */
-#endif /* _ASM_GENERIC_SIGNAL_H */
+#endif /* __ASM_GENERIC_SIGNAL_H */
diff --git a/include/asm-generic/vga.h b/include/asm-generic/vga.h
index 36c8ff5..93b8a80 100644
--- a/include/asm-generic/vga.h
+++ b/include/asm-generic/vga.h
@@ -21,4 +21,4 @@
#define vga_readb(x) (*(x))
#define vga_writeb(x, y) (*(y) = (x))
-#endif /* _ASM_GENERIC_VGA_H */
+#endif /* __ASM_GENERIC_VGA_H */
--
1.7.9.5
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH 3/4] asm-generic: Add missing include guards
2013-08-08 21:07 ` [PATCH 3/4] asm-generic: Add missing " Rasmus Villemoes
2013-08-08 21:07 ` Rasmus Villemoes
@ 2013-08-27 13:08 ` James Hogan
1 sibling, 0 replies; 10+ messages in thread
From: James Hogan @ 2013-08-27 13:08 UTC (permalink / raw)
To: Rasmus Villemoes
Cc: Arnd Bergmann, Roland McGrath, Oleg Nesterov, linux-arch,
linux-kernel
On 08/08/13 22:07, Rasmus Villemoes wrote:
> Add include guards to include/asm-generic/{ide_iops,unistd,xor}.h.
>
> Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
> ---
> include/asm-generic/ide_iops.h | 4 ++++
> include/asm-generic/unistd.h | 5 +++++
> include/asm-generic/xor.h | 4 ++++
> 3 files changed, 13 insertions(+)
>
> diff --git a/include/asm-generic/unistd.h b/include/asm-generic/unistd.h
> index cccc86e..0cff2e9 100644
> --- a/include/asm-generic/unistd.h
> +++ b/include/asm-generic/unistd.h
> @@ -1,3 +1,6 @@
> +#ifndef _ASM_GENERIC_UNISTD_H
> +#define _ASM_GENERIC_UNISTD_H
> +
> #include <uapi/asm-generic/unistd.h>
> #include <linux/export.h>
>
> @@ -10,3 +13,5 @@
> #define __ARCH_WANT_STAT64
> #define __ARCH_WANT_SYS_LLSEEK
> #endif
> +
> +#endif /* _ASM_GENERIC_UNISTD_H */
I think the lack of include guards in unistd.h is intentional. See for
example the very end of arch/metag/kernel/sys_metag.c.
Cheers
James
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2013-08-27 13:08 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-08 21:06 [PATCH 0/4] asm-generic: fix minor include guard issues Rasmus Villemoes
2013-08-08 21:06 ` [PATCH 1/4] asm-generic: Make sure include guards contain the substring ASM_GENERIC Rasmus Villemoes
2013-08-08 21:06 ` Rasmus Villemoes
2013-08-08 21:07 ` [PATCH 2/4] asm-generic: Use different include guards Rasmus Villemoes
2013-08-08 21:07 ` Rasmus Villemoes
2013-08-08 21:07 ` [PATCH 3/4] asm-generic: Add missing " Rasmus Villemoes
2013-08-08 21:07 ` Rasmus Villemoes
2013-08-27 13:08 ` James Hogan
2013-08-08 21:07 ` [PATCH 4/4] asm-generic: Fix typo in comment after #endif Rasmus Villemoes
2013-08-08 21:07 ` Rasmus Villemoes
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).