Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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 <vgupta@kernel.org>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>

Al Viro 00429083 134d9882

+19 -27
+1
arch/arc/include/asm/mmu.h
··· 14 14 unsigned long asid[NR_CPUS]; /* 8 bit MMU PID + Generation cycle */ 15 15 } mm_context_t; 16 16 17 + struct pt_regs; 17 18 extern void do_tlb_overlap_fault(unsigned long, unsigned long, struct pt_regs *); 18 19 19 20 #endif
-27
arch/arc/include/asm/unaligned.h
··· 1 - /* SPDX-License-Identifier: GPL-2.0-only */ 2 - /* 3 - * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com) 4 - */ 5 - 6 - #ifndef _ASM_ARC_UNALIGNED_H 7 - #define _ASM_ARC_UNALIGNED_H 8 - 9 - /* ARC700 can't handle unaligned Data accesses. */ 10 - 11 - #include <asm-generic/unaligned.h> 12 - #include <asm/ptrace.h> 13 - 14 - #ifdef CONFIG_ARC_EMUL_UNALIGNED 15 - int misaligned_fixup(unsigned long address, struct pt_regs *regs, 16 - struct callee_regs *cregs); 17 - #else 18 - static inline int 19 - misaligned_fixup(unsigned long address, struct pt_regs *regs, 20 - struct callee_regs *cregs) 21 - { 22 - /* Not fixed */ 23 - return 1; 24 - } 25 - #endif 26 - 27 - #endif /* _ASM_ARC_UNALIGNED_H */
+1
arch/arc/kernel/traps.c
··· 20 20 #include <asm/setup.h> 21 21 #include <asm/unaligned.h> 22 22 #include <asm/kprobes.h> 23 + #include "unaligned.h" 23 24 24 25 void die(const char *str, struct pt_regs *regs, unsigned long address) 25 26 {
+1
arch/arc/kernel/unaligned.c
··· 12 12 #include <linux/ptrace.h> 13 13 #include <linux/uaccess.h> 14 14 #include <asm/disasm.h> 15 + #include "unaligned.h" 15 16 16 17 #ifdef CONFIG_CPU_BIG_ENDIAN 17 18 #define BE 1
+16
arch/arc/kernel/unaligned.h
··· 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 +