Commit 8fc3dc5a3a17aa2b353886422bd89420619af211

Authored by Al Viro
1 parent 54bf586e1f

__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
... ... @@ -46,7 +46,8 @@
46 46  
47 47 static int __init init_loader_binfmt(void)
48 48 {
49   - return insert_binfmt(&loader_format);
  49 + insert_binfmt(&loader_format);
  50 + return 0;
50 51 }
51 52 arch_initcall(init_loader_binfmt);
arch/x86/ia32/ia32_aout.c
... ... @@ -519,7 +519,8 @@
519 519  
520 520 static int __init init_aout_binfmt(void)
521 521 {
522   - return register_binfmt(&aout_format);
  522 + register_binfmt(&aout_format);
  523 + return 0;
523 524 }
524 525  
525 526 static void __exit exit_aout_binfmt(void)
... ... @@ -454,7 +454,8 @@
454 454  
455 455 static int __init init_aout_binfmt(void)
456 456 {
457   - return register_binfmt(&aout_format);
  457 + register_binfmt(&aout_format);
  458 + return 0;
458 459 }
459 460  
460 461 static void __exit exit_aout_binfmt(void)
... ... @@ -2077,7 +2077,8 @@
2077 2077  
2078 2078 static int __init init_elf_binfmt(void)
2079 2079 {
2080   - return register_binfmt(&elf_format);
  2080 + register_binfmt(&elf_format);
  2081 + return 0;
2081 2082 }
2082 2083  
2083 2084 static void __exit exit_elf_binfmt(void)
fs/binfmt_elf_fdpic.c
... ... @@ -91,7 +91,8 @@
91 91  
92 92 static int __init init_elf_fdpic_binfmt(void)
93 93 {
94   - return register_binfmt(&elf_fdpic_format);
  94 + register_binfmt(&elf_fdpic_format);
  95 + return 0;
95 96 }
96 97  
97 98 static void __exit exit_elf_fdpic_binfmt(void)
... ... @@ -100,7 +100,8 @@
100 100  
101 101 static int __init init_em86_binfmt(void)
102 102 {
103   - return register_binfmt(&em86_format);
  103 + register_binfmt(&em86_format);
  104 + return 0;
104 105 }
105 106  
106 107 static void __exit exit_em86_binfmt(void)
... ... @@ -950,7 +950,8 @@
950 950  
951 951 static int __init init_flat_binfmt(void)
952 952 {
953   - return register_binfmt(&flat_format);
  953 + register_binfmt(&flat_format);
  954 + return 0;
954 955 }
955 956  
956 957 /****************************************************************************/
... ... @@ -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  
... ... @@ -105,7 +105,8 @@
105 105  
106 106 static int __init init_script_binfmt(void)
107 107 {
108   - return register_binfmt(&script_format);
  108 + register_binfmt(&script_format);
  109 + return 0;
109 110 }
110 111  
111 112 static void __exit exit_script_binfmt(void)
... ... @@ -289,7 +289,8 @@
289 289  
290 290 static int __init init_som_binfmt(void)
291 291 {
292   - return register_binfmt(&som_format);
  292 + register_binfmt(&som_format);
  293 + return 0;
293 294 }
294 295  
295 296 static void __exit exit_som_binfmt(void)
... ... @@ -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 *);