riscv: clean up the macro format in each header file
authorZong Li <zong.li@sifive.com>
Mon, 28 Oct 2019 07:42:47 +0000 (00:42 -0700)
committerPaul Walmsley <paul.walmsley@sifive.com>
Tue, 12 Nov 2019 20:04:52 +0000 (12:04 -0800)
There are many different formats in each header now, such as
_ASM_XXX_H, __ASM_XXX_H, _ASM_RISCV_XXX_H, RISCV_XXX_H, etc., This patch
tries to unify the format by using _ASM_RISCV_XXX_H, because the most
header use it now. This patch also adds the conditional to the headers
if they lost it.

Signed-off-by: Zong Li <zong.li@sifive.com>
Signed-off-by: Paul Walmsley <paul.walmsley@sifive.com>
15 files changed:
arch/riscv/include/asm/asm-prototypes.h
arch/riscv/include/asm/current.h
arch/riscv/include/asm/ftrace.h
arch/riscv/include/asm/futex.h
arch/riscv/include/asm/hwcap.h
arch/riscv/include/asm/image.h
arch/riscv/include/asm/kprobes.h
arch/riscv/include/asm/mmiowb.h
arch/riscv/include/asm/pci.h
arch/riscv/include/asm/sbi.h
arch/riscv/include/asm/sparsemem.h
arch/riscv/include/asm/spinlock_types.h
arch/riscv/include/uapi/asm/elf.h
arch/riscv/include/uapi/asm/hwcap.h
arch/riscv/include/uapi/asm/ucontext.h

index c9fecd120d187182a13709b8661753146ba6d380..dd62b691c443d821163e7460c4376b482c30396f 100644 (file)
@@ -1,5 +1,6 @@
 /* SPDX-License-Identifier: GPL-2.0 */
 #ifndef _ASM_RISCV_PROTOTYPES_H
+#define _ASM_RISCV_PROTOTYPES_H
 
 #include <linux/ftrace.h>
 #include <asm-generic/asm-prototypes.h>
index 44dcf7fc15eeaf0e9ee55d8ee4c84c0cc2325367..dd973efe5d7cefb85e1a892ecaf2002cef9f4dae 100644 (file)
@@ -7,8 +7,8 @@
  */
 
 
-#ifndef __ASM_CURRENT_H
-#define __ASM_CURRENT_H
+#ifndef _ASM_RISCV_CURRENT_H
+#define _ASM_RISCV_CURRENT_H
 
 #include <linux/bug.h>
 #include <linux/compiler.h>
@@ -34,4 +34,4 @@ static __always_inline struct task_struct *get_current(void)
 
 #endif /* __ASSEMBLY__ */
 
-#endif /* __ASM_CURRENT_H */
+#endif /* _ASM_RISCV_CURRENT_H */
index c6dcc5291f972ab74fd534436be003ed8e2b308d..ace8a6e2d11d379562c530022341f4b8dbe9bd28 100644 (file)
@@ -1,6 +1,9 @@
 /* SPDX-License-Identifier: GPL-2.0 */
 /* Copyright (C) 2017 Andes Technology Corporation */
 
+#ifndef _ASM_RISCV_FTRACE_H
+#define _ASM_RISCV_FTRACE_H
+
 /*
  * The graph frame test is not possible if CONFIG_FRAME_POINTER is not enabled.
  * Check arch/riscv/kernel/mcount.S for detail.
@@ -64,3 +67,5 @@ do {                                                                  \
  */
 #define MCOUNT_INSN_SIZE 8
 #endif
+
+#endif /* _ASM_RISCV_FTRACE_H */
index 4ad6409c4647db4a4a613817c9abeaf57707f1df..2073105844227904e1f83c4f8312d6e4d75d7eb8 100644 (file)
@@ -4,8 +4,8 @@
  * Copyright (c) 2018  Jim Wilson (jimw@sifive.com)
  */
 
-#ifndef _ASM_FUTEX_H
-#define _ASM_FUTEX_H
+#ifndef _ASM_RISCV_FUTEX_H
+#define _ASM_RISCV_FUTEX_H
 
 #include <linux/futex.h>
 #include <linux/uaccess.h>
@@ -112,4 +112,4 @@ futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr,
        return ret;
 }
 
-#endif /* _ASM_FUTEX_H */
+#endif /* _ASM_RISCV_FUTEX_H */
index 7ecb7c6a57b1ff5c6b159d444fcdf284e5c6728d..1bb0cd04aec386d5462f7a2eb0f8cd3dbb36c467 100644 (file)
@@ -5,8 +5,8 @@
  * Copyright (C) 2012 ARM Ltd.
  * Copyright (C) 2017 SiFive
  */
-#ifndef __ASM_HWCAP_H
-#define __ASM_HWCAP_H
+#ifndef _ASM_RISCV_HWCAP_H
+#define _ASM_RISCV_HWCAP_H
 
 #include <uapi/asm/hwcap.h>
 
@@ -23,4 +23,5 @@ enum {
 
 extern unsigned long elf_hwcap;
 #endif
-#endif
+
+#endif /* _ASM_RISCV_HWCAP_H */
index 344db5244547c18b53e10e1183084839fb49960b..7b0f92ba0acc4f7541fe130f1a7b82da21444c37 100644 (file)
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: GPL-2.0 */
 
-#ifndef __ASM_IMAGE_H
-#define __ASM_IMAGE_H
+#ifndef _ASM_RISCV_IMAGE_H
+#define _ASM_RISCV_IMAGE_H
 
 #define RISCV_IMAGE_MAGIC      "RISCV\0\0\0"
 #define RISCV_IMAGE_MAGIC2     "RSC\x05"
@@ -62,4 +62,4 @@ struct riscv_image_header {
        u32 res4;
 };
 #endif /* __ASSEMBLY__ */
-#endif /* __ASM_IMAGE_H */
+#endif /* _ASM_RISCV_IMAGE_H */
index 96e30ef637e85ab83baa49ede6fdfa009926f473..56a98ea3073145dec12a7d9a16fff7bb1a757d30 100644 (file)
@@ -6,9 +6,9 @@
  * Copyright (C) 2017 SiFive
  */
 
-#ifndef _RISCV_KPROBES_H
-#define _RISCV_KPROBES_H
+#ifndef _ASM_RISCV_KPROBES_H
+#define _ASM_RISCV_KPROBES_H
 
 #include <asm-generic/kprobes.h>
 
-#endif /* _RISCV_KPROBES_H */
+#endif /* _ASM_RISCV_KPROBES_H */
index 5d7e3a2b4e3b2ace6cc1d25097ad49bec655e77c..bb4091ff4a21fb3229aba4e298f7e6bd2b07e239 100644 (file)
@@ -11,4 +11,4 @@
 
 #include <asm-generic/mmiowb.h>
 
-#endif /* ASM_RISCV_MMIOWB_H */
+#endif /* _ASM_RISCV_MMIOWB_H */
index 5ac8daa1cc36c7a2f8b3a8932670d473434f61bc..1c473a1bd9862b9a75d27e8c59292f28ff419bbc 100644 (file)
@@ -3,8 +3,8 @@
  * Copyright (C) 2016 SiFive
  */
 
-#ifndef __ASM_RISCV_PCI_H
-#define __ASM_RISCV_PCI_H
+#ifndef _ASM_RISCV_PCI_H
+#define _ASM_RISCV_PCI_H
 
 #include <linux/types.h>
 #include <linux/slab.h>
@@ -34,4 +34,4 @@ static inline int pci_proc_domain(struct pci_bus *bus)
 }
 #endif  /* CONFIG_PCI */
 
-#endif  /* __ASM_PCI_H */
+#endif  /* _ASM_RISCV_PCI_H */
index 21134b3ef404636a5a38a9863758be52cd7bac61..b0d6fda902f48776a5fbe72b63ff969dbb11980f 100644 (file)
@@ -94,4 +94,4 @@ static inline void sbi_remote_sfence_vma_asid(const unsigned long *hart_mask,
        SBI_CALL_4(SBI_REMOTE_SFENCE_VMA_ASID, hart_mask, start, size, asid);
 }
 
-#endif
+#endif /* _ASM_RISCV_SBI_H */
index b58ba2d9ed6efff51a62c392f5b64c4b7d395e32..45a7018a8118b911bedddbc39b984031657300ca 100644 (file)
@@ -1,11 +1,11 @@
 /* SPDX-License-Identifier: GPL-2.0 */
 
-#ifndef __ASM_SPARSEMEM_H
-#define __ASM_SPARSEMEM_H
+#ifndef _ASM_RISCV_SPARSEMEM_H
+#define _ASM_RISCV_SPARSEMEM_H
 
 #ifdef CONFIG_SPARSEMEM
 #define MAX_PHYSMEM_BITS       CONFIG_PA_BITS
 #define SECTION_SIZE_BITS      27
 #endif /* CONFIG_SPARSEMEM */
 
-#endif /* __ASM_SPARSEMEM_H */
+#endif /* _ASM_RISCV_SPARSEMEM_H */
index 888cbf8e71112a9d0c25f6bc2a37ebb84be84b39..f398e7638dd632bd73ed68b47f74d14631efc507 100644 (file)
@@ -22,4 +22,4 @@ typedef struct {
 
 #define __ARCH_RW_LOCK_UNLOCKED                { 0 }
 
-#endif
+#endif /* _ASM_RISCV_SPINLOCK_TYPES_H */
index 644a00ce6e2ec166fa324e09261750ddbc188112..d696d6610231dd6cacacdeba77e7c96b6184d993 100644 (file)
@@ -9,8 +9,8 @@
  * (at your option) any later version.
  */
 
-#ifndef _UAPI_ASM_ELF_H
-#define _UAPI_ASM_ELF_H
+#ifndef _UAPI_ASM_RISCV_ELF_H
+#define _UAPI_ASM_RISCV_ELF_H
 
 #include <asm/ptrace.h>
 
@@ -95,4 +95,4 @@ typedef union __riscv_fp_state elf_fpregset_t;
 #define R_RISCV_32_PCREL       57
 
 
-#endif /* _UAPI_ASM_ELF_H */
+#endif /* _UAPI_ASM_RISCV_ELF_H */
index 4e76460770562ce8e84efb62c1b89d3471d61e70..dee98ee2831836c2f38f5c3b7f11b7482d1a70c7 100644 (file)
@@ -5,8 +5,8 @@
  * Copyright (C) 2012 ARM Ltd.
  * Copyright (C) 2017 SiFive
  */
-#ifndef __UAPI_ASM_HWCAP_H
-#define __UAPI_ASM_HWCAP_H
+#ifndef _UAPI_ASM_RISCV_HWCAP_H
+#define _UAPI_ASM_RISCV_HWCAP_H
 
 /*
  * Linux saves the floating-point registers according to the ISA Linux is
@@ -22,4 +22,4 @@
 #define COMPAT_HWCAP_ISA_D     (1 << ('D' - 'A'))
 #define COMPAT_HWCAP_ISA_C     (1 << ('C' - 'A'))
 
-#endif
+#endif /* _UAPI_ASM_RISCV_HWCAP_H */
index 411dd7b52ed688cd3d4b3c4c7b697c162f8327be..44eb993950e5e32fe26267fe99c6071e5ddf1f2d 100644 (file)
@@ -5,8 +5,8 @@
  *
  * This file was copied from arch/arm64/include/uapi/asm/ucontext.h
  */
-#ifndef _UAPI__ASM_UCONTEXT_H
-#define _UAPI__ASM_UCONTEXT_H
+#ifndef _UAPI_ASM_RISCV_UCONTEXT_H
+#define _UAPI_ASM_RISCV_UCONTEXT_H
 
 #include <linux/types.h>
 
@@ -31,4 +31,4 @@ struct ucontext {
        struct sigcontext uc_mcontext;
 };
 
-#endif /* _UAPI__ASM_UCONTEXT_H */
+#endif /* _UAPI_ASM_RISCV_UCONTEXT_H */