Skip to content

Commit 6b57ba8

Browse files
zongboxpaul-walmsley-sifive
authored andcommitted
riscv: clean up the macro format in each header file
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 <[email protected]> Signed-off-by: Paul Walmsley <[email protected]>
1 parent 0fdc636 commit 6b57ba8

File tree

15 files changed

+40
-33
lines changed

15 files changed

+40
-33
lines changed

arch/riscv/include/asm/asm-prototypes.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/* SPDX-License-Identifier: GPL-2.0 */
22
#ifndef _ASM_RISCV_PROTOTYPES_H
3+
#define _ASM_RISCV_PROTOTYPES_H
34

45
#include <linux/ftrace.h>
56
#include <asm-generic/asm-prototypes.h>

arch/riscv/include/asm/current.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
*/
88

99

10-
#ifndef __ASM_CURRENT_H
11-
#define __ASM_CURRENT_H
10+
#ifndef _ASM_RISCV_CURRENT_H
11+
#define _ASM_RISCV_CURRENT_H
1212

1313
#include <linux/bug.h>
1414
#include <linux/compiler.h>
@@ -34,4 +34,4 @@ static __always_inline struct task_struct *get_current(void)
3434

3535
#endif /* __ASSEMBLY__ */
3636

37-
#endif /* __ASM_CURRENT_H */
37+
#endif /* _ASM_RISCV_CURRENT_H */

arch/riscv/include/asm/ftrace.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
/* SPDX-License-Identifier: GPL-2.0 */
22
/* Copyright (C) 2017 Andes Technology Corporation */
33

4+
#ifndef _ASM_RISCV_FTRACE_H
5+
#define _ASM_RISCV_FTRACE_H
6+
47
/*
58
* The graph frame test is not possible if CONFIG_FRAME_POINTER is not enabled.
69
* Check arch/riscv/kernel/mcount.S for detail.
@@ -64,3 +67,5 @@ do { \
6467
*/
6568
#define MCOUNT_INSN_SIZE 8
6669
#endif
70+
71+
#endif /* _ASM_RISCV_FTRACE_H */

arch/riscv/include/asm/futex.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
* Copyright (c) 2018 Jim Wilson ([email protected])
55
*/
66

7-
#ifndef _ASM_FUTEX_H
8-
#define _ASM_FUTEX_H
7+
#ifndef _ASM_RISCV_FUTEX_H
8+
#define _ASM_RISCV_FUTEX_H
99

1010
#include <linux/futex.h>
1111
#include <linux/uaccess.h>
@@ -112,4 +112,4 @@ futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr,
112112
return ret;
113113
}
114114

115-
#endif /* _ASM_FUTEX_H */
115+
#endif /* _ASM_RISCV_FUTEX_H */

arch/riscv/include/asm/hwcap.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
* Copyright (C) 2012 ARM Ltd.
66
* Copyright (C) 2017 SiFive
77
*/
8-
#ifndef __ASM_HWCAP_H
9-
#define __ASM_HWCAP_H
8+
#ifndef _ASM_RISCV_HWCAP_H
9+
#define _ASM_RISCV_HWCAP_H
1010

1111
#include <uapi/asm/hwcap.h>
1212

@@ -23,4 +23,5 @@ enum {
2323

2424
extern unsigned long elf_hwcap;
2525
#endif
26-
#endif
26+
27+
#endif /* _ASM_RISCV_HWCAP_H */

arch/riscv/include/asm/image.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* SPDX-License-Identifier: GPL-2.0 */
22

3-
#ifndef __ASM_IMAGE_H
4-
#define __ASM_IMAGE_H
3+
#ifndef _ASM_RISCV_IMAGE_H
4+
#define _ASM_RISCV_IMAGE_H
55

66
#define RISCV_IMAGE_MAGIC "RISCV\0\0\0"
77
#define RISCV_IMAGE_MAGIC2 "RSC\x05"
@@ -62,4 +62,4 @@ struct riscv_image_header {
6262
u32 res4;
6363
};
6464
#endif /* __ASSEMBLY__ */
65-
#endif /* __ASM_IMAGE_H */
65+
#endif /* _ASM_RISCV_IMAGE_H */

arch/riscv/include/asm/kprobes.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
* Copyright (C) 2017 SiFive
77
*/
88

9-
#ifndef _RISCV_KPROBES_H
10-
#define _RISCV_KPROBES_H
9+
#ifndef _ASM_RISCV_KPROBES_H
10+
#define _ASM_RISCV_KPROBES_H
1111

1212
#include <asm-generic/kprobes.h>
1313

14-
#endif /* _RISCV_KPROBES_H */
14+
#endif /* _ASM_RISCV_KPROBES_H */

arch/riscv/include/asm/mmiowb.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@
1111

1212
#include <asm-generic/mmiowb.h>
1313

14-
#endif /* ASM_RISCV_MMIOWB_H */
14+
#endif /* _ASM_RISCV_MMIOWB_H */

arch/riscv/include/asm/pci.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@
33
* Copyright (C) 2016 SiFive
44
*/
55

6-
#ifndef __ASM_RISCV_PCI_H
7-
#define __ASM_RISCV_PCI_H
6+
#ifndef _ASM_RISCV_PCI_H
7+
#define _ASM_RISCV_PCI_H
88

99
#include <linux/types.h>
1010
#include <linux/slab.h>
@@ -34,4 +34,4 @@ static inline int pci_proc_domain(struct pci_bus *bus)
3434
}
3535
#endif /* CONFIG_PCI */
3636

37-
#endif /* __ASM_PCI_H */
37+
#endif /* _ASM_RISCV_PCI_H */

arch/riscv/include/asm/sbi.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,4 +94,4 @@ static inline void sbi_remote_sfence_vma_asid(const unsigned long *hart_mask,
9494
SBI_CALL_4(SBI_REMOTE_SFENCE_VMA_ASID, hart_mask, start, size, asid);
9595
}
9696

97-
#endif
97+
#endif /* _ASM_RISCV_SBI_H */

0 commit comments

Comments
 (0)