summaryrefslogtreecommitdiff
path: root/arch/x86/kernel
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2026-02-21 16:37:42 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2026-02-21 17:09:51 -0800
commitbf4afc53b77aeaa48b5409da5c8da6bb4eff7f43 (patch)
tree01fdd9d27f1b272bef0127966e08eac44d134d0a /arch/x86/kernel
parente19e1b480ac73c3e62ffebbca1174f0f511f43e7 (diff)
Convert 'alloc_obj' family to use the new default GFP_KERNEL argument
This was done entirely with mindless brute force, using git grep -l '\<k[vmz]*alloc_objs*(.*, GFP_KERNEL)' | xargs sed -i 's/\(alloc_objs*(.*\), GFP_KERNEL)/\1)/' to convert the new alloc_obj() users that had a simple GFP_KERNEL argument to just drop that argument. Note that due to the extreme simplicity of the scripting, any slightly more complex cases spread over multiple lines would not be triggered: they definitely exist, but this covers the vast bulk of the cases, and the resulting diff is also then easier to check automatically. For the same reason the 'flex' versions will be done as a separate conversion. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/x86/kernel')
-rw-r--r--arch/x86/kernel/alternative.c2
-rw-r--r--arch/x86/kernel/amd_node.c2
-rw-r--r--arch/x86/kernel/apic/io_apic.c2
-rw-r--r--arch/x86/kernel/apm_32.c2
-rw-r--r--arch/x86/kernel/cpu/amd_cache_disable.c2
-rw-r--r--arch/x86/kernel/cpu/mce/amd.c6
-rw-r--r--arch/x86/kernel/cpu/mce/core.c2
-rw-r--r--arch/x86/kernel/cpu/microcode/amd.c2
-rw-r--r--arch/x86/kernel/cpu/mtrr/generic.c2
-rw-r--r--arch/x86/kernel/cpu/mtrr/legacy.c2
-rw-r--r--arch/x86/kernel/cpu/sgx/driver.c2
-rw-r--r--arch/x86/kernel/cpu/sgx/encl.c4
-rw-r--r--arch/x86/kernel/cpu/sgx/ioctl.c2
-rw-r--r--arch/x86/kernel/cpu/sgx/virt.c2
-rw-r--r--arch/x86/kernel/hpet.c4
-rw-r--r--arch/x86/kernel/ioport.c2
-rw-r--r--arch/x86/kernel/kdebugfs.c2
-rw-r--r--arch/x86/kernel/kexec-bzimage64.c2
-rw-r--r--arch/x86/kernel/ksysfs.c2
-rw-r--r--arch/x86/kernel/uprobes.c2
-rw-r--r--arch/x86/kernel/vm86_32.c2
21 files changed, 25 insertions, 25 deletions
diff --git a/arch/x86/kernel/alternative.c b/arch/x86/kernel/alternative.c
index 0ffc7de200b1..a888ae0f01fb 100644
--- a/arch/x86/kernel/alternative.c
+++ b/arch/x86/kernel/alternative.c
@@ -2160,7 +2160,7 @@ void __init_or_module alternatives_smp_module_add(struct module *mod,
/* Don't bother remembering, we'll never have to undo it. */
goto smp_unlock;
- smp = kzalloc_obj(*smp, GFP_KERNEL);
+ smp = kzalloc_obj(*smp);
if (NULL == smp)
/* we'll run the (safe but slow) SMP code then ... */
goto unlock;
diff --git a/arch/x86/kernel/amd_node.c b/arch/x86/kernel/amd_node.c
index 2091cb1089a2..0be01725a2a4 100644
--- a/arch/x86/kernel/amd_node.c
+++ b/arch/x86/kernel/amd_node.c
@@ -282,7 +282,7 @@ static int __init amd_smn_init(void)
return -ENODEV;
num_nodes = amd_num_nodes();
- amd_roots = kzalloc_objs(*amd_roots, num_nodes, GFP_KERNEL);
+ amd_roots = kzalloc_objs(*amd_roots, num_nodes);
if (!amd_roots)
return -ENOMEM;
diff --git a/arch/x86/kernel/apic/io_apic.c b/arch/x86/kernel/apic/io_apic.c
index aa3675ba08bb..352ed5558cbc 100644
--- a/arch/x86/kernel/apic/io_apic.c
+++ b/arch/x86/kernel/apic/io_apic.c
@@ -2876,7 +2876,7 @@ int mp_irqdomain_alloc(struct irq_domain *domain, unsigned int virq,
if (irq_resolve_mapping(domain, (irq_hw_number_t)pin))
return -EEXIST;
- data = kzalloc_obj(*data, GFP_KERNEL);
+ data = kzalloc_obj(*data);
if (!data)
return -ENOMEM;
diff --git a/arch/x86/kernel/apm_32.c b/arch/x86/kernel/apm_32.c
index 13efc166bd3f..a57c026fb58a 100644
--- a/arch/x86/kernel/apm_32.c
+++ b/arch/x86/kernel/apm_32.c
@@ -1576,7 +1576,7 @@ static int do_open(struct inode *inode, struct file *filp)
{
struct apm_user *as;
- as = kmalloc_obj(*as, GFP_KERNEL);
+ as = kmalloc_obj(*as);
if (as == NULL)
return -ENOMEM;
diff --git a/arch/x86/kernel/cpu/amd_cache_disable.c b/arch/x86/kernel/cpu/amd_cache_disable.c
index 13985d2f8b1d..9ab460bc11a2 100644
--- a/arch/x86/kernel/cpu/amd_cache_disable.c
+++ b/arch/x86/kernel/cpu/amd_cache_disable.c
@@ -255,7 +255,7 @@ static void init_amd_l3_attrs(void)
if (amd_nb_has_feature(AMD_NB_L3_PARTITIONING))
n += 1;
- amd_l3_attrs = kzalloc_objs(*amd_l3_attrs, n, GFP_KERNEL);
+ amd_l3_attrs = kzalloc_objs(*amd_l3_attrs, n);
if (!amd_l3_attrs)
return;
diff --git a/arch/x86/kernel/cpu/mce/amd.c b/arch/x86/kernel/cpu/mce/amd.c
index 4e7a6101e7ed..da13c1e37f87 100644
--- a/arch/x86/kernel/cpu/mce/amd.c
+++ b/arch/x86/kernel/cpu/mce/amd.c
@@ -1088,7 +1088,7 @@ static int allocate_threshold_blocks(unsigned int cpu, struct threshold_bank *tb
(high & MASK_LOCKED_HI))
goto recurse;
- b = kzalloc_obj(struct threshold_block, GFP_KERNEL);
+ b = kzalloc_obj(struct threshold_block);
if (!b)
return -ENOMEM;
@@ -1147,7 +1147,7 @@ static int threshold_create_bank(struct threshold_bank **bp, unsigned int cpu,
if (!dev)
return -ENODEV;
- b = kzalloc_obj(struct threshold_bank, GFP_KERNEL);
+ b = kzalloc_obj(struct threshold_bank);
if (!b) {
err = -ENOMEM;
goto out;
@@ -1250,7 +1250,7 @@ void mce_threshold_create_device(unsigned int cpu)
return;
numbanks = this_cpu_read(mce_num_banks);
- bp = kzalloc_objs(*bp, numbanks, GFP_KERNEL);
+ bp = kzalloc_objs(*bp, numbanks);
if (!bp)
return;
diff --git a/arch/x86/kernel/cpu/mce/core.c b/arch/x86/kernel/cpu/mce/core.c
index dd6a06ab5270..8dd424ac5de8 100644
--- a/arch/x86/kernel/cpu/mce/core.c
+++ b/arch/x86/kernel/cpu/mce/core.c
@@ -2692,7 +2692,7 @@ static int mce_device_create(unsigned int cpu)
if (dev)
return 0;
- dev = kzalloc_obj(*dev, GFP_KERNEL);
+ dev = kzalloc_obj(*dev);
if (!dev)
return -ENOMEM;
dev->id = cpu;
diff --git a/arch/x86/kernel/cpu/microcode/amd.c b/arch/x86/kernel/cpu/microcode/amd.c
index e58a73ae431b..e533881284a1 100644
--- a/arch/x86/kernel/cpu/microcode/amd.c
+++ b/arch/x86/kernel/cpu/microcode/amd.c
@@ -1086,7 +1086,7 @@ static int verify_and_add_patch(u8 family, u8 *fw, unsigned int leftover,
if (ret)
return ret;
- patch = kzalloc_obj(*patch, GFP_KERNEL);
+ patch = kzalloc_obj(*patch);
if (!patch) {
pr_err("Patch allocation failure.\n");
return -EINVAL;
diff --git a/arch/x86/kernel/cpu/mtrr/generic.c b/arch/x86/kernel/cpu/mtrr/generic.c
index d7db12c06950..3a8317060732 100644
--- a/arch/x86/kernel/cpu/mtrr/generic.c
+++ b/arch/x86/kernel/cpu/mtrr/generic.c
@@ -410,7 +410,7 @@ void __init mtrr_copy_map(void)
mutex_lock(&mtrr_mutex);
- cache_map = kzalloc_objs(*cache_map, new_size, GFP_KERNEL);
+ cache_map = kzalloc_objs(*cache_map, new_size);
if (cache_map) {
memmove(cache_map, init_cache_map,
cache_map_n * sizeof(*cache_map));
diff --git a/arch/x86/kernel/cpu/mtrr/legacy.c b/arch/x86/kernel/cpu/mtrr/legacy.c
index ee7bc7b5ce96..ca1209cdea5f 100644
--- a/arch/x86/kernel/cpu/mtrr/legacy.c
+++ b/arch/x86/kernel/cpu/mtrr/legacy.c
@@ -80,7 +80,7 @@ static struct syscore mtrr_syscore = {
void mtrr_register_syscore(void)
{
- mtrr_value = kzalloc_objs(*mtrr_value, num_var_ranges, GFP_KERNEL);
+ mtrr_value = kzalloc_objs(*mtrr_value, num_var_ranges);
/*
* The CPU has no MTRR and seems to not support SMP. They have
diff --git a/arch/x86/kernel/cpu/sgx/driver.c b/arch/x86/kernel/cpu/sgx/driver.c
index 74fb59d96730..473619741bc4 100644
--- a/arch/x86/kernel/cpu/sgx/driver.c
+++ b/arch/x86/kernel/cpu/sgx/driver.c
@@ -19,7 +19,7 @@ static int __sgx_open(struct inode *inode, struct file *file)
struct sgx_encl *encl;
int ret;
- encl = kzalloc_obj(*encl, GFP_KERNEL);
+ encl = kzalloc_obj(*encl);
if (!encl)
return -ENOMEM;
diff --git a/arch/x86/kernel/cpu/sgx/encl.c b/arch/x86/kernel/cpu/sgx/encl.c
index 8b6c400c4008..ac60ebde5d9b 100644
--- a/arch/x86/kernel/cpu/sgx/encl.c
+++ b/arch/x86/kernel/cpu/sgx/encl.c
@@ -854,7 +854,7 @@ int sgx_encl_mm_add(struct sgx_encl *encl, struct mm_struct *mm)
if (sgx_encl_find_mm(encl, mm))
return 0;
- encl_mm = kzalloc_obj(*encl_mm, GFP_KERNEL);
+ encl_mm = kzalloc_obj(*encl_mm);
if (!encl_mm)
return -ENOMEM;
@@ -1163,7 +1163,7 @@ struct sgx_encl_page *sgx_encl_page_alloc(struct sgx_encl *encl,
struct sgx_encl_page *encl_page;
unsigned long prot;
- encl_page = kzalloc_obj(*encl_page, GFP_KERNEL);
+ encl_page = kzalloc_obj(*encl_page);
if (!encl_page)
return ERR_PTR(-ENOMEM);
diff --git a/arch/x86/kernel/cpu/sgx/ioctl.c b/arch/x86/kernel/cpu/sgx/ioctl.c
index ef6674067d80..c236a8ac78a8 100644
--- a/arch/x86/kernel/cpu/sgx/ioctl.c
+++ b/arch/x86/kernel/cpu/sgx/ioctl.c
@@ -27,7 +27,7 @@ struct sgx_va_page *sgx_encl_grow(struct sgx_encl *encl, bool reclaim)
(SGX_ENCL_PAGE_VA_OFFSET_MASK >> 3) + 1);
if (!(encl->page_cnt % SGX_VA_SLOT_COUNT)) {
- va_page = kzalloc_obj(*va_page, GFP_KERNEL);
+ va_page = kzalloc_obj(*va_page);
if (!va_page)
return ERR_PTR(-ENOMEM);
diff --git a/arch/x86/kernel/cpu/sgx/virt.c b/arch/x86/kernel/cpu/sgx/virt.c
index c7be8d0ea869..db6806c40483 100644
--- a/arch/x86/kernel/cpu/sgx/virt.c
+++ b/arch/x86/kernel/cpu/sgx/virt.c
@@ -264,7 +264,7 @@ static int __sgx_vepc_open(struct inode *inode, struct file *file)
{
struct sgx_vepc *vepc;
- vepc = kzalloc_obj(struct sgx_vepc, GFP_KERNEL);
+ vepc = kzalloc_obj(struct sgx_vepc);
if (!vepc)
return -ENOMEM;
mutex_init(&vepc->lock);
diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c
index 43884229c421..610590e83445 100644
--- a/arch/x86/kernel/hpet.c
+++ b/arch/x86/kernel/hpet.c
@@ -544,7 +544,7 @@ static struct irq_domain *hpet_create_irq_domain(int hpet_id)
if (x86_vector_domain == NULL)
return NULL;
- domain_info = kzalloc_obj(*domain_info, GFP_KERNEL);
+ domain_info = kzalloc_obj(*domain_info);
if (!domain_info)
return NULL;
@@ -1038,7 +1038,7 @@ int __init hpet_enable(void)
if (IS_ENABLED(CONFIG_HPET_EMULATE_RTC) && channels < 2)
goto out_nohpet;
- hc = kzalloc_objs(*hc, channels, GFP_KERNEL);
+ hc = kzalloc_objs(*hc, channels);
if (!hc) {
pr_warn("Disabling HPET.\n");
goto out_nohpet;
diff --git a/arch/x86/kernel/ioport.c b/arch/x86/kernel/ioport.c
index 30ab130329dc..2b9de8e1a090 100644
--- a/arch/x86/kernel/ioport.c
+++ b/arch/x86/kernel/ioport.c
@@ -90,7 +90,7 @@ long ksys_ioperm(unsigned long from, unsigned long num, int turn_on)
/* No point to allocate a bitmap just to clear permissions */
if (!turn_on)
return 0;
- iobm = kmalloc_obj(*iobm, GFP_KERNEL);
+ iobm = kmalloc_obj(*iobm);
if (!iobm)
return -ENOMEM;
diff --git a/arch/x86/kernel/kdebugfs.c b/arch/x86/kernel/kdebugfs.c
index 4d7bf56524d8..e14ace32009f 100644
--- a/arch/x86/kernel/kdebugfs.c
+++ b/arch/x86/kernel/kdebugfs.c
@@ -102,7 +102,7 @@ static int __init create_setup_data_nodes(struct dentry *parent)
pa_data = boot_params.hdr.setup_data;
while (pa_data) {
- node = kmalloc_obj(*node, GFP_KERNEL);
+ node = kmalloc_obj(*node);
if (!node) {
error = -ENOMEM;
goto err_dir;
diff --git a/arch/x86/kernel/kexec-bzimage64.c b/arch/x86/kernel/kexec-bzimage64.c
index b7ba1ec486f9..5630c7dca1f3 100644
--- a/arch/x86/kernel/kexec-bzimage64.c
+++ b/arch/x86/kernel/kexec-bzimage64.c
@@ -682,7 +682,7 @@ static void *bzImage64_load(struct kimage *image, char *kernel,
goto out_free_params;
/* Allocate loader specific data */
- ldata = kzalloc_obj(struct bzimage64_data, GFP_KERNEL);
+ ldata = kzalloc_obj(struct bzimage64_data);
if (!ldata) {
ret = -ENOMEM;
goto out_free_params;
diff --git a/arch/x86/kernel/ksysfs.c b/arch/x86/kernel/ksysfs.c
index c5614b59be4a..1a6e1f89f294 100644
--- a/arch/x86/kernel/ksysfs.c
+++ b/arch/x86/kernel/ksysfs.c
@@ -344,7 +344,7 @@ static int __init create_setup_data_nodes(struct kobject *parent)
if (ret)
goto out_setup_data_kobj;
- kobjp = kmalloc_objs(*kobjp, nr, GFP_KERNEL);
+ kobjp = kmalloc_objs(*kobjp, nr);
if (!kobjp) {
ret = -ENOMEM;
goto out_setup_data_kobj;
diff --git a/arch/x86/kernel/uprobes.c b/arch/x86/kernel/uprobes.c
index 61d37f5a5ff9..ebb1baf1eb1d 100644
--- a/arch/x86/kernel/uprobes.c
+++ b/arch/x86/kernel/uprobes.c
@@ -696,7 +696,7 @@ static struct uprobe_trampoline *create_uprobe_trampoline(unsigned long vaddr)
if (IS_ERR_VALUE(vaddr))
return NULL;
- tramp = kzalloc_obj(*tramp, GFP_KERNEL);
+ tramp = kzalloc_obj(*tramp);
if (unlikely(!tramp))
return NULL;
diff --git a/arch/x86/kernel/vm86_32.c b/arch/x86/kernel/vm86_32.c
index 3bb70763af9c..b4c1cabc7a4b 100644
--- a/arch/x86/kernel/vm86_32.c
+++ b/arch/x86/kernel/vm86_32.c
@@ -232,7 +232,7 @@ static long do_sys_vm86(struct vm86plus_struct __user *user_vm86, bool plus)
}
if (!vm86) {
- if (!(vm86 = kzalloc_obj(*vm86, GFP_KERNEL)))
+ if (!(vm86 = kzalloc_obj(*vm86)))
return -ENOMEM;
tsk->thread.vm86 = vm86;
}