]> www.infradead.org Git - nvme.git/commitdiff
arc: get rid of private asm/unaligned.h
authorAl Viro <viro@zeniv.linux.org.uk>
Wed, 6 Dec 2023 02:53:22 +0000 (21:53 -0500)
committerAl Viro <viro@zeniv.linux.org.uk>
Wed, 2 Oct 2024 21:22:47 +0000 (17:22 -0400)
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>
arch/arc/include/asm/mmu.h
arch/arc/include/asm/unaligned.h [deleted file]
arch/arc/kernel/traps.c
arch/arc/kernel/unaligned.c
arch/arc/kernel/unaligned.h [new file with mode: 0644]

index 9febf5bc3de6d0617b3e4b2c0a985231e908963c..4ae2db59d494cb7932f129a349aff16ca967dc3d 100644 (file)
@@ -14,6 +14,7 @@ typedef struct {
        unsigned long asid[NR_CPUS];    /* 8 bit MMU PID + Generation cycle */
 } mm_context_t;
 
+struct pt_regs;
 extern void do_tlb_overlap_fault(unsigned long, unsigned long, struct pt_regs *);
 
 #endif
diff --git a/arch/arc/include/asm/unaligned.h b/arch/arc/include/asm/unaligned.h
deleted file mode 100644 (file)
index cf5a023..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-/* SPDX-License-Identifier: GPL-2.0-only */
-/*
- * Copyright (C) 2004, 2007-2010, 2011-2012 Synopsys, Inc. (www.synopsys.com)
- */
-
-#ifndef _ASM_ARC_UNALIGNED_H
-#define _ASM_ARC_UNALIGNED_H
-
-/* ARC700 can't handle unaligned Data accesses. */
-
-#include <asm-generic/unaligned.h>
-#include <asm/ptrace.h>
-
-#ifdef CONFIG_ARC_EMUL_UNALIGNED
-int misaligned_fixup(unsigned long address, struct pt_regs *regs,
-                    struct callee_regs *cregs);
-#else
-static inline int
-misaligned_fixup(unsigned long address, struct pt_regs *regs,
-                struct callee_regs *cregs)
-{
-       /* Not fixed */
-       return 1;
-}
-#endif
-
-#endif /* _ASM_ARC_UNALIGNED_H */
index a19751e824fb4c272e5cfa21ab3349210d30bfa7..41af020815495231d9a538136faf833ca1b0223e 100644 (file)
@@ -20,6 +20,7 @@
 #include <asm/setup.h>
 #include <asm/unaligned.h>
 #include <asm/kprobes.h>
+#include "unaligned.h"
 
 void die(const char *str, struct pt_regs *regs, unsigned long address)
 {
index 99a9b92ed98d629e75783f71eef34f72d84800fd..d2f5ceaaed1b4a3c0ce4fced0aa3f59ffa97b451 100644 (file)
@@ -12,6 +12,7 @@
 #include <linux/ptrace.h>
 #include <linux/uaccess.h>
 #include <asm/disasm.h>
+#include "unaligned.h"
 
 #ifdef CONFIG_CPU_BIG_ENDIAN
 #define BE             1
diff --git a/arch/arc/kernel/unaligned.h b/arch/arc/kernel/unaligned.h
new file mode 100644 (file)
index 0000000..5244453
--- /dev/null
@@ -0,0 +1,16 @@
+struct pt_regs;
+struct callee_regs;
+
+#ifdef CONFIG_ARC_EMUL_UNALIGNED
+int misaligned_fixup(unsigned long address, struct pt_regs *regs,
+                    struct callee_regs *cregs);
+#else
+static inline int
+misaligned_fixup(unsigned long address, struct pt_regs *regs,
+                struct callee_regs *cregs)
+{
+       /* Not fixed */
+       return 1;
+}
+#endif
+