Skip to content

Commit 0042908

Browse files
author
Al Viro
committed
arc: get rid of private asm/unaligned.h
Declarations local to arch/*/kernel/*.c are better off *not* in a public header - arch/arc/kernel/unaligned.h is just fine for those bits. Unlike the parisc case, here we have an extra twist - asm/mmu.h has an implicit dependency on struct pt_regs, and in some users that used to be satisfied by include of asm/ptrace.h from asm/unaligned.h (note that asm/mmu.h itself did _not_ pull asm/unaligned.h - it relied upon the users having pulled asm/unaligned.h before asm/mmu.h got there). Seeing that asm/mmu.h only wants struct pt_regs * arguments in an extern, just pre-declare it there - less brittle that way. With that done _all_ asm/unaligned.h instances are reduced to include of asm-generic/unaligned.h and can be removed - unaligned.h is in mandatory-y in include/asm-generic/Kbuild. What's more, we can move asm-generic/unaligned.h to linux/unaligned.h and switch includes of <asm/unaligned.h> to <linux/unaligned.h>; that's better off as an auto-generated commit, though, to be done by Linus at -rc1 time next cycle. Acked-by: Vineet Gupta <[email protected]> Signed-off-by: Al Viro <[email protected]>
1 parent 134d988 commit 0042908

File tree

5 files changed

+19
-27
lines changed

5 files changed

+19
-27
lines changed

arch/arc/include/asm/mmu.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ typedef struct {
1414
unsigned long asid[NR_CPUS]; /* 8 bit MMU PID + Generation cycle */
1515
} mm_context_t;
1616

17+
struct pt_regs;
1718
extern void do_tlb_overlap_fault(unsigned long, unsigned long, struct pt_regs *);
1819

1920
#endif

arch/arc/include/asm/unaligned.h

Lines changed: 0 additions & 27 deletions
This file was deleted.

arch/arc/kernel/traps.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include <asm/setup.h>
2121
#include <asm/unaligned.h>
2222
#include <asm/kprobes.h>
23+
#include "unaligned.h"
2324

2425
void die(const char *str, struct pt_regs *regs, unsigned long address)
2526
{

arch/arc/kernel/unaligned.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
#include <linux/ptrace.h>
1313
#include <linux/uaccess.h>
1414
#include <asm/disasm.h>
15+
#include "unaligned.h"
1516

1617
#ifdef CONFIG_CPU_BIG_ENDIAN
1718
#define BE 1

arch/arc/kernel/unaligned.h

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
struct pt_regs;
2+
struct callee_regs;
3+
4+
#ifdef CONFIG_ARC_EMUL_UNALIGNED
5+
int misaligned_fixup(unsigned long address, struct pt_regs *regs,
6+
struct callee_regs *cregs);
7+
#else
8+
static inline int
9+
misaligned_fixup(unsigned long address, struct pt_regs *regs,
10+
struct callee_regs *cregs)
11+
{
12+
/* Not fixed */
13+
return 1;
14+
}
15+
#endif
16+

0 commit comments

Comments
 (0)