History

Convert 'alloc_obj' family to use the new default GFP_KERNEL argument

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.

Linus Torvalds committed 8 months ago

Commit bf4afc51 parent e19e1b46673 files · +13013 −13013Browse files

Showing the changes to kernel/livepatch (2 of 6673 files). Show all

Unified · Split

2 files
  1. kernel/livepatch/core.c +2 −2
  2. kernel/livepatch/patch.c +1 −1
kernel/livepatch/core.c+2−2
@@ -525,7 +525,7 @@ static struct klp_object *klp_alloc_object_dynamic(const char *name, · 524 unmodified lines
525{525{
526 struct klp_object *obj;526 struct klp_object *obj;
527 527
528 obj = kzalloc_obj(*obj, GFP_KERNEL);528 obj = kzalloc_obj(*obj);
529 if (!obj)529 if (!obj)
530 return NULL;530 return NULL;
531 531
@@ -554,7 +554,7 @@ static struct klp_func *klp_alloc_func_nop(struct klp_func *old_func, · 22 unmodified lines
554{554{
555 struct klp_func *func;555 struct klp_func *func;
556 556
557 func = kzalloc_obj(*func, GFP_KERNEL);557 func = kzalloc_obj(*func);
558 if (!func)558 if (!func)
559 return NULL;559 return NULL;
560 560
kernel/livepatch/patch.c+1−1
@@ -179,7 +179,7 @@ static int klp_patch_func(struct klp_func *func) · 178 unmodified lines
179 return -EINVAL;179 return -EINVAL;
180 }180 }
181 181
182 ops = kzalloc_obj(*ops, GFP_KERNEL);182 ops = kzalloc_obj(*ops);
183 if (!ops)183 if (!ops)
184 return -ENOMEM;184 return -ENOMEM;
185 185