From: Roland Dreier Date: Tue, 19 Apr 2005 04:57:33 +0000 (-0700) Subject: [PATCH] debugfs: Reduce dependencies X-Git-Url: http://drtracing.org/?a=commitdiff_plain;h=a7a76cefc4b12bb6508afa4c77f11c2752cc365d;p=deliverable%2Flinux.git [PATCH] debugfs: Reduce dependencies The current 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 to get definitions of u32, mode_t, and so on. - forward declaring struct file_operations. - including 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 Signed-off-by: Greg Kroah-Hartman --- 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 @@ #include +#include + +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 *debugfs_create_bool(const char *name, mode_t mode, struct dentry *parent, u32 *value); #else + +#include + /* * 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