mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
proc: introduce proc_create_seq_private
Variant of proc_create_data that directly take a struct seq_operations argument + a private state size and drastically reduces the boilerplate code in the callers. All trivial callers converted over. Signed-off-by: Christoph Hellwig <hch@lst.de>
This commit is contained in:
parent
fddda2b7b5
commit
44414d82cf
12 changed files with 37 additions and 113 deletions
|
@ -25,11 +25,13 @@ extern struct proc_dir_entry *proc_mkdir_mode(const char *, umode_t,
|
|||
struct proc_dir_entry *);
|
||||
struct proc_dir_entry *proc_create_mount_point(const char *name);
|
||||
|
||||
struct proc_dir_entry *proc_create_seq_data(const char *name, umode_t mode,
|
||||
struct proc_dir_entry *proc_create_seq_private(const char *name, umode_t mode,
|
||||
struct proc_dir_entry *parent, const struct seq_operations *ops,
|
||||
void *data);
|
||||
unsigned int state_size, void *data);
|
||||
#define proc_create_seq_data(name, mode, parent, ops, data) \
|
||||
proc_create_seq_private(name, mode, parent, ops, 0, data)
|
||||
#define proc_create_seq(name, mode, parent, ops) \
|
||||
proc_create_seq_data(name, mode, parent, ops, NULL)
|
||||
proc_create_seq_private(name, mode, parent, ops, 0, NULL)
|
||||
|
||||
extern struct proc_dir_entry *proc_create_data(const char *, umode_t,
|
||||
struct proc_dir_entry *,
|
||||
|
@ -64,6 +66,7 @@ static inline struct proc_dir_entry *proc_mkdir_data(const char *name,
|
|||
umode_t mode, struct proc_dir_entry *parent, void *data) { return NULL; }
|
||||
static inline struct proc_dir_entry *proc_mkdir_mode(const char *name,
|
||||
umode_t mode, struct proc_dir_entry *parent) { return NULL; }
|
||||
#define proc_create_seq_private(name, mode, parent, ops, 0, data) ({NULL;})
|
||||
#define proc_create_seq_data(name, mode, parent, ops, data) ({NULL;})
|
||||
#define proc_create_seq(name, mode, parent, ops) ({NULL;})
|
||||
#define proc_create(name, mode, parent, proc_fops) ({NULL;})
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue