diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2026-02-21 16:37:42 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2026-02-21 17:09:51 -0800 |
| commit | bf4afc53b77aeaa48b5409da5c8da6bb4eff7f43 (patch) | |
| tree | 01fdd9d27f1b272bef0127966e08eac44d134d0a /drivers/media/common/videobuf2 | |
| parent | e19e1b480ac73c3e62ffebbca1174f0f511f43e7 (diff) | |
| download | lwn-bf4afc53b77aeaa48b5409da5c8da6bb4eff7f43.tar.gz lwn-bf4afc53b77aeaa48b5409da5c8da6bb4eff7f43.zip | |
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/media/common/videobuf2')
5 files changed, 18 insertions, 18 deletions
diff --git a/drivers/media/common/videobuf2/videobuf2-core.c b/drivers/media/common/videobuf2/videobuf2-core.c index a70181f8d9d9..adf668b213c2 100644 --- a/drivers/media/common/videobuf2/videobuf2-core.c +++ b/drivers/media/common/videobuf2/videobuf2-core.c @@ -841,7 +841,7 @@ static bool verify_coherency_flags(struct vb2_queue *q, bool non_coherent_mem) static int vb2_core_allocated_buffers_storage(struct vb2_queue *q) { if (!q->bufs) - q->bufs = kzalloc_objs(*q->bufs, q->max_num_buffers, GFP_KERNEL); + q->bufs = kzalloc_objs(*q->bufs, q->max_num_buffers); if (!q->bufs) return -ENOMEM; @@ -2861,7 +2861,7 @@ static int __vb2_init_fileio(struct vb2_queue *q, int read) (read) ? "read" : "write", q->min_reqbufs_allocation, q->fileio_read_once, q->fileio_write_immediately); - fileio = kzalloc_obj(*fileio, GFP_KERNEL); + fileio = kzalloc_obj(*fileio); if (fileio == NULL) return -ENOMEM; @@ -3256,7 +3256,7 @@ int vb2_thread_start(struct vb2_queue *q, vb2_thread_fnc fnc, void *priv, if (WARN_ON(q->fileio)) return -EBUSY; - threadio = kzalloc_obj(*threadio, GFP_KERNEL); + threadio = kzalloc_obj(*threadio); if (threadio == NULL) return -ENOMEM; threadio->fnc = fnc; diff --git a/drivers/media/common/videobuf2/videobuf2-dma-contig.c b/drivers/media/common/videobuf2/videobuf2-dma-contig.c index 983de3b99acb..9ce6284cd5f2 100644 --- a/drivers/media/common/videobuf2/videobuf2-dma-contig.c +++ b/drivers/media/common/videobuf2/videobuf2-dma-contig.c @@ -238,7 +238,7 @@ static void *vb2_dc_alloc(struct vb2_buffer *vb, if (WARN_ON(!dev)) return ERR_PTR(-EINVAL); - buf = kzalloc_obj(*buf, GFP_KERNEL); + buf = kzalloc_obj(*buf); if (!buf) return ERR_PTR(-ENOMEM); @@ -325,7 +325,7 @@ static int vb2_dc_dmabuf_ops_attach(struct dma_buf *dbuf, struct vb2_dc_buf *buf = dbuf->priv; int ret; - attach = kzalloc_obj(*attach, GFP_KERNEL); + attach = kzalloc_obj(*attach); if (!attach) return -ENOMEM; @@ -479,7 +479,7 @@ static struct sg_table *vb2_dc_get_base_sgt(struct vb2_dc_buf *buf) if (buf->non_coherent_mem) return buf->dma_sgt; - sgt = kmalloc_obj(*sgt, GFP_KERNEL); + sgt = kmalloc_obj(*sgt); if (!sgt) { dev_err(buf->dev, "failed to alloc sg table\n"); return NULL; @@ -587,7 +587,7 @@ static void *vb2_dc_get_userptr(struct vb2_buffer *vb, struct device *dev, if (WARN_ON(!dev)) return ERR_PTR(-EINVAL); - buf = kzalloc_obj(*buf, GFP_KERNEL); + buf = kzalloc_obj(*buf); if (!buf) return ERR_PTR(-ENOMEM); @@ -624,7 +624,7 @@ static void *vb2_dc_get_userptr(struct vb2_buffer *vb, struct device *dev, goto out; } - sgt = kzalloc_obj(*sgt, GFP_KERNEL); + sgt = kzalloc_obj(*sgt); if (!sgt) { pr_err("failed to allocate sg table\n"); ret = -ENOMEM; @@ -779,7 +779,7 @@ static void *vb2_dc_attach_dmabuf(struct vb2_buffer *vb, struct device *dev, if (WARN_ON(!dev)) return ERR_PTR(-EINVAL); - buf = kzalloc_obj(*buf, GFP_KERNEL); + buf = kzalloc_obj(*buf); if (!buf) return ERR_PTR(-ENOMEM); diff --git a/drivers/media/common/videobuf2/videobuf2-dma-sg.c b/drivers/media/common/videobuf2/videobuf2-dma-sg.c index 76a9301fb85b..982021d547e5 100644 --- a/drivers/media/common/videobuf2/videobuf2-dma-sg.c +++ b/drivers/media/common/videobuf2/videobuf2-dma-sg.c @@ -109,7 +109,7 @@ static void *vb2_dma_sg_alloc(struct vb2_buffer *vb, struct device *dev, if (WARN_ON(!dev) || WARN_ON(!size)) return ERR_PTR(-EINVAL); - buf = kzalloc_obj(*buf, GFP_KERNEL); + buf = kzalloc_obj(*buf); if (!buf) return ERR_PTR(-ENOMEM); @@ -126,7 +126,7 @@ static void *vb2_dma_sg_alloc(struct vb2_buffer *vb, struct device *dev, * there is no memory consistency guarantee, hence dma-sg ignores DMA * attributes passed from the upper layer. */ - buf->pages = kvzalloc_objs(struct page *, buf->num_pages, GFP_KERNEL); + buf->pages = kvzalloc_objs(struct page *, buf->num_pages); if (!buf->pages) goto fail_pages_array_alloc; @@ -230,7 +230,7 @@ static void *vb2_dma_sg_get_userptr(struct vb2_buffer *vb, struct device *dev, if (WARN_ON(!dev)) return ERR_PTR(-EINVAL); - buf = kzalloc_obj(*buf, GFP_KERNEL); + buf = kzalloc_obj(*buf); if (!buf) return ERR_PTR(-ENOMEM); @@ -375,7 +375,7 @@ static int vb2_dma_sg_dmabuf_ops_attach(struct dma_buf *dbuf, struct vb2_dma_sg_buf *buf = dbuf->priv; int ret; - attach = kzalloc_obj(*attach, GFP_KERNEL); + attach = kzalloc_obj(*attach); if (!attach) return -ENOMEM; @@ -626,7 +626,7 @@ static void *vb2_dma_sg_attach_dmabuf(struct vb2_buffer *vb, struct device *dev, if (dbuf->size < size) return ERR_PTR(-EFAULT); - buf = kzalloc_obj(*buf, GFP_KERNEL); + buf = kzalloc_obj(*buf); if (!buf) return ERR_PTR(-ENOMEM); diff --git a/drivers/media/common/videobuf2/videobuf2-dvb.c b/drivers/media/common/videobuf2/videobuf2-dvb.c index e37dd9007b19..ef30a032d9d4 100644 --- a/drivers/media/common/videobuf2/videobuf2-dvb.c +++ b/drivers/media/common/videobuf2/videobuf2-dvb.c @@ -299,7 +299,7 @@ struct vb2_dvb_frontend *vb2_dvb_alloc_frontend( { struct vb2_dvb_frontend *fe; - fe = kzalloc_obj(struct vb2_dvb_frontend, GFP_KERNEL); + fe = kzalloc_obj(struct vb2_dvb_frontend); if (fe == NULL) return NULL; diff --git a/drivers/media/common/videobuf2/videobuf2-vmalloc.c b/drivers/media/common/videobuf2/videobuf2-vmalloc.c index a410e9078626..63f023696f3e 100644 --- a/drivers/media/common/videobuf2/videobuf2-vmalloc.c +++ b/drivers/media/common/videobuf2/videobuf2-vmalloc.c @@ -78,7 +78,7 @@ static void *vb2_vmalloc_get_userptr(struct vb2_buffer *vb, struct device *dev, int n_pages, offset, i; int ret = -ENOMEM; - buf = kzalloc_obj(*buf, GFP_KERNEL); + buf = kzalloc_obj(*buf); if (!buf) return ERR_PTR(-ENOMEM); @@ -221,7 +221,7 @@ static int vb2_vmalloc_dmabuf_ops_attach(struct dma_buf *dbuf, int ret; int i; - attach = kzalloc_obj(*attach, GFP_KERNEL); + attach = kzalloc_obj(*attach); if (!attach) return -ENOMEM; @@ -409,7 +409,7 @@ static void *vb2_vmalloc_attach_dmabuf(struct vb2_buffer *vb, if (dbuf->size < size) return ERR_PTR(-EFAULT); - buf = kzalloc_obj(*buf, GFP_KERNEL); + buf = kzalloc_obj(*buf); if (!buf) return ERR_PTR(-ENOMEM); |
