Skip to content

Commit 75dcfc1

Browse files
paulburtonralfbaechle
authored andcommitted
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>
1 parent 4d03551 commit 75dcfc1

7 files changed

Lines changed: 28 additions & 7 deletions

File tree

‎arch/mips/include/asm/debug.h‎

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
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__ */

‎arch/mips/kernel/mips-r2-to-r6-emul.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@
2222
#include <asm/asm.h>
2323
#include <asm/branch.h>
2424
#include <asm/break.h>
25+
#include <asm/debug.h>
2526
#include <asm/fpu.h>
2627
#include <asm/fpu_emulator.h>
2728
#include <asm/inst.h>
@@ -2363,7 +2364,6 @@ static const struct file_operations mipsr2_clear_fops = {
23632364

23642365
static int __init mipsr2_init_debugfs(void)
23652366
{
2366-
extern struct dentry *mips_debugfs_dir;
23672367
struct dentry *mipsr2_emul;
23682368

23692369
if (!mips_debugfs_dir)

‎arch/mips/kernel/segment.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include <linux/debugfs.h>
1111
#include <linux/seq_file.h>
1212
#include <asm/cpu.h>
13+
#include <asm/debug.h>
1314
#include <asm/mipsregs.h>
1415

1516
static void build_segment_config(char *str, unsigned int cfg)
@@ -91,7 +92,6 @@ static const struct file_operations segments_fops = {
9192

9293
static int __init segments_info(void)
9394
{
94-
extern struct dentry *mips_debugfs_dir;
9595
struct dentry *segments;
9696

9797
if (cpu_has_segments) {

‎arch/mips/kernel/setup.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
#include <asm/cache.h>
3434
#include <asm/cdmm.h>
3535
#include <asm/cpu.h>
36+
#include <asm/debug.h>
3637
#include <asm/sections.h>
3738
#include <asm/setup.h>
3839
#include <asm/smp-ops.h>

‎arch/mips/kernel/spinlock_test.c‎

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#include <linux/debugfs.h>
66
#include <linux/export.h>
77
#include <linux/spinlock.h>
8-
8+
#include <asm/debug.h>
99

1010
static int ss_get(void *data, u64 *val)
1111
{
@@ -115,8 +115,6 @@ static int multi_get(void *data, u64 *val)
115115

116116
DEFINE_SIMPLE_ATTRIBUTE(fops_multi, multi_get, NULL, "%llu\n");
117117

118-
119-
extern struct dentry *mips_debugfs_dir;
120118
static int __init spinlock_test(void)
121119
{
122120
struct dentry *d;

‎arch/mips/kernel/unaligned.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@
8585
#include <asm/branch.h>
8686
#include <asm/byteorder.h>
8787
#include <asm/cop2.h>
88+
#include <asm/debug.h>
8889
#include <asm/fpu.h>
8990
#include <asm/fpu_emulator.h>
9091
#include <asm/inst.h>
@@ -2295,7 +2296,6 @@ asmlinkage void do_ade(struct pt_regs *regs)
22952296
}
22962297

22972298
#ifdef CONFIG_DEBUG_FS
2298-
extern struct dentry *mips_debugfs_dir;
22992299
static int __init debugfs_unaligned(void)
23002300
{
23012301
struct dentry *d;

‎arch/mips/math-emu/me-debugfs.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#include <linux/init.h>
55
#include <linux/percpu.h>
66
#include <linux/types.h>
7+
#include <asm/debug.h>
78
#include <asm/fpu_emulator.h>
89
#include <asm/local.h>
910

@@ -27,7 +28,6 @@ static int fpuemu_stat_get(void *data, u64 *val)
2728
}
2829
DEFINE_SIMPLE_ATTRIBUTE(fops_fpuemu_stat, fpuemu_stat_get, NULL, "%llu\n");
2930

30-
extern struct dentry *mips_debugfs_dir;
3131
static int __init debugfs_fpuemu(void)
3232
{
3333
struct dentry *d, *dir;

0 commit comments

Comments
 (0)