Skip to content

Commit 4382159

Browse files
Peter ZijlstraAlexei Starovoitov
authored andcommitted
cfi: Flip headers
Normal include order is that linux/foo.h should include asm/foo.h, CFI has it the wrong way around. Signed-off-by: Peter Zijlstra (Intel) <[email protected]> Reviewed-by: Sami Tolvanen <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexei Starovoitov <[email protected]>
1 parent 1467aff commit 4382159

File tree

7 files changed

+14
-5
lines changed

7 files changed

+14
-5
lines changed

arch/riscv/include/asm/cfi.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@
77
*
88
* Copyright (C) 2023 Google LLC
99
*/
10+
#include <linux/bug.h>
1011

11-
#include <linux/cfi.h>
12+
struct pt_regs;
1213

1314
#ifdef CONFIG_CFI_CLANG
1415
enum bug_trap_type handle_cfi_failure(struct pt_regs *regs);

arch/riscv/kernel/cfi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
*
55
* Copyright (C) 2023 Google LLC
66
*/
7-
#include <asm/cfi.h>
7+
#include <linux/cfi.h>
88
#include <asm/insn.h>
99

1010
/*

arch/x86/include/asm/cfi.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,9 @@
77
*
88
* Copyright (C) 2022 Google LLC
99
*/
10+
#include <linux/bug.h>
1011

11-
#include <linux/cfi.h>
12+
struct pt_regs;
1213

1314
#ifdef CONFIG_CFI_CLANG
1415
enum bug_trap_type handle_cfi_failure(struct pt_regs *regs);

arch/x86/kernel/cfi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44
*
55
* Copyright (C) 2022 Google LLC
66
*/
7-
#include <asm/cfi.h>
7+
#include <linux/string.h>
8+
#include <linux/cfi.h>
89
#include <asm/insn.h>
910
#include <asm/insn-eval.h>
10-
#include <linux/string.h>
1111

1212
/*
1313
* Returns the target address and the expected type when regs->ip points

include/asm-generic/Kbuild

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ mandatory-y += bitops.h
1111
mandatory-y += bug.h
1212
mandatory-y += bugs.h
1313
mandatory-y += cacheflush.h
14+
mandatory-y += cfi.h
1415
mandatory-y += checksum.h
1516
mandatory-y += compat.h
1617
mandatory-y += current.h

include/asm-generic/cfi.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/* SPDX-License-Identifier: GPL-2.0 */
2+
#ifndef __ASM_GENERIC_CFI_H
3+
#define __ASM_GENERIC_CFI_H
4+
5+
#endif /* __ASM_GENERIC_CFI_H */

include/linux/cfi.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99

1010
#include <linux/bug.h>
1111
#include <linux/module.h>
12+
#include <asm/cfi.h>
1213

1314
#ifdef CONFIG_CFI_CLANG
1415
enum bug_trap_type report_cfi_failure(struct pt_regs *regs, unsigned long addr,

0 commit comments

Comments
 (0)