Commit 8fc3dc5a3a17aa2b353886422bd89420619af211
1 parent
54bf586e1f
Exists in
master
and in
20 other branches
__register_binfmt() made void
Just don't pass NULL to it - nobody does, anyway. Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Showing 12 changed files with 27 additions and 23 deletions Side-by-side Diff
arch/alpha/kernel/binfmt_loader.c
arch/x86/ia32/ia32_aout.c
fs/binfmt_aout.c
fs/binfmt_elf.c
fs/binfmt_elf_fdpic.c
fs/binfmt_em86.c
fs/binfmt_flat.c
fs/binfmt_misc.c
... | ... | @@ -726,11 +726,8 @@ |
726 | 726 | static int __init init_misc_binfmt(void) |
727 | 727 | { |
728 | 728 | int err = register_filesystem(&bm_fs_type); |
729 | - if (!err) { | |
730 | - err = insert_binfmt(&misc_format); | |
731 | - if (err) | |
732 | - unregister_filesystem(&bm_fs_type); | |
733 | - } | |
729 | + if (!err) | |
730 | + insert_binfmt(&misc_format); | |
734 | 731 | return err; |
735 | 732 | } |
736 | 733 |
fs/binfmt_script.c
fs/binfmt_som.c
fs/exec.c
... | ... | @@ -79,15 +79,13 @@ |
79 | 79 | static LIST_HEAD(formats); |
80 | 80 | static DEFINE_RWLOCK(binfmt_lock); |
81 | 81 | |
82 | -int __register_binfmt(struct linux_binfmt * fmt, int insert) | |
82 | +void __register_binfmt(struct linux_binfmt * fmt, int insert) | |
83 | 83 | { |
84 | - if (!fmt) | |
85 | - return -EINVAL; | |
84 | + BUG_ON(!fmt); | |
86 | 85 | write_lock(&binfmt_lock); |
87 | 86 | insert ? list_add(&fmt->lh, &formats) : |
88 | 87 | list_add_tail(&fmt->lh, &formats); |
89 | 88 | write_unlock(&binfmt_lock); |
90 | - return 0; | |
91 | 89 | } |
92 | 90 | |
93 | 91 | EXPORT_SYMBOL(__register_binfmt); |
include/linux/binfmts.h
... | ... | @@ -92,17 +92,17 @@ |
92 | 92 | unsigned long min_coredump; /* minimal dump size */ |
93 | 93 | }; |
94 | 94 | |
95 | -extern int __register_binfmt(struct linux_binfmt *fmt, int insert); | |
95 | +extern void __register_binfmt(struct linux_binfmt *fmt, int insert); | |
96 | 96 | |
97 | 97 | /* Registration of default binfmt handlers */ |
98 | -static inline int register_binfmt(struct linux_binfmt *fmt) | |
98 | +static inline void register_binfmt(struct linux_binfmt *fmt) | |
99 | 99 | { |
100 | - return __register_binfmt(fmt, 0); | |
100 | + __register_binfmt(fmt, 0); | |
101 | 101 | } |
102 | 102 | /* Same as above, but adds a new binfmt at the top of the list */ |
103 | -static inline int insert_binfmt(struct linux_binfmt *fmt) | |
103 | +static inline void insert_binfmt(struct linux_binfmt *fmt) | |
104 | 104 | { |
105 | - return __register_binfmt(fmt, 1); | |
105 | + __register_binfmt(fmt, 1); | |
106 | 106 | } |
107 | 107 | |
108 | 108 | extern void unregister_binfmt(struct linux_binfmt *); |