summaryrefslogtreecommitdiff
path: root/drivers/media/common
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 /drivers/media/common
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 'drivers/media/common')
-rw-r--r--drivers/media/common/cypress_firmware.c2
-rw-r--r--drivers/media/common/saa7146/saa7146_core.c4
-rw-r--r--drivers/media/common/saa7146/saa7146_fops.c2
-rw-r--r--drivers/media/common/siano/smscoreapi.c12
-rw-r--r--drivers/media/common/siano/smsdvb-debugfs.c2
-rw-r--r--drivers/media/common/siano/smsdvb-main.c2
-rw-r--r--drivers/media/common/videobuf2/videobuf2-core.c6
-rw-r--r--drivers/media/common/videobuf2/videobuf2-dma-contig.c12
-rw-r--r--drivers/media/common/videobuf2/videobuf2-dma-sg.c10
-rw-r--r--drivers/media/common/videobuf2/videobuf2-dvb.c2
-rw-r--r--drivers/media/common/videobuf2/videobuf2-vmalloc.c6
11 files changed, 30 insertions, 30 deletions
diff --git a/drivers/media/common/cypress_firmware.c b/drivers/media/common/cypress_firmware.c
index c1c110428928..66274fdf5243 100644
--- a/drivers/media/common/cypress_firmware.c
+++ b/drivers/media/common/cypress_firmware.c
@@ -75,7 +75,7 @@ int cypress_load_firmware(struct usb_device *udev,
struct hexline *hx;
int ret, pos = 0;
- hx = kmalloc_obj(*hx, GFP_KERNEL);
+ hx = kmalloc_obj(*hx);
if (!hx)
return -ENOMEM;
diff --git a/drivers/media/common/saa7146/saa7146_core.c b/drivers/media/common/saa7146/saa7146_core.c
index fc0f88b16dc3..c297d019f2b3 100644
--- a/drivers/media/common/saa7146/saa7146_core.c
+++ b/drivers/media/common/saa7146/saa7146_core.c
@@ -141,7 +141,7 @@ static struct scatterlist* vmalloc_to_sg(unsigned char *virt, int nr_pages)
struct page *pg;
int i;
- sglist = kmalloc_objs(struct scatterlist, nr_pages, GFP_KERNEL);
+ sglist = kmalloc_objs(struct scatterlist, nr_pages);
if (NULL == sglist)
return NULL;
sg_init_table(sglist, nr_pages);
@@ -334,7 +334,7 @@ static int saa7146_init_one(struct pci_dev *pci, const struct pci_device_id *ent
int err = -ENOMEM;
/* clear out mem for sure */
- dev = kzalloc_obj(struct saa7146_dev, GFP_KERNEL);
+ dev = kzalloc_obj(struct saa7146_dev);
if (!dev) {
ERR("out of memory\n");
goto out;
diff --git a/drivers/media/common/saa7146/saa7146_fops.c b/drivers/media/common/saa7146/saa7146_fops.c
index f448c0a0e05f..fd12ef10409c 100644
--- a/drivers/media/common/saa7146/saa7146_fops.c
+++ b/drivers/media/common/saa7146/saa7146_fops.c
@@ -266,7 +266,7 @@ int saa7146_vv_init(struct saa7146_dev* dev, struct saa7146_ext_vv *ext_vv)
}
dev->v4l2_dev.ctrl_handler = hdl;
- vv = kzalloc_obj(struct saa7146_vv, GFP_KERNEL);
+ vv = kzalloc_obj(struct saa7146_vv);
if (vv == NULL) {
ERR("out of memory. aborting.\n");
v4l2_ctrl_handler_free(hdl);
diff --git a/drivers/media/common/siano/smscoreapi.c b/drivers/media/common/siano/smscoreapi.c
index 489a8dd0a161..017629e3cf84 100644
--- a/drivers/media/common/siano/smscoreapi.c
+++ b/drivers/media/common/siano/smscoreapi.c
@@ -439,7 +439,7 @@ static struct smscore_registry_entry_t *smscore_find_registry(char *devpath)
return entry;
}
}
- entry = kmalloc_obj(*entry, GFP_KERNEL);
+ entry = kmalloc_obj(*entry);
if (entry) {
entry->mode = default_mode;
strscpy(entry->devpath, devpath, sizeof(entry->devpath));
@@ -528,7 +528,7 @@ int smscore_register_hotplug(hotplug_t hotplug)
int rc = 0;
mutex_lock(&g_smscore_deviceslock);
- notifyee = kmalloc_obj(*notifyee, GFP_KERNEL);
+ notifyee = kmalloc_obj(*notifyee);
if (notifyee) {
/* now notify callback about existing devices */
first = &g_smscore_devices;
@@ -617,7 +617,7 @@ smscore_buffer_t *smscore_createbuffer(u8 *buffer, void *common_buffer,
{
struct smscore_buffer_t *cb;
- cb = kzalloc_obj(*cb, GFP_KERNEL);
+ cb = kzalloc_obj(*cb);
if (!cb)
return NULL;
@@ -647,7 +647,7 @@ int smscore_register_device(struct smsdevice_params_t *params,
struct smscore_device_t *dev;
u8 *buffer;
- dev = kzalloc_obj(*dev, GFP_KERNEL);
+ dev = kzalloc_obj(*dev);
if (!dev)
return -ENOMEM;
@@ -1678,7 +1678,7 @@ static int smscore_validate_client(struct smscore_device_t *coredev,
pr_err("The msg ID already registered to another client.\n");
return -EEXIST;
}
- listentry = kzalloc_obj(*listentry, GFP_KERNEL);
+ listentry = kzalloc_obj(*listentry);
if (!listentry)
return -ENOMEM;
@@ -1715,7 +1715,7 @@ int smscore_register_client(struct smscore_device_t *coredev,
return -EEXIST;
}
- newclient = kzalloc_obj(*newclient, GFP_KERNEL);
+ newclient = kzalloc_obj(*newclient);
if (!newclient)
return -ENOMEM;
diff --git a/drivers/media/common/siano/smsdvb-debugfs.c b/drivers/media/common/siano/smsdvb-debugfs.c
index e5fbc08d4192..c482777e1c60 100644
--- a/drivers/media/common/siano/smsdvb-debugfs.c
+++ b/drivers/media/common/siano/smsdvb-debugfs.c
@@ -358,7 +358,7 @@ int smsdvb_debugfs_create(struct smsdvb_client_t *client)
if (!smsdvb_debugfs_usb_root || !coredev->is_usb_device)
return -ENODEV;
- debug_data = kzalloc_obj(*client->debug_data, GFP_KERNEL);
+ debug_data = kzalloc_obj(*client->debug_data);
if (!debug_data)
return -ENOMEM;
diff --git a/drivers/media/common/siano/smsdvb-main.c b/drivers/media/common/siano/smsdvb-main.c
index f49845a266e5..415c24fbbb65 100644
--- a/drivers/media/common/siano/smsdvb-main.c
+++ b/drivers/media/common/siano/smsdvb-main.c
@@ -1110,7 +1110,7 @@ static int smsdvb_hotplug(struct smscore_device_t *coredev,
/* device removal handled by onremove callback */
if (!arrival)
return 0;
- client = kzalloc_obj(struct smsdvb_client_t, GFP_KERNEL);
+ client = kzalloc_obj(struct smsdvb_client_t);
if (!client)
return -ENOMEM;
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);