summaryrefslogtreecommitdiff
path: root/drivers/dma-buf
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2026-02-22 03:37:42 +0300
committerLinus Torvalds <torvalds@linux-foundation.org>2026-02-22 04:09:51 +0300
commitbf4afc53b77aeaa48b5409da5c8da6bb4eff7f43 (patch)
tree01fdd9d27f1b272bef0127966e08eac44d134d0a /drivers/dma-buf
parente19e1b480ac73c3e62ffebbca1174f0f511f43e7 (diff)
downloadlinux-bf4afc53b77aeaa48b5409da5c8da6bb4eff7f43.tar.xz
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 'drivers/dma-buf')
-rw-r--r--drivers/dma-buf/dma-buf-mapping.c4
-rw-r--r--drivers/dma-buf/dma-buf.c4
-rw-r--r--drivers/dma-buf/dma-fence-unwrap.c2
-rw-r--r--drivers/dma-buf/dma-fence.c4
-rw-r--r--drivers/dma-buf/dma-heap.c2
-rw-r--r--drivers/dma-buf/heaps/cma_heap.c8
-rw-r--r--drivers/dma-buf/heaps/system_heap.c4
-rw-r--r--drivers/dma-buf/st-dma-fence-chain.c2
-rw-r--r--drivers/dma-buf/st-dma-fence-unwrap.c4
-rw-r--r--drivers/dma-buf/st-dma-resv.c2
-rw-r--r--drivers/dma-buf/sw_sync.c4
-rw-r--r--drivers/dma-buf/sync_file.c2
-rw-r--r--drivers/dma-buf/udmabuf.c8
13 files changed, 25 insertions, 25 deletions
diff --git a/drivers/dma-buf/dma-buf-mapping.c b/drivers/dma-buf/dma-buf-mapping.c
index d9374f2ff0ca..794acff2546a 100644
--- a/drivers/dma-buf/dma-buf-mapping.c
+++ b/drivers/dma-buf/dma-buf-mapping.c
@@ -108,7 +108,7 @@ struct sg_table *dma_buf_phys_vec_to_sgt(struct dma_buf_attachment *attach,
/* This function is supposed to work on MMIO memory only */
return ERR_PTR(-EINVAL);
- dma = kzalloc_obj(*dma, GFP_KERNEL);
+ dma = kzalloc_obj(*dma);
if (!dma)
return ERR_PTR(-ENOMEM);
@@ -119,7 +119,7 @@ struct sg_table *dma_buf_phys_vec_to_sgt(struct dma_buf_attachment *attach,
*/
break;
case PCI_P2PDMA_MAP_THRU_HOST_BRIDGE:
- dma->state = kzalloc_obj(*dma->state, GFP_KERNEL);
+ dma->state = kzalloc_obj(*dma->state);
if (!dma->state) {
ret = -ENOMEM;
goto err_free_dma;
diff --git a/drivers/dma-buf/dma-buf.c b/drivers/dma-buf/dma-buf.c
index 71d5e7e42653..11711874a325 100644
--- a/drivers/dma-buf/dma-buf.c
+++ b/drivers/dma-buf/dma-buf.c
@@ -866,7 +866,7 @@ static int dma_buf_wrap_sg_table(struct sg_table **sg_table)
* sg_table without copying the page_link and give only the copy back to
* the importer.
*/
- to = kzalloc_obj(*to, GFP_KERNEL);
+ to = kzalloc_obj(*to);
if (!to)
return -ENOMEM;
@@ -1020,7 +1020,7 @@ dma_buf_dynamic_attach(struct dma_buf *dmabuf, struct device *dev,
if (WARN_ON(importer_ops && !importer_ops->move_notify))
return ERR_PTR(-EINVAL);
- attach = kzalloc_obj(*attach, GFP_KERNEL);
+ attach = kzalloc_obj(*attach);
if (!attach)
return ERR_PTR(-ENOMEM);
diff --git a/drivers/dma-buf/dma-fence-unwrap.c b/drivers/dma-buf/dma-fence-unwrap.c
index dc2525b2a03f..07fe9bf45aea 100644
--- a/drivers/dma-buf/dma-fence-unwrap.c
+++ b/drivers/dma-buf/dma-fence-unwrap.c
@@ -155,7 +155,7 @@ struct dma_fence *__dma_fence_unwrap_merge(unsigned int num_fences,
dma_fence_put(unsignaled);
- array = kmalloc_objs(*array, count, GFP_KERNEL);
+ array = kmalloc_objs(*array, count);
if (!array)
return NULL;
diff --git a/drivers/dma-buf/dma-fence.c b/drivers/dma-buf/dma-fence.c
index 97f0f150e49a..35afcfcac591 100644
--- a/drivers/dma-buf/dma-fence.c
+++ b/drivers/dma-buf/dma-fence.c
@@ -156,7 +156,7 @@ struct dma_fence *dma_fence_allocate_private_stub(ktime_t timestamp)
{
struct dma_fence *fence;
- fence = kzalloc_obj(*fence, GFP_KERNEL);
+ fence = kzalloc_obj(*fence);
if (fence == NULL)
return NULL;
@@ -905,7 +905,7 @@ dma_fence_wait_any_timeout(struct dma_fence **fences, uint32_t count,
return 0;
}
- cb = kzalloc_objs(struct default_wait_cb, count, GFP_KERNEL);
+ cb = kzalloc_objs(struct default_wait_cb, count);
if (cb == NULL) {
ret = -ENOMEM;
goto err_free_cb;
diff --git a/drivers/dma-buf/dma-heap.c b/drivers/dma-buf/dma-heap.c
index e0b9eb871c35..ac5f8685a649 100644
--- a/drivers/dma-buf/dma-heap.c
+++ b/drivers/dma-buf/dma-heap.c
@@ -244,7 +244,7 @@ struct dma_heap *dma_heap_add(const struct dma_heap_export_info *exp_info)
return ERR_PTR(-EINVAL);
}
- heap = kzalloc_obj(*heap, GFP_KERNEL);
+ heap = kzalloc_obj(*heap);
if (!heap)
return ERR_PTR(-ENOMEM);
diff --git a/drivers/dma-buf/heaps/cma_heap.c b/drivers/dma-buf/heaps/cma_heap.c
index 06ed40c9d528..bd3370b9a3f6 100644
--- a/drivers/dma-buf/heaps/cma_heap.c
+++ b/drivers/dma-buf/heaps/cma_heap.c
@@ -74,7 +74,7 @@ static int cma_heap_attach(struct dma_buf *dmabuf,
struct dma_heap_attachment *a;
int ret;
- a = kzalloc_obj(*a, GFP_KERNEL);
+ a = kzalloc_obj(*a);
if (!a)
return -ENOMEM;
@@ -308,7 +308,7 @@ static struct dma_buf *cma_heap_allocate(struct dma_heap *heap,
int ret = -ENOMEM;
pgoff_t pg;
- buffer = kzalloc_obj(*buffer, GFP_KERNEL);
+ buffer = kzalloc_obj(*buffer);
if (!buffer)
return ERR_PTR(-ENOMEM);
@@ -346,7 +346,7 @@ static struct dma_buf *cma_heap_allocate(struct dma_heap *heap,
memset(page_address(cma_pages), 0, size);
}
- buffer->pages = kmalloc_objs(*buffer->pages, pagecount, GFP_KERNEL);
+ buffer->pages = kmalloc_objs(*buffer->pages, pagecount);
if (!buffer->pages) {
ret = -ENOMEM;
goto free_cma;
@@ -391,7 +391,7 @@ static int __init __add_cma_heap(struct cma *cma, const char *name)
struct dma_heap_export_info exp_info;
struct cma_heap *cma_heap;
- cma_heap = kzalloc_obj(*cma_heap, GFP_KERNEL);
+ cma_heap = kzalloc_obj(*cma_heap);
if (!cma_heap)
return -ENOMEM;
cma_heap->cma = cma;
diff --git a/drivers/dma-buf/heaps/system_heap.c b/drivers/dma-buf/heaps/system_heap.c
index 27ba8e55d909..b3650d8fd651 100644
--- a/drivers/dma-buf/heaps/system_heap.c
+++ b/drivers/dma-buf/heaps/system_heap.c
@@ -77,7 +77,7 @@ static int system_heap_attach(struct dma_buf *dmabuf,
struct dma_heap_attachment *a;
int ret;
- a = kzalloc_obj(*a, GFP_KERNEL);
+ a = kzalloc_obj(*a);
if (!a)
return -ENOMEM;
@@ -354,7 +354,7 @@ static struct dma_buf *system_heap_allocate(struct dma_heap *heap,
struct page *page, *tmp_page;
int i, ret = -ENOMEM;
- buffer = kzalloc_obj(*buffer, GFP_KERNEL);
+ buffer = kzalloc_obj(*buffer);
if (!buffer)
return ERR_PTR(-ENOMEM);
diff --git a/drivers/dma-buf/st-dma-fence-chain.c b/drivers/dma-buf/st-dma-fence-chain.c
index 4ae7a6257e57..821023dd34df 100644
--- a/drivers/dma-buf/st-dma-fence-chain.c
+++ b/drivers/dma-buf/st-dma-fence-chain.c
@@ -450,7 +450,7 @@ static int find_race(void *arg)
if (err)
return err;
- threads = kmalloc_objs(*threads, ncpus, GFP_KERNEL);
+ threads = kmalloc_objs(*threads, ncpus);
if (!threads) {
err = -ENOMEM;
goto err;
diff --git a/drivers/dma-buf/st-dma-fence-unwrap.c b/drivers/dma-buf/st-dma-fence-unwrap.c
index 56802a39874e..9c74195f47fd 100644
--- a/drivers/dma-buf/st-dma-fence-unwrap.c
+++ b/drivers/dma-buf/st-dma-fence-unwrap.c
@@ -32,7 +32,7 @@ static struct dma_fence *__mock_fence(u64 context, u64 seqno)
{
struct mock_fence *f;
- f = kmalloc_obj(*f, GFP_KERNEL);
+ f = kmalloc_obj(*f);
if (!f)
return NULL;
@@ -54,7 +54,7 @@ static struct dma_fence *mock_array(unsigned int num_fences, ...)
va_list valist;
int i;
- fences = kzalloc_objs(*fences, num_fences, GFP_KERNEL);
+ fences = kzalloc_objs(*fences, num_fences);
if (!fences)
goto error_put;
diff --git a/drivers/dma-buf/st-dma-resv.c b/drivers/dma-buf/st-dma-resv.c
index fad024820f85..ad4dfb49dcd9 100644
--- a/drivers/dma-buf/st-dma-resv.c
+++ b/drivers/dma-buf/st-dma-resv.c
@@ -27,7 +27,7 @@ static struct dma_fence *alloc_fence(void)
{
struct dma_fence *f;
- f = kmalloc_obj(*f, GFP_KERNEL);
+ f = kmalloc_obj(*f);
if (!f)
return NULL;
diff --git a/drivers/dma-buf/sw_sync.c b/drivers/dma-buf/sw_sync.c
index d04f479edaee..963a72324d16 100644
--- a/drivers/dma-buf/sw_sync.c
+++ b/drivers/dma-buf/sw_sync.c
@@ -101,7 +101,7 @@ static struct sync_timeline *sync_timeline_create(const char *name)
{
struct sync_timeline *obj;
- obj = kzalloc_obj(*obj, GFP_KERNEL);
+ obj = kzalloc_obj(*obj);
if (!obj)
return NULL;
@@ -252,7 +252,7 @@ static struct sync_pt *sync_pt_create(struct sync_timeline *obj,
{
struct sync_pt *pt;
- pt = kzalloc_obj(*pt, GFP_KERNEL);
+ pt = kzalloc_obj(*pt);
if (!pt)
return NULL;
diff --git a/drivers/dma-buf/sync_file.c b/drivers/dma-buf/sync_file.c
index ad2c3e9e23bc..2166bbdf7e4a 100644
--- a/drivers/dma-buf/sync_file.c
+++ b/drivers/dma-buf/sync_file.c
@@ -24,7 +24,7 @@ static struct sync_file *sync_file_alloc(void)
{
struct sync_file *sync_file;
- sync_file = kzalloc_obj(*sync_file, GFP_KERNEL);
+ sync_file = kzalloc_obj(*sync_file);
if (!sync_file)
return NULL;
diff --git a/drivers/dma-buf/udmabuf.c b/drivers/dma-buf/udmabuf.c
index 816ee45f4f99..7173dad6ead5 100644
--- a/drivers/dma-buf/udmabuf.c
+++ b/drivers/dma-buf/udmabuf.c
@@ -115,7 +115,7 @@ static int vmap_udmabuf(struct dma_buf *buf, struct iosys_map *map)
dma_resv_assert_held(buf->resv);
- pages = kvmalloc_objs(*pages, ubuf->pagecount, GFP_KERNEL);
+ pages = kvmalloc_objs(*pages, ubuf->pagecount);
if (!pages)
return -ENOMEM;
@@ -150,7 +150,7 @@ static struct sg_table *get_sg_table(struct device *dev, struct dma_buf *buf,
unsigned int i = 0;
int ret;
- sg = kzalloc_obj(*sg, GFP_KERNEL);
+ sg = kzalloc_obj(*sg);
if (!sg)
return ERR_PTR(-ENOMEM);
@@ -207,11 +207,11 @@ static void unpin_all_folios(struct udmabuf *ubuf)
static __always_inline int init_udmabuf(struct udmabuf *ubuf, pgoff_t pgcnt)
{
- ubuf->folios = kvmalloc_objs(*ubuf->folios, pgcnt, GFP_KERNEL);
+ ubuf->folios = kvmalloc_objs(*ubuf->folios, pgcnt);
if (!ubuf->folios)
return -ENOMEM;
- ubuf->offsets = kvzalloc_objs(*ubuf->offsets, pgcnt, GFP_KERNEL);
+ ubuf->offsets = kvzalloc_objs(*ubuf->offsets, pgcnt);
if (!ubuf->offsets)
return -ENOMEM;