diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2026-02-21 20:03:00 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2026-02-21 20:03:00 -0800 |
| commit | 32a92f8c89326985e05dce8b22d3f0aa07a3e1bd (patch) | |
| tree | 65f84985b9ed2d5cf3c5243aca78d9428e25c312 /drivers/edac | |
| parent | 323bbfcf1ef8836d0d2ad9e2c1f1c684f0e3b5b3 (diff) | |
Convert more 'alloc_obj' cases to default GFP_KERNEL argumentsHEADtorvalds/mastertorvalds/HEADmaster
This converts some of the visually simpler cases that have been split
over multiple lines. I only did the ones that are easy to verify the
resulting diff by having just that final GFP_KERNEL argument on the next
line.
Somebody should probably do a proper coccinelle script for this, but for
me the trivial script actually resulted in an assertion failure in the
middle of the script. I probably had made it a bit _too_ trivial.
So after fighting that far a while I decided to just do some of the
syntactically simpler cases with variations of the previous 'sed'
scripts.
The more syntactically complex multi-line cases would mostly really want
whitespace cleanup anyway.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/edac')
| -rw-r--r-- | drivers/edac/edac_device.c | 9 | ||||
| -rw-r--r-- | drivers/edac/edac_mc.c | 3 | ||||
| -rw-r--r-- | drivers/edac/i7core_edac.c | 6 |
3 files changed, 6 insertions, 12 deletions
diff --git a/drivers/edac/edac_device.c b/drivers/edac/edac_device.c index 4ff421b518ce..0c5ad5a55453 100644 --- a/drivers/edac/edac_device.c +++ b/drivers/edac/edac_device.c @@ -71,8 +71,7 @@ edac_device_alloc_ctl_info(unsigned pvt_sz, char *dev_name, unsigned nr_instance if (!dev_ctl) return NULL; - dev_inst = kzalloc_objs(struct edac_device_instance, nr_instances, - GFP_KERNEL); + dev_inst = kzalloc_objs(struct edac_device_instance, nr_instances); if (!dev_inst) goto free; @@ -648,8 +647,7 @@ int edac_dev_register(struct device *parent, char *name, if (!ctx) return -ENOMEM; - ras_attr_groups = kzalloc_objs(*ras_attr_groups, attr_gcnt + 1, - GFP_KERNEL); + ras_attr_groups = kzalloc_objs(*ras_attr_groups, attr_gcnt + 1); if (!ras_attr_groups) goto ctx_free; @@ -660,8 +658,7 @@ int edac_dev_register(struct device *parent, char *name, } if (mem_repair_cnt) { - ctx->mem_repair = kzalloc_objs(*ctx->mem_repair, mem_repair_cnt, - GFP_KERNEL); + ctx->mem_repair = kzalloc_objs(*ctx->mem_repair, mem_repair_cnt); if (!ctx->mem_repair) goto data_mem_free; } diff --git a/drivers/edac/edac_mc.c b/drivers/edac/edac_mc.c index 47bd26f5086a..29e9828422bb 100644 --- a/drivers/edac/edac_mc.c +++ b/drivers/edac/edac_mc.c @@ -231,8 +231,7 @@ static int edac_mc_alloc_csrows(struct mem_ctl_info *mci) csr->csrow_idx = row; csr->mci = mci; csr->nr_channels = tot_channels; - csr->channels = kzalloc_objs(*csr->channels, tot_channels, - GFP_KERNEL); + csr->channels = kzalloc_objs(*csr->channels, tot_channels); if (!csr->channels) return -ENOMEM; diff --git a/drivers/edac/i7core_edac.c b/drivers/edac/i7core_edac.c index 5a8cd90b39a7..0f783173d0ec 100644 --- a/drivers/edac/i7core_edac.c +++ b/drivers/edac/i7core_edac.c @@ -459,8 +459,7 @@ static struct i7core_dev *alloc_i7core_dev(u8 socket, if (!i7core_dev) return NULL; - i7core_dev->pdev = kzalloc_objs(*i7core_dev->pdev, table->n_devs, - GFP_KERNEL); + i7core_dev->pdev = kzalloc_objs(*i7core_dev->pdev, table->n_devs); if (!i7core_dev->pdev) { kfree(i7core_dev); return NULL; @@ -1177,8 +1176,7 @@ static int i7core_create_sysfs_devices(struct mem_ctl_info *mci) goto err_put_addrmatch; if (!pvt->is_registered) { - pvt->chancounts_dev = kzalloc_obj(*pvt->chancounts_dev, - GFP_KERNEL); + pvt->chancounts_dev = kzalloc_obj(*pvt->chancounts_dev); if (!pvt->chancounts_dev) { rc = -ENOMEM; goto err_del_addrmatch; |
