The following should work better. They have the desired properties that:
- return value makes sense for those that might check
- arguments fops and info don't have to be defined (ie can be #ifdef'd
out)
- generate no warnings for null effect.
diff -Nru a/include/linux/proc_fs.h b/include/linux/proc_fs.h
--- a/include/linux/proc_fs.h Fri Sep 12 11:19:07 2003
+++ b/include/linux/proc_fs.h Fri Sep 12 11:19:07 2003
@@ -185,9 +185,10 @@
#else
#define proc_root_driver NULL
-#define proc_net_fops_create(name,mode,fops) do {} while(0)
-static inline struct proc_dir_entry *proc_net_create(const char *name, mode_t
mode,
- get_info_t *get_info) {return NULL;}
+#define proc_net NULL
+
+#define proc_net_fops_create(name, mode, fops) ({ (void)(mode), NULL; })
+#define proc_net_create(name, mode, info) ({ (void)(mode), NULL; })
static inline void proc_net_remove(const char *name) {}
static inline struct dentry *proc_pid_unhash(struct task_struct *p) { return
NULL; }
|