summaryrefslogtreecommitdiff
path: root/arch/x86/kernel/cpu
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/cpu
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/cpu')
-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
10 files changed, 13 insertions, 13 deletions
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);