summaryrefslogtreecommitdiff
path: root/drivers/acpi
diff options
context:
space:
mode:
authorKees Cook <kees@kernel.org>2026-02-21 23:46:04 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2026-02-22 08:26:33 -0800
commit189f164e573e18d9f8876dbd3ad8fcbe11f93037 (patch)
tree733382723a15ea29b7c9f3dde3bcb281f0b3c287 /drivers/acpi
parent32a92f8c89326985e05dce8b22d3f0aa07a3e1bd (diff)
Convert remaining multi-line kmalloc_obj/flex GFP_KERNEL usesHEADtorvalds/mastertorvalds/HEADmaster
Conversion performed via this Coccinelle script: // SPDX-License-Identifier: GPL-2.0-only // Options: --include-headers-for-types --all-includes --include-headers --keep-comments virtual patch @gfp depends on patch && !(file in "tools") && !(file in "samples")@ identifier ALLOC = {kmalloc_obj,kmalloc_objs,kmalloc_flex, kzalloc_obj,kzalloc_objs,kzalloc_flex, kvmalloc_obj,kvmalloc_objs,kvmalloc_flex, kvzalloc_obj,kvzalloc_objs,kvzalloc_flex}; @@ ALLOC(... - , GFP_KERNEL ) $ make coccicheck MODE=patch COCCI=gfp.cocci Build and boot tested x86_64 with Fedora 42's GCC and Clang: Linux version 6.19.0+ (user@host) (gcc (GCC) 15.2.1 20260123 (Red Hat 15.2.1-7), GNU ld version 2.44-12.fc42) #1 SMP PREEMPT_DYNAMIC 1970-01-01 Linux version 6.19.0+ (user@host) (clang version 20.1.8 (Fedora 20.1.8-4.fc42), LLD 20.1.8) #1 SMP PREEMPT_DYNAMIC 1970-01-01 Signed-off-by: Kees Cook <kees@kernel.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/acpi')
-rw-r--r--drivers/acpi/acpi_video.c5
-rw-r--r--drivers/acpi/riscv/irq.c4
-rw-r--r--drivers/acpi/x86/s2idle.c5
3 files changed, 6 insertions, 8 deletions
diff --git a/drivers/acpi/acpi_video.c b/drivers/acpi/acpi_video.c
index 5f4751478752..3fa28f1abca3 100644
--- a/drivers/acpi/acpi_video.c
+++ b/drivers/acpi/acpi_video.c
@@ -837,8 +837,7 @@ int acpi_video_get_levels(struct acpi_device *device,
* special levels (see below)
*/
br->levels = kmalloc_objs(*br->levels,
- obj->package.count + ACPI_VIDEO_FIRST_LEVEL,
- GFP_KERNEL);
+ obj->package.count + ACPI_VIDEO_FIRST_LEVEL);
if (!br->levels) {
result = -ENOMEM;
goto out_free;
@@ -1331,7 +1330,7 @@ static int acpi_video_device_enumerate(struct acpi_video_bus *video)
dod->package.count);
active_list = kzalloc_objs(struct acpi_video_enumerated_device,
- 1 + dod->package.count, GFP_KERNEL);
+ 1 + dod->package.count);
if (!active_list) {
status = -ENOMEM;
goto out;
diff --git a/drivers/acpi/riscv/irq.c b/drivers/acpi/riscv/irq.c
index afffde4cfe7a..9b88d0993e88 100644
--- a/drivers/acpi/riscv/irq.c
+++ b/drivers/acpi/riscv/irq.c
@@ -343,7 +343,7 @@ static u32 riscv_acpi_add_prt_dep(acpi_handle handle)
acpi_get_handle(handle, entry->source, &link_handle);
dep_devices.count = 1;
dep_devices.handles = kzalloc_objs(*dep_devices.handles,
- 1, GFP_KERNEL);
+ 1);
if (!dep_devices.handles) {
acpi_handle_err(handle, "failed to allocate memory\n");
continue;
@@ -355,7 +355,7 @@ static u32 riscv_acpi_add_prt_dep(acpi_handle handle)
gsi_handle = riscv_acpi_get_gsi_handle(entry->source_index);
dep_devices.count = 1;
dep_devices.handles = kzalloc_objs(*dep_devices.handles,
- 1, GFP_KERNEL);
+ 1);
if (!dep_devices.handles) {
acpi_handle_err(handle, "failed to allocate memory\n");
continue;
diff --git a/drivers/acpi/x86/s2idle.c b/drivers/acpi/x86/s2idle.c
index 82075543a1ed..b6b1dd76a06b 100644
--- a/drivers/acpi/x86/s2idle.c
+++ b/drivers/acpi/x86/s2idle.c
@@ -130,8 +130,7 @@ static void lpi_device_get_constraints_amd(void)
}
lpi_constraints_table = kzalloc_objs(*lpi_constraints_table,
- package->package.count,
- GFP_KERNEL);
+ package->package.count);
if (!lpi_constraints_table)
goto free_acpi_buffer;
@@ -210,7 +209,7 @@ static void lpi_device_get_constraints(void)
return;
lpi_constraints_table = kzalloc_objs(*lpi_constraints_table,
- out_obj->package.count, GFP_KERNEL);
+ out_obj->package.count);
if (!lpi_constraints_table)
goto free_acpi_buffer;