summaryrefslogtreecommitdiff
path: root/drivers/tty/serial
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/tty/serial
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/tty/serial')
-rw-r--r--drivers/tty/serial/8250/8250_acorn.c2
-rw-r--r--drivers/tty/serial/8250/8250_core.c2
-rw-r--r--drivers/tty/serial/8250/8250_hp300.c2
-rw-r--r--drivers/tty/serial/8250/8250_ni.c2
-rw-r--r--drivers/tty/serial/8250/8250_of.c2
-rw-r--r--drivers/tty/serial/8250/serial_cs.c2
-rw-r--r--drivers/tty/serial/icom.c2
-rw-r--r--drivers/tty/serial/jsm/jsm_driver.c2
-rw-r--r--drivers/tty/serial/max3100.c2
-rw-r--r--drivers/tty/serial/pch_uart.c2
-rw-r--r--drivers/tty/serial/pxa.c2
-rw-r--r--drivers/tty/serial/serial_base_bus.c4
-rw-r--r--drivers/tty/serial/serial_core.c2
-rw-r--r--drivers/tty/serial/sunhv.c2
-rw-r--r--drivers/tty/serial/sunsu.c2
-rw-r--r--drivers/tty/serial/timbuart.c2
-rw-r--r--drivers/tty/serial/ucc_uart.c2
17 files changed, 18 insertions, 18 deletions
diff --git a/drivers/tty/serial/8250/8250_acorn.c b/drivers/tty/serial/8250/8250_acorn.c
index 84889bb952a2..fb596262b9c7 100644
--- a/drivers/tty/serial/8250/8250_acorn.c
+++ b/drivers/tty/serial/8250/8250_acorn.c
@@ -44,7 +44,7 @@ serial_card_probe(struct expansion_card *ec, const struct ecard_id *id)
unsigned long bus_addr;
unsigned int i;
- info = kzalloc_obj(struct serial_card_info, GFP_KERNEL);
+ info = kzalloc_obj(struct serial_card_info);
if (!info)
return -ENOMEM;
diff --git a/drivers/tty/serial/8250/8250_core.c b/drivers/tty/serial/8250/8250_core.c
index 74a358e7ae03..d2e2c5dfef99 100644
--- a/drivers/tty/serial/8250/8250_core.c
+++ b/drivers/tty/serial/8250/8250_core.c
@@ -140,7 +140,7 @@ static struct irq_info *serial_get_or_create_irq_info(const struct uart_8250_por
if (i->irq == up->port.irq)
return i;
- i = kzalloc_obj(*i, GFP_KERNEL);
+ i = kzalloc_obj(*i);
if (i == NULL)
return ERR_PTR(-ENOMEM);
diff --git a/drivers/tty/serial/8250/8250_hp300.c b/drivers/tty/serial/8250/8250_hp300.c
index 732f1a158e62..59ec0c7377a1 100644
--- a/drivers/tty/serial/8250/8250_hp300.c
+++ b/drivers/tty/serial/8250/8250_hp300.c
@@ -240,7 +240,7 @@ static int __init hp300_8250_init(void)
#endif
/* Create new serial device */
- port = kmalloc_obj(struct hp300_port, GFP_KERNEL);
+ port = kmalloc_obj(struct hp300_port);
if (!port)
return -ENOMEM;
diff --git a/drivers/tty/serial/8250/8250_ni.c b/drivers/tty/serial/8250/8250_ni.c
index 3f3dac694e20..0935341dd050 100644
--- a/drivers/tty/serial/8250/8250_ni.c
+++ b/drivers/tty/serial/8250/8250_ni.c
@@ -285,7 +285,7 @@ static int ni16550_probe(struct platform_device *pdev)
bool rs232_property;
int ret;
- uart = kzalloc_obj(*uart, GFP_KERNEL);
+ uart = kzalloc_obj(*uart);
if (!uart)
return -ENOMEM;
diff --git a/drivers/tty/serial/8250/8250_of.c b/drivers/tty/serial/8250/8250_of.c
index 9c721bafbe37..81644d40b09a 100644
--- a/drivers/tty/serial/8250/8250_of.c
+++ b/drivers/tty/serial/8250/8250_of.c
@@ -217,7 +217,7 @@ static int of_platform_serial_probe(struct platform_device *ofdev)
if (of_property_read_bool(ofdev->dev.of_node, "used-by-rtas"))
return -EBUSY;
- info = kzalloc_obj(*info, GFP_KERNEL);
+ info = kzalloc_obj(*info);
if (info == NULL)
return -ENOMEM;
diff --git a/drivers/tty/serial/8250/serial_cs.c b/drivers/tty/serial/8250/serial_cs.c
index 5c372bd7f92a..80483fc7388d 100644
--- a/drivers/tty/serial/8250/serial_cs.c
+++ b/drivers/tty/serial/8250/serial_cs.c
@@ -305,7 +305,7 @@ static int serial_probe(struct pcmcia_device *link)
dev_dbg(&link->dev, "serial_attach()\n");
/* Create new serial device */
- info = kzalloc_obj(*info, GFP_KERNEL);
+ info = kzalloc_obj(*info);
if (!info)
return -ENOMEM;
info->p_dev = link;
diff --git a/drivers/tty/serial/icom.c b/drivers/tty/serial/icom.c
index c0a7f8a0ff55..bcdc07208486 100644
--- a/drivers/tty/serial/icom.c
+++ b/drivers/tty/serial/icom.c
@@ -1632,7 +1632,7 @@ static int icom_alloc_adapter(struct icom_adapter
struct icom_adapter *icom_adapter;
struct icom_adapter *cur_adapter_entry;
- icom_adapter = kzalloc_obj(struct icom_adapter, GFP_KERNEL);
+ icom_adapter = kzalloc_obj(struct icom_adapter);
if (!icom_adapter) {
return -ENOMEM;
diff --git a/drivers/tty/serial/jsm/jsm_driver.c b/drivers/tty/serial/jsm/jsm_driver.c
index 2a048dc62b96..4b73e51f83fb 100644
--- a/drivers/tty/serial/jsm/jsm_driver.c
+++ b/drivers/tty/serial/jsm/jsm_driver.c
@@ -66,7 +66,7 @@ static int jsm_probe_one(struct pci_dev *pdev, const struct pci_device_id *ent)
goto out_disable_device;
}
- brd = kzalloc_obj(*brd, GFP_KERNEL);
+ brd = kzalloc_obj(*brd);
if (!brd) {
rc = -ENOMEM;
goto out_release_regions;
diff --git a/drivers/tty/serial/max3100.c b/drivers/tty/serial/max3100.c
index 68cef83de47d..475b0a6efce4 100644
--- a/drivers/tty/serial/max3100.c
+++ b/drivers/tty/serial/max3100.c
@@ -708,7 +708,7 @@ static int max3100_probe(struct spi_device *spi)
return dev_err_probe(dev, -ENOSPC, "too many MAX3100 chips\n");
}
- max3100s[i] = kzalloc_obj(struct max3100_port, GFP_KERNEL);
+ max3100s[i] = kzalloc_obj(struct max3100_port);
if (!max3100s[i]) {
mutex_unlock(&max3100s_lock);
return -ENOMEM;
diff --git a/drivers/tty/serial/pch_uart.c b/drivers/tty/serial/pch_uart.c
index 2983d74a5cf1..6729d8e83c3c 100644
--- a/drivers/tty/serial/pch_uart.c
+++ b/drivers/tty/serial/pch_uart.c
@@ -1651,7 +1651,7 @@ static struct eg20t_port *pch_uart_init_port(struct pci_dev *pdev,
board = &drv_dat[id->driver_data];
port_type = board->port_type;
- priv = kzalloc_obj(struct eg20t_port, GFP_KERNEL);
+ priv = kzalloc_obj(struct eg20t_port);
if (priv == NULL)
goto init_port_alloc_err;
diff --git a/drivers/tty/serial/pxa.c b/drivers/tty/serial/pxa.c
index 063720ed9716..fea0255067cc 100644
--- a/drivers/tty/serial/pxa.c
+++ b/drivers/tty/serial/pxa.c
@@ -811,7 +811,7 @@ static int serial_pxa_probe(struct platform_device *dev)
if (irq < 0)
return irq;
- sport = kzalloc_obj(struct uart_pxa_port, GFP_KERNEL);
+ sport = kzalloc_obj(struct uart_pxa_port);
if (!sport)
return -ENOMEM;
diff --git a/drivers/tty/serial/serial_base_bus.c b/drivers/tty/serial/serial_base_bus.c
index ffe331831e22..a12935f6b992 100644
--- a/drivers/tty/serial/serial_base_bus.c
+++ b/drivers/tty/serial/serial_base_bus.c
@@ -116,7 +116,7 @@ struct serial_ctrl_device *serial_base_ctrl_add(struct uart_port *port,
struct serial_ctrl_device *ctrl_dev;
int err;
- ctrl_dev = kzalloc_obj(*ctrl_dev, GFP_KERNEL);
+ ctrl_dev = kzalloc_obj(*ctrl_dev);
if (!ctrl_dev)
return ERR_PTR(-ENOMEM);
@@ -156,7 +156,7 @@ struct serial_port_device *serial_base_port_add(struct uart_port *port,
int min = 0, max = -1; /* Use -1 for max to apply IDA defaults */
int err;
- port_dev = kzalloc_obj(*port_dev, GFP_KERNEL);
+ port_dev = kzalloc_obj(*port_dev);
if (!port_dev)
return ERR_PTR(-ENOMEM);
diff --git a/drivers/tty/serial/serial_core.c b/drivers/tty/serial/serial_core.c
index 2047d73858ec..78bb2a5f1cdf 100644
--- a/drivers/tty/serial/serial_core.c
+++ b/drivers/tty/serial/serial_core.c
@@ -2716,7 +2716,7 @@ int uart_register_driver(struct uart_driver *drv)
* Maybe we should be using a slab cache for this, especially if
* we have a large number of ports to handle.
*/
- drv->state = kzalloc_objs(struct uart_state, drv->nr, GFP_KERNEL);
+ drv->state = kzalloc_objs(struct uart_state, drv->nr);
if (!drv->state)
goto out;
diff --git a/drivers/tty/serial/sunhv.c b/drivers/tty/serial/sunhv.c
index 219588a8b1ee..35301d6d5bc6 100644
--- a/drivers/tty/serial/sunhv.c
+++ b/drivers/tty/serial/sunhv.c
@@ -529,7 +529,7 @@ static int hv_probe(struct platform_device *op)
if (op->archdata.irqs[0] == 0xffffffff)
return -ENODEV;
- port = kzalloc_obj(struct uart_port, GFP_KERNEL);
+ port = kzalloc_obj(struct uart_port);
if (unlikely(!port))
return -ENOMEM;
diff --git a/drivers/tty/serial/sunsu.c b/drivers/tty/serial/sunsu.c
index 884985346226..6505a1930da9 100644
--- a/drivers/tty/serial/sunsu.c
+++ b/drivers/tty/serial/sunsu.c
@@ -1398,7 +1398,7 @@ static int su_probe(struct platform_device *op)
return -EINVAL;
up = &sunsu_ports[nr_inst];
} else {
- up = kzalloc_obj(*up, GFP_KERNEL);
+ up = kzalloc_obj(*up);
if (!up)
return -ENOMEM;
}
diff --git a/drivers/tty/serial/timbuart.c b/drivers/tty/serial/timbuart.c
index 48f1ef5e9bac..7a0326e7102a 100644
--- a/drivers/tty/serial/timbuart.c
+++ b/drivers/tty/serial/timbuart.c
@@ -412,7 +412,7 @@ static int timbuart_probe(struct platform_device *dev)
dev_dbg(&dev->dev, "%s\n", __func__);
- uart = kzalloc_obj(*uart, GFP_KERNEL);
+ uart = kzalloc_obj(*uart);
if (!uart) {
err = -EINVAL;
goto err_mem;
diff --git a/drivers/tty/serial/ucc_uart.c b/drivers/tty/serial/ucc_uart.c
index d7a39e36b53c..6b7dcbbacd13 100644
--- a/drivers/tty/serial/ucc_uart.c
+++ b/drivers/tty/serial/ucc_uart.c
@@ -1247,7 +1247,7 @@ static int ucc_uart_probe(struct platform_device *ofdev)
if (ret)
return ret;
- qe_port = kzalloc_obj(struct uart_qe_port, GFP_KERNEL);
+ qe_port = kzalloc_obj(struct uart_qe_port);
if (!qe_port) {
dev_err(&ofdev->dev, "can't allocate QE port structure\n");
return -ENOMEM;