This was done entirely with mindless brute force, using git grep -l '\<k[vmz]*alloc_objs*(.*, GFP_KERNEL)' | xargs sed -i 's/\(alloc_objs*(.*\), GFP_KERNEL)/\1)/' to convert the new alloc_obj() users that had a simple GFP_KERNEL argument to just drop that argument. Note that due to the extreme simplicity of the scripting, any slightly more complex cases spread over multiple lines would not be triggered: they definitely exist, but this covers the vast bulk of the cases, and the resulting diff is also then easier to check automatically. For the same reason the 'flex' versions will be done as a separate conversion.
Showing the changes to kernel/module (5 of 6673 files). Show all
Unified · Split
| @@ -125,7 +125,7 @@ bool kmod_dup_request_exists_wait(char *module_name, bool wait, int *dup_ret) · 124 unmodified lines | ||
| 125 | 125 | * Pre-allocate the entry in case we have to use it later |
| 126 | 126 | * to avoid contention with the mutex. |
| 127 | 127 | */ |
| 128 | − new_kmod_req = kzalloc_obj(*new_kmod_req, GFP_KERNEL); | |
| 128 | + new_kmod_req = kzalloc_obj(*new_kmod_req); | |
| 129 | 129 | if (!new_kmod_req) |
| 130 | 130 | return false; |
| 131 | 131 | |
| @@ -3024,7 +3024,7 @@ static noinline int do_init_module(struct module *mod) · 3023 unmodified lines | ||
| 3024 | 3024 | } |
| 3025 | 3025 | #endif |
| 3026 | 3026 | |
| 3027 | − freeinit = kmalloc_obj(*freeinit, GFP_KERNEL); | |
| 3027 | + freeinit = kmalloc_obj(*freeinit); | |
| 3028 | 3028 | if (!freeinit) { |
| 3029 | 3029 | ret = -ENOMEM; |
| 3030 | 3030 | goto fail; |
| @@ -250,7 +250,7 @@ int try_add_failed_module(const char *name, enum fail_dup_mod_reason reason) · 249 unmodified lines | ||
| 250 | 250 | } |
| 251 | 251 | } |
| 252 | 252 | |
| 253 | − mod_fail = kzalloc_obj(*mod_fail, GFP_KERNEL); | |
| 253 | + mod_fail = kzalloc_obj(*mod_fail); | |
| 254 | 254 | if (!mod_fail) |
| 255 | 255 | return -ENOMEM; |
| 256 | 256 | memcpy(mod_fail->name, name, strlen(name)); |
| @@ -78,7 +78,7 @@ static int add_sect_attrs(struct module *mod, const struct load_info *info) · 77 unmodified lines | ||
| 78 | 78 | if (!sect_attrs) |
| 79 | 79 | return -ENOMEM; |
| 80 | 80 | |
| 81 | − gattr = kzalloc_objs(*gattr, nloaded + 1, GFP_KERNEL); | |
| 81 | + gattr = kzalloc_objs(*gattr, nloaded + 1); | |
| 82 | 82 | if (!gattr) { |
| 83 | 83 | kfree(sect_attrs); |
| 84 | 84 | return -ENOMEM; |
| @@ -170,7 +170,7 @@ static int add_notes_attrs(struct module *mod, const struct load_info *info) · 85 unmodified lines | ||
| 170 | 170 | if (!notes_attrs) |
| 171 | 171 | return -ENOMEM; |
| 172 | 172 | |
| 173 | − gattr = kzalloc_objs(*gattr, notes + 1, GFP_KERNEL); | |
| 173 | + gattr = kzalloc_objs(*gattr, notes + 1); | |
| 174 | 174 | if (!gattr) { |
| 175 | 175 | kfree(notes_attrs); |
| 176 | 176 | return -ENOMEM; |
| @@ -33,7 +33,7 @@ int try_add_tainted_module(struct module *mod) · 32 unmodified lines | ||
| 33 | 33 | } |
| 34 | 34 | } |
| 35 | 35 | |
| 36 | − mod_taint = kmalloc_obj(*mod_taint, GFP_KERNEL); | |
| 36 | + mod_taint = kmalloc_obj(*mod_taint); | |
| 37 | 37 | if (unlikely(!mod_taint)) |
| 38 | 38 | return -ENOMEM; |
| 39 | 39 | strscpy(mod_taint->name, mod->name, MODULE_NAME_LEN); |