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

MIPS: Declare mips_debugfs_dir in a header

We have many extern declarations of mips_debugfs_dir through arch/mips/
in various C files. Unify them by declaring mips_debugfs_dir in a
header, including it in each affected C file & removing the duplicate
declarations.

Signed-off-by: Paul Burton <paul.burton@imgtec.com>
Cc: linux-mips@linux-mips.org
Cc: Steven J. Hill <Steven.Hill@imgtec.com>
Cc: Alexander Sverdlin <alexander.sverdlin@nokia.com>
Cc: Masahiro Yamada <yamada.masahiro@socionext.com>
Cc: Leonid Yegoshin <Leonid.Yegoshin@imgtec.com>
Cc: Maciej W. Rozycki <macro@linux-mips.org>
Cc: linux-kernel@vger.kernel.org
Cc: Joe Perches <joe@perches.com>
Cc: Jaedon Shin <jaedon.shin@gmail.com>
Cc: James Hogan <james.hogan@imgtec.com>
Cc: David Daney <david.daney@cavium.com>
Cc: Zubair Lutfullah Kakakhel <Zubair.Kakakhel@imgtec.com>
Cc: Markos Chandras <markos.chandras@imgtec.com>
Cc: James Cowgill <James.Cowgill@imgtec.com>
Patchwork: https://patchwork.linux-mips.org/patch/11181/
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>

authored by

Paul Burton and committed by
Ralf Baechle
75dcfc1d 4d035516

+28 -7
+22
arch/mips/include/asm/debug.h
··· 1 + /* 2 + * Copyright (C) 2015 Imagination Technologies 3 + * 4 + * This program is free software; you can redistribute it and/or modify it 5 + * under the terms of the GNU General Public License as published by the 6 + * Free Software Foundation; either version 2 of the License, or (at your 7 + * option) any later version. 8 + */ 9 + 10 + #ifndef __MIPS_ASM_DEBUG_H__ 11 + #define __MIPS_ASM_DEBUG_H__ 12 + 13 + #include <linux/dcache.h> 14 + 15 + /* 16 + * mips_debugfs_dir corresponds to the "mips" directory at the top level 17 + * of the DebugFS hierarchy. MIPS-specific DebugFS entires should be 18 + * placed beneath this directory. 19 + */ 20 + extern struct dentry *mips_debugfs_dir; 21 + 22 + #endif /* __MIPS_ASM_DEBUG_H__ */
+1 -1
arch/mips/kernel/mips-r2-to-r6-emul.c
··· 22 22 #include <asm/asm.h> 23 23 #include <asm/branch.h> 24 24 #include <asm/break.h> 25 + #include <asm/debug.h> 25 26 #include <asm/fpu.h> 26 27 #include <asm/fpu_emulator.h> 27 28 #include <asm/inst.h> ··· 2364 2363 2365 2364 static int __init mipsr2_init_debugfs(void) 2366 2365 { 2367 - extern struct dentry *mips_debugfs_dir; 2368 2366 struct dentry *mipsr2_emul; 2369 2367 2370 2368 if (!mips_debugfs_dir)
+1 -1
arch/mips/kernel/segment.c
··· 10 10 #include <linux/debugfs.h> 11 11 #include <linux/seq_file.h> 12 12 #include <asm/cpu.h> 13 + #include <asm/debug.h> 13 14 #include <asm/mipsregs.h> 14 15 15 16 static void build_segment_config(char *str, unsigned int cfg) ··· 92 91 93 92 static int __init segments_info(void) 94 93 { 95 - extern struct dentry *mips_debugfs_dir; 96 94 struct dentry *segments; 97 95 98 96 if (cpu_has_segments) {
+1
arch/mips/kernel/setup.c
··· 33 33 #include <asm/cache.h> 34 34 #include <asm/cdmm.h> 35 35 #include <asm/cpu.h> 36 + #include <asm/debug.h> 36 37 #include <asm/sections.h> 37 38 #include <asm/setup.h> 38 39 #include <asm/smp-ops.h>
+1 -3
arch/mips/kernel/spinlock_test.c
··· 5 5 #include <linux/debugfs.h> 6 6 #include <linux/export.h> 7 7 #include <linux/spinlock.h> 8 - 8 + #include <asm/debug.h> 9 9 10 10 static int ss_get(void *data, u64 *val) 11 11 { ··· 115 115 116 116 DEFINE_SIMPLE_ATTRIBUTE(fops_multi, multi_get, NULL, "%llu\n"); 117 117 118 - 119 - extern struct dentry *mips_debugfs_dir; 120 118 static int __init spinlock_test(void) 121 119 { 122 120 struct dentry *d;
+1 -1
arch/mips/kernel/unaligned.c
··· 85 85 #include <asm/branch.h> 86 86 #include <asm/byteorder.h> 87 87 #include <asm/cop2.h> 88 + #include <asm/debug.h> 88 89 #include <asm/fpu.h> 89 90 #include <asm/fpu_emulator.h> 90 91 #include <asm/inst.h> ··· 2296 2295 } 2297 2296 2298 2297 #ifdef CONFIG_DEBUG_FS 2299 - extern struct dentry *mips_debugfs_dir; 2300 2298 static int __init debugfs_unaligned(void) 2301 2299 { 2302 2300 struct dentry *d;
+1 -1
arch/mips/math-emu/me-debugfs.c
··· 4 4 #include <linux/init.h> 5 5 #include <linux/percpu.h> 6 6 #include <linux/types.h> 7 + #include <asm/debug.h> 7 8 #include <asm/fpu_emulator.h> 8 9 #include <asm/local.h> 9 10 ··· 28 27 } 29 28 DEFINE_SIMPLE_ATTRIBUTE(fops_fpuemu_stat, fpuemu_stat_get, NULL, "%llu\n"); 30 29 31 - extern struct dentry *mips_debugfs_dir; 32 30 static int __init debugfs_fpuemu(void) 33 31 { 34 32 struct dentry *d, *dir;