tree d9051a989583e172d662c15695906dc9fcb536f2
parent 1694145854a309bebd12a5cce63c9b398304e3bb
author Roland Dreier <[EMAIL PROTECTED]> Tue, 19 Apr 2005 11:57:33 -0700
committer Greg KH <[EMAIL PROTECTED]> Tue, 19 Apr 2005 11:57:33 -0700

[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 <[EMAIL PROTECTED]>
Signed-off-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>


 linux/debugfs.h |    7 +++++++
 1 files changed, 7 insertions(+)

Index: include/linux/debugfs.h
===================================================================
--- 02dc62f231bc65bfa2bc665b34ccc45e48270397/include/linux/debugfs.h  
(mode:100644 sha1:f7a7b86f6eef5e6739acd9c101d7101974cf99b1)
+++ d9051a989583e172d662c15695906dc9fcb536f2/include/linux/debugfs.h  
(mode:100644 sha1:dcf847cdb5cebf19adabf29befe08fdbe0cc6224)
@@ -17,6 +17,10 @@
 
 #include <linux/fs.h>
 
+#include <linux/types.h>
+
+struct file_operations;
+
 #if defined(CONFIG_DEBUG_FS)
 struct dentry *debugfs_create_file(const char *name, mode_t mode,
                                   struct dentry *parent, void *data,
@@ -36,6 +40,9 @@
                                  struct dentry *parent, u32 *value);
 
 #else
+
+#include <linux/err.h>
+
 /* 
  * We do not return NULL from these functions if CONFIG_DEBUG_FS is not enabled
  * so users have a chance to detect if there was a real error or not.  We don't
-
To unsubscribe from this list: send the line "unsubscribe bk-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to