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/staging | |
| parent | 323bbfcf1ef8836d0d2ad9e2c1f1c684f0e3b5b3 (diff) | |
| download | lwn-32a92f8c89326985e05dce8b22d3f0aa07a3e1bd.tar.gz lwn-32a92f8c89326985e05dce8b22d3f0aa07a3e1bd.zip | |
Convert more 'alloc_obj' cases to default GFP_KERNEL arguments
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/staging')
| -rw-r--r-- | drivers/staging/greybus/light.c | 9 | ||||
| -rw-r--r-- | drivers/staging/greybus/power_supply.c | 3 | ||||
| -rw-r--r-- | drivers/staging/media/atomisp/pci/atomisp_ioctl.c | 9 | ||||
| -rw-r--r-- | drivers/staging/media/atomisp/pci/sh_css.c | 6 | ||||
| -rw-r--r-- | drivers/staging/media/atomisp/pci/sh_css_firmware.c | 3 | ||||
| -rw-r--r-- | drivers/staging/media/atomisp/pci/sh_css_params.c | 3 | ||||
| -rw-r--r-- | drivers/staging/vme_user/vme_tsi148.c | 3 |
7 files changed, 12 insertions, 24 deletions
diff --git a/drivers/staging/greybus/light.c b/drivers/staging/greybus/light.c index aa93af873d63..cab02b5da867 100644 --- a/drivers/staging/greybus/light.c +++ b/drivers/staging/greybus/light.c @@ -275,8 +275,7 @@ static int channel_attr_groups_set(struct gb_channel *channel, channel->attr_group = kzalloc_obj(*channel->attr_group); if (!channel->attr_group) return -ENOMEM; - channel->attr_groups = kzalloc_objs(*channel->attr_groups, 2, - GFP_KERNEL); + channel->attr_groups = kzalloc_objs(*channel->attr_groups, 2); if (!channel->attr_groups) return -ENOMEM; @@ -1011,8 +1010,7 @@ static int gb_lights_light_config(struct gb_lights *glights, u8 id) light->name = kstrndup(conf.name, NAMES_MAX, GFP_KERNEL); if (!light->name) return -ENOMEM; - light->channels = kzalloc_objs(struct gb_channel, conf.channel_count, - GFP_KERNEL); + light->channels = kzalloc_objs(struct gb_channel, conf.channel_count); if (!light->channels) return -ENOMEM; /* @@ -1153,8 +1151,7 @@ static int gb_lights_create_all(struct gb_lights *glights) if (ret < 0) goto out; - glights->lights = kzalloc_objs(struct gb_light, glights->lights_count, - GFP_KERNEL); + glights->lights = kzalloc_objs(struct gb_light, glights->lights_count); if (!glights->lights) { ret = -ENOMEM; goto out; diff --git a/drivers/staging/greybus/power_supply.c b/drivers/staging/greybus/power_supply.c index c51efeaee707..5d180b0f8e4c 100644 --- a/drivers/staging/greybus/power_supply.c +++ b/drivers/staging/greybus/power_supply.c @@ -545,8 +545,7 @@ static int gb_power_supply_prop_descriptors_get(struct gb_power_supply *gbpsy) } } - gbpsy->props = kzalloc_objs(*gbpsy->props, gbpsy->properties_count, - GFP_KERNEL); + gbpsy->props = kzalloc_objs(*gbpsy->props, gbpsy->properties_count); if (!gbpsy->props) { ret = -ENOMEM; goto out_put_operation; diff --git a/drivers/staging/media/atomisp/pci/atomisp_ioctl.c b/drivers/staging/media/atomisp/pci/atomisp_ioctl.c index a19dc99922ad..a7f22de1c889 100644 --- a/drivers/staging/media/atomisp/pci/atomisp_ioctl.c +++ b/drivers/staging/media/atomisp/pci/atomisp_ioctl.c @@ -696,8 +696,7 @@ int atomisp_alloc_css_stat_bufs(struct atomisp_sub_device *asd, ATOMISP_S3A_BUF_QUEUE_DEPTH_FOR_HAL; dev_dbg(isp->dev, "allocating %d 3a buffers\n", count); while (count--) { - s3a_buf = kzalloc_obj(struct atomisp_s3a_buf, - GFP_KERNEL); + s3a_buf = kzalloc_obj(struct atomisp_s3a_buf); if (!s3a_buf) goto error; @@ -716,8 +715,7 @@ int atomisp_alloc_css_stat_bufs(struct atomisp_sub_device *asd, count = ATOMISP_CSS_Q_DEPTH + 1; dev_dbg(isp->dev, "allocating %d dis buffers\n", count); while (count--) { - dis_buf = kzalloc_obj(struct atomisp_dis_buf, - GFP_KERNEL); + dis_buf = kzalloc_obj(struct atomisp_dis_buf); if (!dis_buf) goto error; if (atomisp_css_allocate_stat_buffers( @@ -739,8 +737,7 @@ int atomisp_alloc_css_stat_bufs(struct atomisp_sub_device *asd, dev_dbg(isp->dev, "allocating %d metadata buffers for type %d\n", count, i); while (count--) { - md_buf = kzalloc_obj(struct atomisp_metadata_buf, - GFP_KERNEL); + md_buf = kzalloc_obj(struct atomisp_metadata_buf); if (!md_buf) goto error; diff --git a/drivers/staging/media/atomisp/pci/sh_css.c b/drivers/staging/media/atomisp/pci/sh_css.c index 78ea854d903d..ee7ea04c4fc5 100644 --- a/drivers/staging/media/atomisp/pci/sh_css.c +++ b/drivers/staging/media/atomisp/pci/sh_css.c @@ -6252,8 +6252,7 @@ load_yuvpp_binaries(struct ia_css_pipe *pipe) mycs->num_vf_pp = 1; } - mycs->vf_pp_binary = kzalloc_objs(struct ia_css_binary, mycs->num_vf_pp, - GFP_KERNEL); + mycs->vf_pp_binary = kzalloc_objs(struct ia_css_binary, mycs->num_vf_pp); if (!mycs->vf_pp_binary) { err = -ENOMEM; goto ERR; @@ -7921,8 +7920,7 @@ ia_css_stream_create(const struct ia_css_stream_config *stream_config, /* allocate pipes */ curr_stream->num_pipes = num_pipes; - curr_stream->pipes = kzalloc_objs(struct ia_css_pipe *, num_pipes, - GFP_KERNEL); + curr_stream->pipes = kzalloc_objs(struct ia_css_pipe *, num_pipes); if (!curr_stream->pipes) { curr_stream->num_pipes = 0; kfree(curr_stream); diff --git a/drivers/staging/media/atomisp/pci/sh_css_firmware.c b/drivers/staging/media/atomisp/pci/sh_css_firmware.c index a2a8a46c628b..57ecf5549c23 100644 --- a/drivers/staging/media/atomisp/pci/sh_css_firmware.c +++ b/drivers/staging/media/atomisp/pci/sh_css_firmware.c @@ -262,8 +262,7 @@ sh_css_load_firmware(struct device *dev, const char *fw_data, sh_css_blob_info = NULL; } - fw_minibuffer = kzalloc_objs(struct fw_param, sh_css_num_binaries, - GFP_KERNEL); + fw_minibuffer = kzalloc_objs(struct fw_param, sh_css_num_binaries); if (!fw_minibuffer) return -ENOMEM; diff --git a/drivers/staging/media/atomisp/pci/sh_css_params.c b/drivers/staging/media/atomisp/pci/sh_css_params.c index 424876311da5..fcebace11daf 100644 --- a/drivers/staging/media/atomisp/pci/sh_css_params.c +++ b/drivers/staging/media/atomisp/pci/sh_css_params.c @@ -4464,8 +4464,7 @@ ia_css_dvs2_6axis_config_allocate(const struct ia_css_stream *stream) if (!params || !params->pipe_dvs_6axis_config[IA_CSS_PIPE_ID_VIDEO]) goto err; - dvs_config = kvzalloc_objs(struct ia_css_dvs_6axis_config, 1, - GFP_KERNEL); + dvs_config = kvzalloc_objs(struct ia_css_dvs_6axis_config, 1); if (!dvs_config) goto err; diff --git a/drivers/staging/vme_user/vme_tsi148.c b/drivers/staging/vme_user/vme_tsi148.c index 356f3f5ec69a..4cf3486646ce 100644 --- a/drivers/staging/vme_user/vme_tsi148.c +++ b/drivers/staging/vme_user/vme_tsi148.c @@ -2332,8 +2332,7 @@ static int tsi148_probe(struct pci_dev *pdev, const struct pci_device_id *id) if (err_chk) { master_num--; - tsi148_device->flush_image = kmalloc_obj(*tsi148_device->flush_image, - GFP_KERNEL); + tsi148_device->flush_image = kmalloc_obj(*tsi148_device->flush_image); if (!tsi148_device->flush_image) { retval = -ENOMEM; goto err_master; |
