aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorRoland Dreier <roland@topspin.com>2005-04-19 00:57:33 -0400
committerGreg KH <greg@press.kroah.org>2005-04-19 00:57:33 -0400
commita7a76cefc4b12bb6508afa4c77f11c2752cc365d (patch)
treed9051a989583e172d662c15695906dc9fcb536f2 /include
parent1694145854a309bebd12a5cce63c9b398304e3bb (diff)
[PATCH] debugfs: Reduce <linux/debugfs.h> dependencies
The current <linux/debugfs.h> include file is a little fragile in that it is not self-contained and hence may cause compile warnings or errors depending on the files included before it, the kernel config and the architecture. This patch makes things a little more robust by: - including <linux/types.h> to get definitions of u32, mode_t, and so on. - forward declaring struct file_operations. - including <linux/err.h> when CONFIG_DEBUG_FS is not set The last change is particularly useful, as a kernel developer is likely to build with debugfs always enabled and never see the build breakage cased if debugfs is disabled. Signed-off-by: Roland Dreier <roland@topspin.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'include')
-rw-r--r--include/linux/debugfs.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/debugfs.h b/include/linux/debugfs.h
index f7a7b86f6eef..dcf847cdb5ce 100644
--- a/include/linux/debugfs.h
+++ b/include/linux/debugfs.h
@@ -17,6 +17,10 @@
17 17
18#include <linux/fs.h> 18#include <linux/fs.h>
19 19
20#include <linux/types.h>
21
22struct file_operations;
23
20#if defined(CONFIG_DEBUG_FS) 24#if defined(CONFIG_DEBUG_FS)
21struct dentry *debugfs_create_file(const char *name, mode_t mode, 25struct dentry *debugfs_create_file(const char *name, mode_t mode,
22 struct dentry *parent, void *data, 26 struct dentry *parent, void *data,
@@ -36,6 +40,9 @@ struct dentry *debugfs_create_bool(const char *name, mode_t mode,
36 struct dentry *parent, u32 *value); 40 struct dentry *parent, u32 *value);
37 41
38#else 42#else
43
44#include <linux/err.h>
45
39/* 46/*
40 * We do not return NULL from these functions if CONFIG_DEBUG_FS is not enabled 47 * We do not return NULL from these functions if CONFIG_DEBUG_FS is not enabled
41 * so users have a chance to detect if there was a real error or not. We don't 48 * so users have a chance to detect if there was a real error or not. We don't