ns_get_path() and ns_get_path_cb() only ever return either NULL or an ERR_PTR. It is far more idiomatic to simply return an integer, and it makes all of the callers of ns_get_path() more straightforward to read.
Showing the changes to include/linux (1 of 5 files). Show all
Unified · Split
| @@ -76,10 +76,10 @@ static inline int ns_alloc_inum(struct ns_common *ns) · 75 unmodified lines | |||
| 76 | 76 | ||
| 77 | extern struct file *proc_ns_fget(int fd); | 77 | extern struct file *proc_ns_fget(int fd); |
| 78 | #define get_proc_ns(inode) ((struct ns_common *)(inode)->i_private) | 78 | #define get_proc_ns(inode) ((struct ns_common *)(inode)->i_private) |
| 79 | extern void *ns_get_path(struct path *path, struct task_struct *task, | 79 | extern int ns_get_path(struct path *path, struct task_struct *task, |
| 80 | const struct proc_ns_operations *ns_ops); | 80 | const struct proc_ns_operations *ns_ops); |
| 81 | typedef struct ns_common *ns_get_path_helper_t(void *); | 81 | typedef struct ns_common *ns_get_path_helper_t(void *); |
| 82 | extern void *ns_get_path_cb(struct path *path, ns_get_path_helper_t ns_get_cb, | 82 | extern int ns_get_path_cb(struct path *path, ns_get_path_helper_t ns_get_cb, |
| 83 | void *private_data); | 83 | void *private_data); |
| 84 | 84 | ||
| 85 | extern int ns_get_name(char *buf, size_t size, struct task_struct *task, | 85 | extern int ns_get_name(char *buf, size_t size, struct task_struct *task, |