Skip to content

Commit 4fc1a60

Browse files
Gao fengdavem330
authored andcommitted
net: proc: fix build failed when procfs is not configured
commit d4beaa6 "net: proc: change proc_net_fops_create to proc_create" uses proc_create to replace proc_net_fops_create, when CONFIG_PROC isn't configured, some build error will occurs. net/packet/af_packet.c: In function 'packet_net_init': net/packet/af_packet.c:3831:48: error: 'packet_seq_fops' undeclared (first use in this function) net/packet/af_packet.c:3831:48: note: each undeclared identifier is reported only once for each function it appears in There may be other build fails like above,this patch change proc_create from function to macros when CONFIG_PROC is not configured,just like what proc_net_fops_create did before this commit. Reported-by: Fengguang Wu <[email protected]> Signed-off-by: Gao feng <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 629821d commit 4fc1a60

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

include/linux/proc_fs.h

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -187,12 +187,9 @@ static inline void proc_flush_task(struct task_struct *task)
187187

188188
static inline struct proc_dir_entry *create_proc_entry(const char *name,
189189
umode_t mode, struct proc_dir_entry *parent) { return NULL; }
190-
static inline struct proc_dir_entry *proc_create(const char *name,
191-
umode_t mode, struct proc_dir_entry *parent,
192-
const struct file_operations *proc_fops)
193-
{
194-
return NULL;
195-
}
190+
191+
#define proc_create(name, mode, parent, fops) ({ (void)(mode), NULL; })
192+
196193
static inline struct proc_dir_entry *proc_create_data(const char *name,
197194
umode_t mode, struct proc_dir_entry *parent,
198195
const struct file_operations *proc_fops, void *data)

0 commit comments

Comments
 (0)