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/workqueue.c (1 of 6673 files). Show all

Unified · Split

kernel/workqueue.c+8−8
@@ -4714,7 +4714,7 @@ struct workqueue_attrs *alloc_workqueue_attrs_noprof(void) · 4713 unmodified lines
4714{4714{
4715 struct workqueue_attrs *attrs;4715 struct workqueue_attrs *attrs;
4716 4716
4717 attrs = kzalloc_obj(*attrs, GFP_KERNEL);4717 attrs = kzalloc_obj(*attrs);
4718 if (!attrs)4718 if (!attrs)
4719 goto fail;4719 goto fail;
4720 if (!alloc_cpumask_var(&attrs->cpumask, GFP_KERNEL))4720 if (!alloc_cpumask_var(&attrs->cpumask, GFP_KERNEL))
@@ -7486,7 +7486,7 @@ int workqueue_sysfs_register(struct workqueue_struct *wq) · 2765 unmodified lines
7486 if (WARN_ON(wq->flags & __WQ_ORDERED))7486 if (WARN_ON(wq->flags & __WQ_ORDERED))
7487 return -EINVAL;7487 return -EINVAL;
7488 7488
7489 wq->wq_dev = wq_dev = kzalloc_obj(*wq_dev, GFP_KERNEL);7489 wq->wq_dev = wq_dev = kzalloc_obj(*wq_dev);
7490 if (!wq_dev)7490 if (!wq_dev)
7491 return -ENOMEM;7491 return -ENOMEM;
7492 7492
@@ -7879,9 +7879,9 @@ void __init workqueue_init_early(void) · 386 unmodified lines
7879 wq_power_efficient = true;7879 wq_power_efficient = true;
7880 7880
7881 /* initialize WQ_AFFN_SYSTEM pods */7881 /* initialize WQ_AFFN_SYSTEM pods */
7882 pt->pod_cpus = kzalloc_objs(pt->pod_cpus[0], 1, GFP_KERNEL);7882 pt->pod_cpus = kzalloc_objs(pt->pod_cpus[0], 1);
7883 pt->pod_node = kzalloc_objs(pt->pod_node[0], 1, GFP_KERNEL);7883 pt->pod_node = kzalloc_objs(pt->pod_node[0], 1);
7884 pt->cpu_pod = kzalloc_objs(pt->cpu_pod[0], nr_cpu_ids, GFP_KERNEL);7884 pt->cpu_pod = kzalloc_objs(pt->cpu_pod[0], nr_cpu_ids);
7885 BUG_ON(!pt->pod_cpus || !pt->pod_node || !pt->cpu_pod);7885 BUG_ON(!pt->pod_cpus || !pt->pod_node || !pt->cpu_pod);
7886 7886
7887 BUG_ON(!zalloc_cpumask_var_node(&pt->pod_cpus[0], GFP_KERNEL, NUMA_NO_NODE));7887 BUG_ON(!zalloc_cpumask_var_node(&pt->pod_cpus[0], GFP_KERNEL, NUMA_NO_NODE));
@@ -8063,7 +8063,7 @@ static void __init init_pod_type(struct wq_pod_type *pt, · 175 unmodified lines
8063 pt->nr_pods = 0;8063 pt->nr_pods = 0;
8064 8064
8065 /* init @pt->cpu_pod[] according to @cpus_share_pod() */8065 /* init @pt->cpu_pod[] according to @cpus_share_pod() */
8066 pt->cpu_pod = kzalloc_objs(pt->cpu_pod[0], nr_cpu_ids, GFP_KERNEL);8066 pt->cpu_pod = kzalloc_objs(pt->cpu_pod[0], nr_cpu_ids);
8067 BUG_ON(!pt->cpu_pod);8067 BUG_ON(!pt->cpu_pod);
8068 8068
8069 for_each_possible_cpu(cur) {8069 for_each_possible_cpu(cur) {
@@ -8080,8 +8080,8 @@ static void __init init_pod_type(struct wq_pod_type *pt, · 10 unmodified lines
8080 }8080 }
8081 8081
8082 /* init the rest to match @pt->cpu_pod[] */8082 /* init the rest to match @pt->cpu_pod[] */
8083 pt->pod_cpus = kzalloc_objs(pt->pod_cpus[0], pt->nr_pods, GFP_KERNEL);8083 pt->pod_cpus = kzalloc_objs(pt->pod_cpus[0], pt->nr_pods);
8084 pt->pod_node = kzalloc_objs(pt->pod_node[0], pt->nr_pods, GFP_KERNEL);8084 pt->pod_node = kzalloc_objs(pt->pod_node[0], pt->nr_pods);
8085 BUG_ON(!pt->pod_cpus || !pt->pod_node);8085 BUG_ON(!pt->pod_cpus || !pt->pod_node);
8086 8086
8087 for (pod = 0; pod < pt->nr_pods; pod++)8087 for (pod = 0; pod < pt->nr_pods; pod++)