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/platform | |
| parent | 323bbfcf1ef8836d0d2ad9e2c1f1c684f0e3b5b3 (diff) | |
| download | linux-next-32a92f8c89326985e05dce8b22d3f0aa07a3e1bd.tar.gz linux-next-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/platform')
| -rw-r--r-- | drivers/platform/chrome/chromeos_laptop.c | 3 | ||||
| -rw-r--r-- | drivers/platform/x86/asus-armoury.c | 6 | ||||
| -rw-r--r-- | drivers/platform/x86/dell/dell-smbios-base.c | 3 | ||||
| -rw-r--r-- | drivers/platform/x86/intel/int3472/tps68470.c | 3 | ||||
| -rw-r--r-- | drivers/platform/x86/intel/speed_select_if/isst_if_common.c | 6 | ||||
| -rw-r--r-- | drivers/platform/x86/intel/uncore-frequency/uncore-frequency.c | 3 | ||||
| -rw-r--r-- | drivers/platform/x86/sony-laptop.c | 3 | ||||
| -rw-r--r-- | drivers/platform/x86/uv_sysfs.c | 12 | ||||
| -rw-r--r-- | drivers/platform/x86/x86-android-tablets/core.c | 3 |
9 files changed, 14 insertions, 28 deletions
diff --git a/drivers/platform/chrome/chromeos_laptop.c b/drivers/platform/chrome/chromeos_laptop.c index 042f8ca6a463..c3c4cb6704d1 100644 --- a/drivers/platform/chrome/chromeos_laptop.c +++ b/drivers/platform/chrome/chromeos_laptop.c @@ -807,8 +807,7 @@ chromeos_laptop_prepare_acpi_peripherals(struct chromeos_laptop *cros_laptop, if (!n_peripherals) return 0; - acpi_peripherals = kzalloc_objs(*src->acpi_peripherals, n_peripherals, - GFP_KERNEL); + acpi_peripherals = kzalloc_objs(*src->acpi_peripherals, n_peripherals); if (!acpi_peripherals) return -ENOMEM; diff --git a/drivers/platform/x86/asus-armoury.c b/drivers/platform/x86/asus-armoury.c index 9222e645756f..5b0987ccc270 100644 --- a/drivers/platform/x86/asus-armoury.c +++ b/drivers/platform/x86/asus-armoury.c @@ -1005,8 +1005,7 @@ static void init_rog_tunables(void) /* Initialize AC power tunables */ ac_limits = power_data->ac_data; if (ac_limits) { - ac_rog_tunables = kzalloc_obj(*asus_armoury.rog_tunables[ASUS_ROG_TUNABLE_AC], - GFP_KERNEL); + ac_rog_tunables = kzalloc_obj(*asus_armoury.rog_tunables[ASUS_ROG_TUNABLE_AC]); if (!ac_rog_tunables) goto err_nomem; @@ -1053,8 +1052,7 @@ static void init_rog_tunables(void) /* Initialize DC power tunables */ dc_limits = power_data->dc_data; if (dc_limits) { - dc_rog_tunables = kzalloc_obj(*asus_armoury.rog_tunables[ASUS_ROG_TUNABLE_DC], - GFP_KERNEL); + dc_rog_tunables = kzalloc_obj(*asus_armoury.rog_tunables[ASUS_ROG_TUNABLE_DC]); if (!dc_rog_tunables) { kfree(ac_rog_tunables); goto err_nomem; diff --git a/drivers/platform/x86/dell/dell-smbios-base.c b/drivers/platform/x86/dell/dell-smbios-base.c index 564ff5279797..4b7c54b76228 100644 --- a/drivers/platform/x86/dell/dell-smbios-base.c +++ b/drivers/platform/x86/dell/dell-smbios-base.c @@ -500,8 +500,7 @@ static int build_tokens_sysfs(struct platform_device *dev) return -ENOMEM; /* need to store both location and value + terminator*/ - token_attrs = kzalloc_objs(*token_attrs, (2 * da_num_tokens) + 1, - GFP_KERNEL); + token_attrs = kzalloc_objs(*token_attrs, (2 * da_num_tokens) + 1); if (!token_attrs) goto out_allocate_attrs; diff --git a/drivers/platform/x86/intel/int3472/tps68470.c b/drivers/platform/x86/intel/int3472/tps68470.c index fdbb8b0005f2..a496075c0d2a 100644 --- a/drivers/platform/x86/intel/int3472/tps68470.c +++ b/drivers/platform/x86/intel/int3472/tps68470.c @@ -180,8 +180,7 @@ static int skl_int3472_tps68470_probe(struct i2c_client *client) if (!board_data) return dev_err_probe(&client->dev, -ENODEV, "No board-data found for this model\n"); - cells = kzalloc_objs(*cells, TPS68470_WIN_MFD_CELL_COUNT, - GFP_KERNEL); + cells = kzalloc_objs(*cells, TPS68470_WIN_MFD_CELL_COUNT); if (!cells) return -ENOMEM; diff --git a/drivers/platform/x86/intel/speed_select_if/isst_if_common.c b/drivers/platform/x86/intel/speed_select_if/isst_if_common.c index fa75eb77e0cb..1c48bf6d5457 100644 --- a/drivers/platform/x86/intel/speed_select_if/isst_if_common.c +++ b/drivers/platform/x86/intel/speed_select_if/isst_if_common.c @@ -425,13 +425,11 @@ static int isst_if_cpu_info_init(void) { int ret; - isst_cpu_info = kzalloc_objs(*isst_cpu_info, num_possible_cpus(), - GFP_KERNEL); + isst_cpu_info = kzalloc_objs(*isst_cpu_info, num_possible_cpus()); if (!isst_cpu_info) return -ENOMEM; - isst_pkg_info = kzalloc_objs(*isst_pkg_info, topology_max_packages(), - GFP_KERNEL); + isst_pkg_info = kzalloc_objs(*isst_pkg_info, topology_max_packages()); if (!isst_pkg_info) { kfree(isst_cpu_info); return -ENOMEM; diff --git a/drivers/platform/x86/intel/uncore-frequency/uncore-frequency.c b/drivers/platform/x86/intel/uncore-frequency/uncore-frequency.c index 89a90bd90c44..667f2c8b9594 100644 --- a/drivers/platform/x86/intel/uncore-frequency/uncore-frequency.c +++ b/drivers/platform/x86/intel/uncore-frequency/uncore-frequency.c @@ -278,8 +278,7 @@ static int __init intel_uncore_init(void) uncore_max_entries = topology_max_packages() * topology_max_dies_per_package(); - uncore_instances = kzalloc_objs(*uncore_instances, uncore_max_entries, - GFP_KERNEL); + uncore_instances = kzalloc_objs(*uncore_instances, uncore_max_entries); if (!uncore_instances) return -ENOMEM; diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c index 477f56385e54..d3e7a52c22a7 100644 --- a/drivers/platform/x86/sony-laptop.c +++ b/drivers/platform/x86/sony-laptop.c @@ -4161,8 +4161,7 @@ sony_pic_read_possible_resource(struct acpi_resource *resource, void *context) case ACPI_RESOURCE_TYPE_START_DEPENDENT: { /* start IO enumeration */ - struct sony_pic_ioport *ioport = kzalloc_obj(*ioport, - GFP_KERNEL); + struct sony_pic_ioport *ioport = kzalloc_obj(*ioport); if (!ioport) return AE_ERROR; diff --git a/drivers/platform/x86/uv_sysfs.c b/drivers/platform/x86/uv_sysfs.c index 353f9c6ef214..b9adb34502bd 100644 --- a/drivers/platform/x86/uv_sysfs.c +++ b/drivers/platform/x86/uv_sysfs.c @@ -216,8 +216,7 @@ static int uv_hubs_init(void) u64 sz; int i, ret; - prev_obj_to_cnode = kmalloc_objs(*prev_obj_to_cnode, uv_bios_obj_cnt, - GFP_KERNEL); + prev_obj_to_cnode = kmalloc_objs(*prev_obj_to_cnode, uv_bios_obj_cnt); if (!prev_obj_to_cnode) return -ENOMEM; @@ -398,8 +397,7 @@ static int uv_ports_init(void) } for (j = 0; j < uv_bios_obj_cnt; j++) { for (k = 0; k < hub_buf[j].ports; k++) { - uv_hubs[j]->ports[k] = kzalloc_obj(*uv_hubs[j]->ports[k], - GFP_KERNEL); + uv_hubs[j]->ports[k] = kzalloc_obj(*uv_hubs[j]->ports[k]); if (!uv_hubs[j]->ports[k]) { ret = -ENOMEM; k--; @@ -675,8 +673,7 @@ static int pci_topology_init(void) } num_pci_lines = l; - uv_pci_objs = kzalloc_objs(*uv_pci_objs, num_pci_lines, - GFP_KERNEL); + uv_pci_objs = kzalloc_objs(*uv_pci_objs, num_pci_lines); if (!uv_pci_objs) { kfree(pci_top_str); ret = -ENOMEM; @@ -684,8 +681,7 @@ static int pci_topology_init(void) } start = pci_top_str; while ((found = strsep(&start, "\n")) != NULL) { - uv_pci_objs[k] = kzalloc_obj(*uv_pci_objs[k], - GFP_KERNEL); + uv_pci_objs[k] = kzalloc_obj(*uv_pci_objs[k]); if (!uv_pci_objs[k]) { ret = -ENOMEM; goto err_pci_obj; diff --git a/drivers/platform/x86/x86-android-tablets/core.c b/drivers/platform/x86/x86-android-tablets/core.c index 9f2945de0caa..021009e9085b 100644 --- a/drivers/platform/x86/x86-android-tablets/core.c +++ b/drivers/platform/x86/x86-android-tablets/core.c @@ -447,8 +447,7 @@ static __init int x86_android_tablet_probe(struct platform_device *pdev) exit_handler = dev_info->exit; } - i2c_clients = kzalloc_objs(*i2c_clients, dev_info->i2c_client_count, - GFP_KERNEL); + i2c_clients = kzalloc_objs(*i2c_clients, dev_info->i2c_client_count); if (!i2c_clients) { x86_android_tablet_remove(pdev); return -ENOMEM; |
