summaryrefslogtreecommitdiff
path: root/kernel/power
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 /kernel/power
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 'kernel/power')
-rw-r--r--kernel/power/console.c2
-rw-r--r--kernel/power/energy_model.c2
-rw-r--r--kernel/power/qos.c4
-rw-r--r--kernel/power/snapshot.c4
-rw-r--r--kernel/power/swap.c8
-rw-r--r--kernel/power/wakelock.c2
6 files changed, 11 insertions, 11 deletions
diff --git a/kernel/power/console.c b/kernel/power/console.c
index 5ed9e1be1560..33ace63b1088 100644
--- a/kernel/power/console.c
+++ b/kernel/power/console.c
@@ -58,7 +58,7 @@ int pm_vt_switch_required(struct device *dev, bool required)
}
}
- entry = kmalloc_obj(*entry, GFP_KERNEL);
+ entry = kmalloc_obj(*entry);
if (!entry) {
ret = -ENOMEM;
goto out;
diff --git a/kernel/power/energy_model.c b/kernel/power/energy_model.c
index 43ddfc11b84a..e610cf8e9a06 100644
--- a/kernel/power/energy_model.c
+++ b/kernel/power/energy_model.c
@@ -439,7 +439,7 @@ static int em_create_pd(struct device *dev, int nr_states,
cpumask_copy(em_span_cpus(pd), cpus);
} else {
- pd = kzalloc_obj(*pd, GFP_KERNEL);
+ pd = kzalloc_obj(*pd);
if (!pd)
return -ENOMEM;
}
diff --git a/kernel/power/qos.c b/kernel/power/qos.c
index 750b80f45b9f..398b994b73aa 100644
--- a/kernel/power/qos.c
+++ b/kernel/power/qos.c
@@ -341,7 +341,7 @@ static int cpu_latency_qos_open(struct inode *inode, struct file *filp)
{
struct pm_qos_request *req;
- req = kzalloc_obj(*req, GFP_KERNEL);
+ req = kzalloc_obj(*req);
if (!req)
return -ENOMEM;
@@ -440,7 +440,7 @@ static int cpu_wakeup_latency_qos_open(struct inode *inode, struct file *filp)
{
struct pm_qos_request *req;
- req = kzalloc_obj(*req, GFP_KERNEL);
+ req = kzalloc_obj(*req);
if (!req)
return -ENOMEM;
diff --git a/kernel/power/snapshot.c b/kernel/power/snapshot.c
index be0b3304339f..6e1321837c66 100644
--- a/kernel/power/snapshot.c
+++ b/kernel/power/snapshot.c
@@ -1124,7 +1124,7 @@ int create_basic_memory_bitmaps(void)
else
BUG_ON(forbidden_pages_map || free_pages_map);
- bm1 = kzalloc_obj(struct memory_bitmap, GFP_KERNEL);
+ bm1 = kzalloc_obj(struct memory_bitmap);
if (!bm1)
return -ENOMEM;
@@ -1132,7 +1132,7 @@ int create_basic_memory_bitmaps(void)
if (error)
goto Free_first_object;
- bm2 = kzalloc_obj(struct memory_bitmap, GFP_KERNEL);
+ bm2 = kzalloc_obj(struct memory_bitmap);
if (!bm2)
goto Free_first_bitmap;
diff --git a/kernel/power/swap.c b/kernel/power/swap.c
index 9bc1241259d3..2e64869bb5a0 100644
--- a/kernel/power/swap.c
+++ b/kernel/power/swap.c
@@ -155,7 +155,7 @@ static int swsusp_extents_insert(unsigned long swap_offset)
}
}
/* Add the new node and rebalance the tree. */
- ext = kzalloc_obj(struct swsusp_extent, GFP_KERNEL);
+ ext = kzalloc_obj(struct swsusp_extent);
if (!ext)
return -ENOMEM;
@@ -577,7 +577,7 @@ static struct crc_data *alloc_crc_data(int nr_threads)
{
struct crc_data *crc;
- crc = kzalloc_obj(*crc, GFP_KERNEL);
+ crc = kzalloc_obj(*crc);
if (!crc)
return NULL;
@@ -585,7 +585,7 @@ static struct crc_data *alloc_crc_data(int nr_threads)
if (!crc->unc)
goto err_free_crc;
- crc->unc_len = kzalloc_objs(*crc->unc_len, nr_threads, GFP_KERNEL);
+ crc->unc_len = kzalloc_objs(*crc->unc_len, nr_threads);
if (!crc->unc_len)
goto err_free_unc;
@@ -1016,7 +1016,7 @@ static int get_swap_reader(struct swap_map_handle *handle,
last = handle->maps = NULL;
offset = swsusp_header->image;
while (offset) {
- tmp = kzalloc_obj(*handle->maps, GFP_KERNEL);
+ tmp = kzalloc_obj(*handle->maps);
if (!tmp) {
release_swap_reader(handle);
return -ENOMEM;
diff --git a/kernel/power/wakelock.c b/kernel/power/wakelock.c
index 49712d9e7cfa..fd763da06a87 100644
--- a/kernel/power/wakelock.c
+++ b/kernel/power/wakelock.c
@@ -178,7 +178,7 @@ static struct wakelock *wakelock_lookup_add(const char *name, size_t len,
return ERR_PTR(-ENOSPC);
/* Not found, we have to add a new one. */
- wl = kzalloc_obj(*wl, GFP_KERNEL);
+ wl = kzalloc_obj(*wl);
if (!wl)
return ERR_PTR(-ENOMEM);