summaryrefslogtreecommitdiff
path: root/drivers/comedi
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/comedi
parente19e1b480ac73c3e62ffebbca1174f0f511f43e7 (diff)
downloadlwn-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/comedi')
-rw-r--r--drivers/comedi/comedi_buf.c2
-rw-r--r--drivers/comedi/comedi_fops.c8
-rw-r--r--drivers/comedi/drivers.c4
-rw-r--r--drivers/comedi/drivers/addi_apci_2032.c2
-rw-r--r--drivers/comedi/drivers/comedi_8254.c2
-rw-r--r--drivers/comedi/drivers/comedi_bond.c2
-rw-r--r--drivers/comedi/drivers/comedi_isadma.c4
-rw-r--r--drivers/comedi/drivers/dt9812.c4
-rw-r--r--drivers/comedi/drivers/mite.c4
-rw-r--r--drivers/comedi/drivers/ni_tio.c4
-rw-r--r--drivers/comedi/drivers/usbduxsigma.c4
11 files changed, 20 insertions, 20 deletions
diff --git a/drivers/comedi/comedi_buf.c b/drivers/comedi/comedi_buf.c
index 7215d4b9152b..ed372619bf54 100644
--- a/drivers/comedi/comedi_buf.c
+++ b/drivers/comedi/comedi_buf.c
@@ -70,7 +70,7 @@ comedi_buf_map_alloc(struct comedi_device *dev, enum dma_data_direction dma_dir,
struct comedi_buf_page *buf;
unsigned int i;
- bm = kzalloc_obj(*bm, GFP_KERNEL);
+ bm = kzalloc_obj(*bm);
if (!bm)
return NULL;
diff --git a/drivers/comedi/comedi_fops.c b/drivers/comedi/comedi_fops.c
index 627680057812..48a8a607a84c 100644
--- a/drivers/comedi/comedi_fops.c
+++ b/drivers/comedi/comedi_fops.c
@@ -1058,7 +1058,7 @@ static int do_subdinfo_ioctl(struct comedi_device *dev,
struct comedi_subdevice *s;
lockdep_assert_held(&dev->mutex);
- tmp = kzalloc_objs(*tmp, dev->n_subdevices, GFP_KERNEL);
+ tmp = kzalloc_objs(*tmp, dev->n_subdevices);
if (!tmp)
return -ENOMEM;
@@ -2969,7 +2969,7 @@ static int comedi_open(struct inode *inode, struct file *file)
return -ENODEV;
}
- cfp = kzalloc_obj(*cfp, GFP_KERNEL);
+ cfp = kzalloc_obj(*cfp);
if (!cfp) {
comedi_dev_put(dev);
return -ENOMEM;
@@ -3322,7 +3322,7 @@ static int compat_insnlist(struct file *file, unsigned long arg)
rc = check_insnlist_len(dev, insnlist32.n_insns);
if (rc)
return rc;
- insns = kzalloc_objs(*insns, insnlist32.n_insns, GFP_KERNEL);
+ insns = kzalloc_objs(*insns, insnlist32.n_insns);
if (!insns)
return -ENOMEM;
@@ -3505,7 +3505,7 @@ struct comedi_device *comedi_alloc_board_minor(struct device *hardware_device)
struct device *csdev;
unsigned int i;
- dev = kzalloc_obj(*dev, GFP_KERNEL);
+ dev = kzalloc_obj(*dev);
if (!dev)
return ERR_PTR(-ENOMEM);
comedi_device_init(dev);
diff --git a/drivers/comedi/drivers.c b/drivers/comedi/drivers.c
index b0e39a04f0b3..db225a3bf012 100644
--- a/drivers/comedi/drivers.c
+++ b/drivers/comedi/drivers.c
@@ -101,7 +101,7 @@ int comedi_alloc_subdevices(struct comedi_device *dev, int num_subdevices)
if (num_subdevices < 1)
return -EINVAL;
- s = kzalloc_objs(*s, num_subdevices, GFP_KERNEL);
+ s = kzalloc_objs(*s, num_subdevices);
if (!s)
return -ENOMEM;
dev->subdevices = s;
@@ -733,7 +733,7 @@ static int __comedi_device_postconfig_async(struct comedi_device *dev,
dev_warn(dev->class_dev,
"async subdevices should have a cancel() function\n");
- async = kzalloc_obj(*async, GFP_KERNEL);
+ async = kzalloc_obj(*async);
if (!async)
return -ENOMEM;
diff --git a/drivers/comedi/drivers/addi_apci_2032.c b/drivers/comedi/drivers/addi_apci_2032.c
index b81837cd4ad5..d0f52d5ece8f 100644
--- a/drivers/comedi/drivers/addi_apci_2032.c
+++ b/drivers/comedi/drivers/addi_apci_2032.c
@@ -274,7 +274,7 @@ static int apci2032_auto_attach(struct comedi_device *dev,
struct apci2032_int_private *subpriv;
dev->read_subdev = s;
- subpriv = kzalloc_obj(*subpriv, GFP_KERNEL);
+ subpriv = kzalloc_obj(*subpriv);
if (!subpriv)
return -ENOMEM;
spin_lock_init(&subpriv->spinlock);
diff --git a/drivers/comedi/drivers/comedi_8254.c b/drivers/comedi/drivers/comedi_8254.c
index a748b452d76d..a297dd650dab 100644
--- a/drivers/comedi/drivers/comedi_8254.c
+++ b/drivers/comedi/drivers/comedi_8254.c
@@ -633,7 +633,7 @@ static struct comedi_8254 *__i8254_init(comedi_8254_iocb_fn *iocb,
if (!iocb)
return ERR_PTR(-EINVAL);
- i8254 = kzalloc_obj(*i8254, GFP_KERNEL);
+ i8254 = kzalloc_obj(*i8254);
if (!i8254)
return ERR_PTR(-ENOMEM);
diff --git a/drivers/comedi/drivers/comedi_bond.c b/drivers/comedi/drivers/comedi_bond.c
index 1b530c819fc0..8e10ecab4f0d 100644
--- a/drivers/comedi/drivers/comedi_bond.c
+++ b/drivers/comedi/drivers/comedi_bond.c
@@ -223,7 +223,7 @@ static int do_dev_config(struct comedi_device *dev, struct comedi_devconfig *it)
nchans, minor, sdev);
return -EINVAL;
}
- bdev = kmalloc_obj(*bdev, GFP_KERNEL);
+ bdev = kmalloc_obj(*bdev);
if (!bdev)
return -ENOMEM;
diff --git a/drivers/comedi/drivers/comedi_isadma.c b/drivers/comedi/drivers/comedi_isadma.c
index 259678bfd1f3..04ce3eb9ae4f 100644
--- a/drivers/comedi/drivers/comedi_isadma.c
+++ b/drivers/comedi/drivers/comedi_isadma.c
@@ -161,11 +161,11 @@ struct comedi_isadma *comedi_isadma_alloc(struct comedi_device *dev,
if (n_desc < 1 || n_desc > 2)
goto no_dma;
- dma = kzalloc_obj(*dma, GFP_KERNEL);
+ dma = kzalloc_obj(*dma);
if (!dma)
goto no_dma;
- desc = kzalloc_objs(*desc, n_desc, GFP_KERNEL);
+ desc = kzalloc_objs(*desc, n_desc);
if (!desc)
goto no_dma;
dma->desc = desc;
diff --git a/drivers/comedi/drivers/dt9812.c b/drivers/comedi/drivers/dt9812.c
index cace17d6e70e..2541f75aff60 100644
--- a/drivers/comedi/drivers/dt9812.c
+++ b/drivers/comedi/drivers/dt9812.c
@@ -329,7 +329,7 @@ static int dt9812_write_multiple_registers(struct comedi_device *dev,
int i, count;
int ret;
- cmd = kzalloc_obj(*cmd, GFP_KERNEL);
+ cmd = kzalloc_obj(*cmd);
if (!cmd)
return -ENOMEM;
@@ -358,7 +358,7 @@ static int dt9812_rmw_multiple_registers(struct comedi_device *dev,
int i, count;
int ret;
- cmd = kzalloc_obj(*cmd, GFP_KERNEL);
+ cmd = kzalloc_obj(*cmd);
if (!cmd)
return -ENOMEM;
diff --git a/drivers/comedi/drivers/mite.c b/drivers/comedi/drivers/mite.c
index 3a16f4b6a292..e93150d6dc57 100644
--- a/drivers/comedi/drivers/mite.c
+++ b/drivers/comedi/drivers/mite.c
@@ -749,7 +749,7 @@ struct mite_ring *mite_alloc_ring(struct mite *mite)
{
struct mite_ring *ring;
- ring = kmalloc_obj(*ring, GFP_KERNEL);
+ ring = kmalloc_obj(*ring);
if (!ring)
return NULL;
ring->hw_dev = get_device(&mite->pcidev->dev);
@@ -879,7 +879,7 @@ struct mite *mite_attach(struct comedi_device *dev, bool use_win1)
unsigned int i;
int ret;
- mite = kzalloc_obj(*mite, GFP_KERNEL);
+ mite = kzalloc_obj(*mite);
if (!mite)
return NULL;
diff --git a/drivers/comedi/drivers/ni_tio.c b/drivers/comedi/drivers/ni_tio.c
index 56b5995e2c58..d6e7e2006981 100644
--- a/drivers/comedi/drivers/ni_tio.c
+++ b/drivers/comedi/drivers/ni_tio.c
@@ -1778,7 +1778,7 @@ ni_gpct_device_construct(struct comedi_device *dev,
if (num_counters == 0 || counters_per_chip == 0)
return NULL;
- counter_dev = kzalloc_obj(*counter_dev, GFP_KERNEL);
+ counter_dev = kzalloc_obj(*counter_dev);
if (!counter_dev)
return NULL;
@@ -1793,7 +1793,7 @@ ni_gpct_device_construct(struct comedi_device *dev,
counter_dev->num_counters = num_counters;
counter_dev->num_chips = DIV_ROUND_UP(num_counters, counters_per_chip);
- counter_dev->counters = kzalloc_objs(*counter, num_counters, GFP_KERNEL);
+ counter_dev->counters = kzalloc_objs(*counter, num_counters);
counter_dev->regs = kzalloc_objs(*counter_dev->regs,
counter_dev->num_chips, GFP_KERNEL);
if (!counter_dev->regs || !counter_dev->counters) {
diff --git a/drivers/comedi/drivers/usbduxsigma.c b/drivers/comedi/drivers/usbduxsigma.c
index bcf9116c4bd7..361b76d106ae 100644
--- a/drivers/comedi/drivers/usbduxsigma.c
+++ b/drivers/comedi/drivers/usbduxsigma.c
@@ -1336,8 +1336,8 @@ static int usbduxsigma_alloc_usb_buffers(struct comedi_device *dev)
devpriv->dux_commands = kzalloc(SIZEOFDUXBUFFER, GFP_KERNEL);
devpriv->in_buf = kzalloc(SIZEINBUF, GFP_KERNEL);
devpriv->insn_buf = kzalloc(SIZEINSNBUF, GFP_KERNEL);
- devpriv->ai_urbs = kzalloc_objs(urb, devpriv->n_ai_urbs, GFP_KERNEL);
- devpriv->ao_urbs = kzalloc_objs(urb, devpriv->n_ao_urbs, GFP_KERNEL);
+ devpriv->ai_urbs = kzalloc_objs(urb, devpriv->n_ai_urbs);
+ devpriv->ao_urbs = kzalloc_objs(urb, devpriv->n_ao_urbs);
if (!devpriv->dux_commands || !devpriv->in_buf || !devpriv->insn_buf ||
!devpriv->ai_urbs || !devpriv->ao_urbs)
return -ENOMEM;