mirror of
https://github.com/linux-msm/laptops-kernel.git
synced 2026-08-13 14:19:53 -07:00
Convert 'alloc_flex' family to use the new default GFP_KERNEL argument
This is the exact same thing as the 'alloc_obj()' version, only much smaller because there are a lot fewer users of the *alloc_flex() interface. As with alloc_obj() version, this was done entirely with mindless brute force, using the same script, except using 'flex' in the pattern rather than 'objs*'. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
@@ -54,7 +54,7 @@ static int __init init_atags_procfs(void)
|
||||
|
||||
WARN_ON(tag->hdr.tag != ATAG_NONE);
|
||||
|
||||
b = kmalloc_flex(*b, data, size, GFP_KERNEL);
|
||||
b = kmalloc_flex(*b, data, size);
|
||||
if (!b)
|
||||
goto nomem;
|
||||
|
||||
|
||||
@@ -52,7 +52,7 @@ static int prepare_elf_headers(void **addr, unsigned long *sz)
|
||||
for_each_mem_range(i, &start, &end)
|
||||
nr_ranges++;
|
||||
|
||||
cmem = kmalloc_flex(*cmem, ranges, nr_ranges, GFP_KERNEL);
|
||||
cmem = kmalloc_flex(*cmem, ranges, nr_ranges);
|
||||
if (!cmem)
|
||||
return -ENOMEM;
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ static int prepare_elf_headers(void **addr, unsigned long *sz)
|
||||
for_each_mem_range(i, &start, &end)
|
||||
nr_ranges++;
|
||||
|
||||
cmem = kmalloc_flex(*cmem, ranges, nr_ranges, GFP_KERNEL);
|
||||
cmem = kmalloc_flex(*cmem, ranges, nr_ranges);
|
||||
if (!cmem)
|
||||
return -ENOMEM;
|
||||
|
||||
|
||||
@@ -344,7 +344,7 @@ static int ps3_setup_storage_dev(const struct ps3_repository_device *repo,
|
||||
repo->dev_index, repo->dev_type, port, blk_size, num_blocks,
|
||||
num_regions);
|
||||
|
||||
p = kzalloc_flex(*p, regions, num_regions, GFP_KERNEL);
|
||||
p = kzalloc_flex(*p, regions, num_regions);
|
||||
if (!p) {
|
||||
result = -ENOMEM;
|
||||
goto fail_malloc;
|
||||
|
||||
@@ -64,7 +64,7 @@ static int prepare_elf_headers(void **addr, unsigned long *sz)
|
||||
nr_ranges = 1; /* For exclusion of crashkernel region */
|
||||
walk_system_ram_res(0, -1, &nr_ranges, get_nr_ram_ranges_callback);
|
||||
|
||||
cmem = kmalloc_flex(*cmem, ranges, nr_ranges, GFP_KERNEL);
|
||||
cmem = kmalloc_flex(*cmem, ranges, nr_ranges);
|
||||
if (!cmem)
|
||||
return -ENOMEM;
|
||||
|
||||
|
||||
@@ -1016,7 +1016,7 @@ static int __init uncore_type_init(struct intel_uncore_type *type)
|
||||
} *attr_group;
|
||||
for (i = 0; type->event_descs[i].attr.attr.name; i++);
|
||||
|
||||
attr_group = kzalloc_flex(*attr_group, attrs, i + 1, GFP_KERNEL);
|
||||
attr_group = kzalloc_flex(*attr_group, attrs, i + 1);
|
||||
if (!attr_group)
|
||||
goto err;
|
||||
|
||||
|
||||
@@ -742,7 +742,7 @@ static int __init init_rapl_pmus(struct rapl_pmus **rapl_pmus_ptr, int rapl_pmu_
|
||||
else if (rapl_pmu_scope != PERF_PMU_SCOPE_PKG)
|
||||
return -EINVAL;
|
||||
|
||||
rapl_pmus = kzalloc_flex(*rapl_pmus, rapl_pmu, nr_rapl_pmu, GFP_KERNEL);
|
||||
rapl_pmus = kzalloc_flex(*rapl_pmus, rapl_pmu, nr_rapl_pmu);
|
||||
if (!rapl_pmus)
|
||||
return -ENOMEM;
|
||||
|
||||
|
||||
@@ -338,7 +338,7 @@ static __init int dev_mcelog_init_device(void)
|
||||
int err;
|
||||
|
||||
mce_log_len = max(MCE_LOG_MIN_LEN, num_online_cpus());
|
||||
mcelog = kzalloc_flex(*mcelog, entry, mce_log_len, GFP_KERNEL);
|
||||
mcelog = kzalloc_flex(*mcelog, entry, mce_log_len);
|
||||
if (!mcelog)
|
||||
return -ENOMEM;
|
||||
|
||||
|
||||
+1
-1
@@ -40,7 +40,7 @@ static void *deflate_alloc_stream(void)
|
||||
DEFLATE_DEF_MEMLEVEL));
|
||||
struct deflate_stream *ctx;
|
||||
|
||||
ctx = kvmalloc_flex(*ctx, workspace, size, GFP_KERNEL);
|
||||
ctx = kvmalloc_flex(*ctx, workspace, size);
|
||||
if (!ctx)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
|
||||
+1
-1
@@ -44,7 +44,7 @@ static void *zstd_alloc_stream(void)
|
||||
if (!wksp_size)
|
||||
return ERR_PTR(-EINVAL);
|
||||
|
||||
ctx = kvmalloc_flex(*ctx, wksp, wksp_size, GFP_KERNEL);
|
||||
ctx = kvmalloc_flex(*ctx, wksp, wksp_size);
|
||||
if (!ctx)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
|
||||
@@ -350,7 +350,7 @@ int aie2_error_async_events_alloc(struct amdxdna_dev_hdl *ndev)
|
||||
struct async_events *events;
|
||||
int i, ret;
|
||||
|
||||
events = kzalloc_flex(*events, event, total_col, GFP_KERNEL);
|
||||
events = kzalloc_flex(*events, event, total_col);
|
||||
if (!events)
|
||||
return -ENOMEM;
|
||||
|
||||
|
||||
@@ -266,7 +266,7 @@ static struct solver_node *create_solver_node(struct solver_state *xrs,
|
||||
struct solver_node *node;
|
||||
int ret;
|
||||
|
||||
node = kzalloc_flex(*node, start_cols, cdop->cols_len, GFP_KERNEL);
|
||||
node = kzalloc_flex(*node, start_cols, cdop->cols_len);
|
||||
if (!node)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
|
||||
@@ -436,7 +436,7 @@ int amdxdna_cmd_submit(struct amdxdna_client *client,
|
||||
int ret, idx;
|
||||
|
||||
XDNA_DBG(xdna, "Command BO hdl %d, Arg BO count %d", cmd_bo_hdl, arg_bo_cnt);
|
||||
job = kzalloc_flex(*job, bos, arg_bo_cnt, GFP_KERNEL);
|
||||
job = kzalloc_flex(*job, bos, arg_bo_cnt);
|
||||
if (!job)
|
||||
return -ENOMEM;
|
||||
|
||||
|
||||
@@ -525,7 +525,7 @@ ivpu_job_create(struct ivpu_file_priv *file_priv, u32 engine_idx, u32 bo_count)
|
||||
struct ivpu_device *vdev = file_priv->vdev;
|
||||
struct ivpu_job *job;
|
||||
|
||||
job = kzalloc_flex(*job, bos, bo_count, GFP_KERNEL);
|
||||
job = kzalloc_flex(*job, bos, bo_count);
|
||||
if (!job)
|
||||
return NULL;
|
||||
|
||||
|
||||
@@ -2832,7 +2832,7 @@ static void ata_dev_config_cpr(struct ata_device *dev)
|
||||
if (!nr_cpr)
|
||||
goto out;
|
||||
|
||||
cpr_log = kzalloc_flex(*cpr_log, cpr, nr_cpr, GFP_KERNEL);
|
||||
cpr_log = kzalloc_flex(*cpr_log, cpr, nr_cpr);
|
||||
if (!cpr_log)
|
||||
goto out;
|
||||
|
||||
|
||||
@@ -4613,7 +4613,7 @@ static int ublk_ctrl_add_dev(const struct ublksrv_ctrl_cmd *header)
|
||||
goto out_unlock;
|
||||
|
||||
ret = -ENOMEM;
|
||||
ub = kzalloc_flex(*ub, queues, info.nr_hw_queues, GFP_KERNEL);
|
||||
ub = kzalloc_flex(*ub, queues, info.nr_hw_queues);
|
||||
if (!ub)
|
||||
goto out_unlock;
|
||||
mutex_init(&ub->mutex);
|
||||
|
||||
@@ -997,7 +997,7 @@ static int zloop_ctl_add(struct zloop_options *opts)
|
||||
goto out;
|
||||
}
|
||||
|
||||
zlo = kvzalloc_flex(*zlo, zones, nr_zones, GFP_KERNEL);
|
||||
zlo = kvzalloc_flex(*zlo, zones, nr_zones);
|
||||
if (!zlo) {
|
||||
ret = -ENOMEM;
|
||||
goto out;
|
||||
|
||||
@@ -284,7 +284,7 @@ static struct regmap *vexpress_syscfg_regmap_init(struct device *dev,
|
||||
val = energy_quirk;
|
||||
}
|
||||
|
||||
func = kzalloc_flex(*func, template, num, GFP_KERNEL);
|
||||
func = kzalloc_flex(*func, template, num);
|
||||
if (!func)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
|
||||
+1
-1
@@ -823,7 +823,7 @@ int hpet_alloc(struct hpet_data *hdp)
|
||||
return 0;
|
||||
}
|
||||
|
||||
hpetp = kzalloc_flex(*hpetp, hp_dev, hdp->hd_nirqs, GFP_KERNEL);
|
||||
hpetp = kzalloc_flex(*hpetp, hp_dev, hdp->hd_nirqs);
|
||||
|
||||
if (!hpetp)
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -412,7 +412,7 @@ static struct port_buffer *alloc_buf(struct virtio_device *vdev, size_t buf_size
|
||||
* Allocate buffer and the sg list. The sg list array is allocated
|
||||
* directly after the port_buffer struct.
|
||||
*/
|
||||
buf = kmalloc_flex(*buf, sg, pages, GFP_KERNEL);
|
||||
buf = kmalloc_flex(*buf, sg, pages);
|
||||
if (!buf)
|
||||
goto fail;
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user