summaryrefslogtreecommitdiff
path: root/drivers/tty
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
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/tty')
-rw-r--r--drivers/tty/ehv_bytechan.c2
-rw-r--r--drivers/tty/hvc/hvc_iucv.c2
-rw-r--r--drivers/tty/hvc/hvc_opal.c2
-rw-r--r--drivers/tty/hvc/hvc_vio.c2
-rw-r--r--drivers/tty/hvc/hvc_xen.c8
-rw-r--r--drivers/tty/hvc/hvcs.c4
-rw-r--r--drivers/tty/ipwireless/hardware.c2
-rw-r--r--drivers/tty/ipwireless/main.c2
-rw-r--r--drivers/tty/ipwireless/network.c4
-rw-r--r--drivers/tty/ipwireless/tty.c2
-rw-r--r--drivers/tty/n_gsm.c2
-rw-r--r--drivers/tty/n_hdlc.c2
-rw-r--r--drivers/tty/nozomi.c2
-rw-r--r--drivers/tty/pty.c4
-rw-r--r--drivers/tty/rpmsg_tty.c2
-rw-r--r--drivers/tty/serdev/core.c2
-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
-rw-r--r--drivers/tty/synclink_gt.c2
-rw-r--r--drivers/tty/sysrq.c2
-rw-r--r--drivers/tty/tty_audit.c2
-rw-r--r--drivers/tty/tty_io.c14
-rw-r--r--drivers/tty/vcc.c4
-rw-r--r--drivers/tty/vt/consolemap.c2
-rw-r--r--drivers/tty/vt/vc_screen.c2
-rw-r--r--drivers/tty/vt/vt.c2
41 files changed, 55 insertions, 55 deletions
diff --git a/drivers/tty/ehv_bytechan.c b/drivers/tty/ehv_bytechan.c
index 2cbbaed14ee6..2b3ca9f6bf07 100644
--- a/drivers/tty/ehv_bytechan.c
+++ b/drivers/tty/ehv_bytechan.c
@@ -772,7 +772,7 @@ static int __init ehv_bc_init(void)
* array, then you can use pointer math (e.g. "bc - bcs") to get its
* tty index.
*/
- bcs = kzalloc_objs(struct ehv_bc_data, count, GFP_KERNEL);
+ bcs = kzalloc_objs(struct ehv_bc_data, count);
if (!bcs)
return -ENOMEM;
diff --git a/drivers/tty/hvc/hvc_iucv.c b/drivers/tty/hvc/hvc_iucv.c
index 7fd3937d1396..1dcdb9e99bd8 100644
--- a/drivers/tty/hvc/hvc_iucv.c
+++ b/drivers/tty/hvc/hvc_iucv.c
@@ -1050,7 +1050,7 @@ static int __init hvc_iucv_alloc(int id, unsigned int is_console)
char name[9];
int rc;
- priv = kzalloc_obj(struct hvc_iucv_private, GFP_KERNEL);
+ priv = kzalloc_obj(struct hvc_iucv_private);
if (!priv)
return -ENOMEM;
diff --git a/drivers/tty/hvc/hvc_opal.c b/drivers/tty/hvc/hvc_opal.c
index 72dfab77890c..402da9e7c534 100644
--- a/drivers/tty/hvc/hvc_opal.c
+++ b/drivers/tty/hvc/hvc_opal.c
@@ -181,7 +181,7 @@ static int hvc_opal_probe(struct platform_device *dev)
pv = hvc_opal_privs[termno];
boot = 1;
} else if (hvc_opal_privs[termno] == NULL) {
- pv = kzalloc_obj(struct hvc_opal_priv, GFP_KERNEL);
+ pv = kzalloc_obj(struct hvc_opal_priv);
if (!pv)
return -ENOMEM;
pv->proto = proto;
diff --git a/drivers/tty/hvc/hvc_vio.c b/drivers/tty/hvc/hvc_vio.c
index 8725cc77c557..14c6a5564617 100644
--- a/drivers/tty/hvc/hvc_vio.c
+++ b/drivers/tty/hvc/hvc_vio.c
@@ -338,7 +338,7 @@ static int hvc_vio_probe(struct vio_dev *vdev,
pr_devel("->non-boot console, using termno %d\n", termno);
if (termno < 0)
return -ENODEV;
- pv = kzalloc_obj(struct hvterm_priv, GFP_KERNEL);
+ pv = kzalloc_obj(struct hvterm_priv);
if (!pv)
return -ENOMEM;
pv->termno = vdev->unit_address;
diff --git a/drivers/tty/hvc/hvc_xen.c b/drivers/tty/hvc/hvc_xen.c
index 138afdf3bbc4..7f0b6262488c 100644
--- a/drivers/tty/hvc/hvc_xen.c
+++ b/drivers/tty/hvc/hvc_xen.c
@@ -264,7 +264,7 @@ static int xen_hvm_console_init(void)
info = vtermno_to_xencons(HVC_COOKIE);
if (!info) {
- info = kzalloc_obj(struct xencons_info, GFP_KERNEL);
+ info = kzalloc_obj(struct xencons_info);
if (!info)
return -ENOMEM;
spin_lock_init(&info->ring_lock);
@@ -328,7 +328,7 @@ static int xen_pv_console_init(void)
info = vtermno_to_xencons(HVC_COOKIE);
if (!info) {
- info = kzalloc_obj(struct xencons_info, GFP_KERNEL);
+ info = kzalloc_obj(struct xencons_info);
if (!info)
return -ENOMEM;
} else if (info->intf != NULL) {
@@ -352,7 +352,7 @@ static int xen_initial_domain_console_init(void)
info = vtermno_to_xencons(HVC_COOKIE);
if (!info) {
- info = kzalloc_obj(struct xencons_info, GFP_KERNEL);
+ info = kzalloc_obj(struct xencons_info);
if (!info)
return -ENOMEM;
spin_lock_init(&info->ring_lock);
@@ -513,7 +513,7 @@ static int xencons_probe(struct xenbus_device *dev,
if (devid == 0)
return -ENODEV;
- info = kzalloc_obj(struct xencons_info, GFP_KERNEL);
+ info = kzalloc_obj(struct xencons_info);
if (!info)
return -ENOMEM;
spin_lock_init(&info->ring_lock);
diff --git a/drivers/tty/hvc/hvcs.c b/drivers/tty/hvc/hvcs.c
index 7ff3c87354b8..d32b1e3c50bf 100644
--- a/drivers/tty/hvc/hvcs.c
+++ b/drivers/tty/hvc/hvcs.c
@@ -748,7 +748,7 @@ static int hvcs_probe(
return -EFAULT;
}
- hvcsd = kzalloc_obj(*hvcsd, GFP_KERNEL);
+ hvcsd = kzalloc_obj(*hvcsd);
if (!hvcsd)
return -ENODEV;
@@ -1394,7 +1394,7 @@ static int hvcs_alloc_index_list(int n)
{
int i;
- hvcs_index_list = kmalloc_objs(hvcs_index_count, n, GFP_KERNEL);
+ hvcs_index_list = kmalloc_objs(hvcs_index_count, n);
if (!hvcs_index_list)
return -ENOMEM;
hvcs_index_count = n;
diff --git a/drivers/tty/ipwireless/hardware.c b/drivers/tty/ipwireless/hardware.c
index 6e6aa90b33ba..0bfcbca6e2df 100644
--- a/drivers/tty/ipwireless/hardware.c
+++ b/drivers/tty/ipwireless/hardware.c
@@ -1618,7 +1618,7 @@ struct ipw_hardware *ipwireless_hardware_create(void)
{
int i;
struct ipw_hardware *hw =
- kzalloc_obj(struct ipw_hardware, GFP_KERNEL);
+ kzalloc_obj(struct ipw_hardware);
if (!hw)
return NULL;
diff --git a/drivers/tty/ipwireless/main.c b/drivers/tty/ipwireless/main.c
index 3bf160d62a1e..a2875823290e 100644
--- a/drivers/tty/ipwireless/main.c
+++ b/drivers/tty/ipwireless/main.c
@@ -267,7 +267,7 @@ static int ipwireless_attach(struct pcmcia_device *link)
struct ipw_dev *ipw;
int ret;
- ipw = kzalloc_obj(struct ipw_dev, GFP_KERNEL);
+ ipw = kzalloc_obj(struct ipw_dev);
if (!ipw)
return -ENOMEM;
diff --git a/drivers/tty/ipwireless/network.c b/drivers/tty/ipwireless/network.c
index cb864142be09..ad2c5157a018 100644
--- a/drivers/tty/ipwireless/network.c
+++ b/drivers/tty/ipwireless/network.c
@@ -257,7 +257,7 @@ static void do_go_online(struct work_struct *work_go_online)
struct ppp_channel *channel;
spin_unlock_irqrestore(&network->lock, flags);
- channel = kzalloc_obj(struct ppp_channel, GFP_KERNEL);
+ channel = kzalloc_obj(struct ppp_channel);
if (!channel) {
printk(KERN_ERR IPWIRELESS_PCCARD_NAME
": unable to allocate PPP channel\n");
@@ -416,7 +416,7 @@ void ipwireless_network_packet_received(struct ipw_network *network,
struct ipw_network *ipwireless_network_create(struct ipw_hardware *hw)
{
struct ipw_network *network =
- kzalloc_obj(struct ipw_network, GFP_KERNEL);
+ kzalloc_obj(struct ipw_network);
if (!network)
return NULL;
diff --git a/drivers/tty/ipwireless/tty.c b/drivers/tty/ipwireless/tty.c
index 79c01ff49c65..ffdbcdd041a3 100644
--- a/drivers/tty/ipwireless/tty.c
+++ b/drivers/tty/ipwireless/tty.c
@@ -437,7 +437,7 @@ static int add_tty(int j,
struct ipw_network *network, int channel_idx,
int secondary_channel_idx, int tty_type)
{
- ttys[j] = kzalloc_obj(struct ipw_tty, GFP_KERNEL);
+ ttys[j] = kzalloc_obj(struct ipw_tty);
if (!ttys[j])
return -ENOMEM;
ttys[j]->index = j;
diff --git a/drivers/tty/n_gsm.c b/drivers/tty/n_gsm.c
index 815e35a24af9..c13e050de83b 100644
--- a/drivers/tty/n_gsm.c
+++ b/drivers/tty/n_gsm.c
@@ -3275,7 +3275,7 @@ static inline unsigned int mux_line_to_num(unsigned int line)
static struct gsm_mux *gsm_alloc_mux(void)
{
int i;
- struct gsm_mux *gsm = kzalloc_obj(struct gsm_mux, GFP_KERNEL);
+ struct gsm_mux *gsm = kzalloc_obj(struct gsm_mux);
if (gsm == NULL)
return NULL;
gsm->buf = kmalloc(MAX_MRU + 1, GFP_KERNEL);
diff --git a/drivers/tty/n_hdlc.c b/drivers/tty/n_hdlc.c
index 6c685a6d4ddb..bf827ae3e5c8 100644
--- a/drivers/tty/n_hdlc.c
+++ b/drivers/tty/n_hdlc.c
@@ -686,7 +686,7 @@ static void n_hdlc_alloc_buf(struct n_hdlc_buf_list *list, unsigned int count,
*/
static struct n_hdlc *n_hdlc_alloc(void)
{
- struct n_hdlc *n_hdlc = kzalloc_obj(*n_hdlc, GFP_KERNEL);
+ struct n_hdlc *n_hdlc = kzalloc_obj(*n_hdlc);
if (!n_hdlc)
return NULL;
diff --git a/drivers/tty/nozomi.c b/drivers/tty/nozomi.c
index b05f4a8553ac..ed99dbc9f990 100644
--- a/drivers/tty/nozomi.c
+++ b/drivers/tty/nozomi.c
@@ -1298,7 +1298,7 @@ static int nozomi_card_init(struct pci_dev *pdev,
goto err;
}
- dc = kzalloc_obj(struct nozomi, GFP_KERNEL);
+ dc = kzalloc_obj(struct nozomi);
if (unlikely(!dc)) {
dev_err(&pdev->dev, "Could not allocate memory\n");
ret = -ENOMEM;
diff --git a/drivers/tty/pty.c b/drivers/tty/pty.c
index ce58997dae93..cb427e93372d 100644
--- a/drivers/tty/pty.c
+++ b/drivers/tty/pty.c
@@ -364,8 +364,8 @@ static int pty_common_install(struct tty_driver *driver, struct tty_struct *tty,
if (driver->subtype != PTY_TYPE_MASTER)
return -EIO;
- ports[0] = kmalloc_obj(**ports, GFP_KERNEL);
- ports[1] = kmalloc_obj(**ports, GFP_KERNEL);
+ ports[0] = kmalloc_obj(**ports);
+ ports[1] = kmalloc_obj(**ports);
if (!ports[0] || !ports[1])
goto err;
if (!try_module_get(driver->other->owner)) {
diff --git a/drivers/tty/rpmsg_tty.c b/drivers/tty/rpmsg_tty.c
index 6ada8e92bbf2..c5fd6d9b380f 100644
--- a/drivers/tty/rpmsg_tty.c
+++ b/drivers/tty/rpmsg_tty.c
@@ -134,7 +134,7 @@ static struct rpmsg_tty_port *rpmsg_tty_alloc_cport(void)
struct rpmsg_tty_port *cport;
int ret;
- cport = kzalloc_obj(*cport, GFP_KERNEL);
+ cport = kzalloc_obj(*cport);
if (!cport)
return ERR_PTR(-ENOMEM);
diff --git a/drivers/tty/serdev/core.c b/drivers/tty/serdev/core.c
index aced9d895103..8f25510f89b6 100644
--- a/drivers/tty/serdev/core.c
+++ b/drivers/tty/serdev/core.c
@@ -442,7 +442,7 @@ struct serdev_device *serdev_device_alloc(struct serdev_controller *ctrl)
{
struct serdev_device *serdev;
- serdev = kzalloc_obj(*serdev, GFP_KERNEL);
+ serdev = kzalloc_obj(*serdev);
if (!serdev)
return NULL;
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;
diff --git a/drivers/tty/synclink_gt.c b/drivers/tty/synclink_gt.c
index 06af5c4349ec..bf4f50e0ce94 100644
--- a/drivers/tty/synclink_gt.c
+++ b/drivers/tty/synclink_gt.c
@@ -3477,7 +3477,7 @@ static struct slgt_info *alloc_dev(int adapter_num, int port_num, struct pci_dev
{
struct slgt_info *info;
- info = kzalloc_obj(struct slgt_info, GFP_KERNEL);
+ info = kzalloc_obj(struct slgt_info);
if (!info) {
DBGERR(("%s device alloc failed adapter=%d port=%d\n",
diff --git a/drivers/tty/sysrq.c b/drivers/tty/sysrq.c
index 4aaa3e04e035..c2e4b31b699a 100644
--- a/drivers/tty/sysrq.c
+++ b/drivers/tty/sysrq.c
@@ -971,7 +971,7 @@ static int sysrq_connect(struct input_handler *handler,
struct sysrq_state *sysrq;
int error;
- sysrq = kzalloc_obj(struct sysrq_state, GFP_KERNEL);
+ sysrq = kzalloc_obj(struct sysrq_state);
if (!sysrq)
return -ENOMEM;
diff --git a/drivers/tty/tty_audit.c b/drivers/tty/tty_audit.c
index e7964d319498..d014af6ab060 100644
--- a/drivers/tty/tty_audit.c
+++ b/drivers/tty/tty_audit.c
@@ -35,7 +35,7 @@ static struct tty_audit_buf *tty_audit_buf_alloc(void)
{
struct tty_audit_buf *buf;
- buf = kzalloc_obj(*buf, GFP_KERNEL);
+ buf = kzalloc_obj(*buf);
if (!buf)
goto err;
diff --git a/drivers/tty/tty_io.c b/drivers/tty/tty_io.c
index 506b6c6329c2..0b9a19afc3e7 100644
--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
@@ -183,7 +183,7 @@ int tty_alloc_file(struct file *file)
{
struct tty_file_private *priv;
- priv = kmalloc_obj(*priv, GFP_KERNEL);
+ priv = kmalloc_obj(*priv);
if (!priv)
return -ENOMEM;
@@ -1471,7 +1471,7 @@ void tty_save_termios(struct tty_struct *tty)
/* Stash the termios data */
tp = tty->driver->termios[idx];
if (tp == NULL) {
- tp = kmalloc_obj(*tp, GFP_KERNEL);
+ tp = kmalloc_obj(*tp);
if (tp == NULL)
return;
tty->driver->termios[idx] = tp;
@@ -3244,7 +3244,7 @@ struct device *tty_register_device_attr(struct tty_driver *driver,
else
tty_line_name(driver, index, name);
- dev = kzalloc_obj(*dev, GFP_KERNEL);
+ dev = kzalloc_obj(*dev);
if (!dev)
return ERR_PTR(-ENOMEM);
@@ -3333,7 +3333,7 @@ struct tty_driver *__tty_alloc_driver(unsigned int lines, struct module *owner,
if (!lines || (flags & TTY_DRIVER_UNNUMBERED_NODE && lines > 1))
return ERR_PTR(-EINVAL);
- driver = kzalloc_obj(*driver, GFP_KERNEL);
+ driver = kzalloc_obj(*driver);
if (!driver)
return ERR_PTR(-ENOMEM);
@@ -3343,7 +3343,7 @@ struct tty_driver *__tty_alloc_driver(unsigned int lines, struct module *owner,
driver->flags = flags;
if (!(flags & TTY_DRIVER_DEVPTS_MEM)) {
- driver->ttys = kzalloc_objs(*driver->ttys, lines, GFP_KERNEL);
+ driver->ttys = kzalloc_objs(*driver->ttys, lines);
driver->termios = kzalloc_objs(*driver->termios, lines,
GFP_KERNEL);
if (!driver->ttys || !driver->termios) {
@@ -3353,7 +3353,7 @@ struct tty_driver *__tty_alloc_driver(unsigned int lines, struct module *owner,
}
if (!(flags & TTY_DRIVER_DYNAMIC_ALLOC)) {
- driver->ports = kzalloc_objs(*driver->ports, lines, GFP_KERNEL);
+ driver->ports = kzalloc_objs(*driver->ports, lines);
if (!driver->ports) {
err = -ENOMEM;
goto err_free_all;
@@ -3361,7 +3361,7 @@ struct tty_driver *__tty_alloc_driver(unsigned int lines, struct module *owner,
cdevs = lines;
}
- driver->cdevs = kzalloc_objs(*driver->cdevs, cdevs, GFP_KERNEL);
+ driver->cdevs = kzalloc_objs(*driver->cdevs, cdevs);
if (!driver->cdevs) {
err = -ENOMEM;
goto err_free_all;
diff --git a/drivers/tty/vcc.c b/drivers/tty/vcc.c
index cd741fbe6fbe..27a55465bf5e 100644
--- a/drivers/tty/vcc.c
+++ b/drivers/tty/vcc.c
@@ -574,7 +574,7 @@ static int vcc_probe(struct vio_dev *vdev, const struct vio_device_id *id)
return -ENODEV;
}
- port = kzalloc_obj(struct vcc_port, GFP_KERNEL);
+ port = kzalloc_obj(struct vcc_port);
if (!port)
return -ENOMEM;
@@ -957,7 +957,7 @@ static int vcc_install(struct tty_driver *driver, struct tty_struct *tty)
if (ret)
return ret;
- port_tty = kzalloc_obj(struct tty_port, GFP_KERNEL);
+ port_tty = kzalloc_obj(struct tty_port);
if (!port_tty)
return -ENOMEM;
diff --git a/drivers/tty/vt/consolemap.c b/drivers/tty/vt/consolemap.c
index 97cf1ceb6709..3fa89a2dbeba 100644
--- a/drivers/tty/vt/consolemap.c
+++ b/drivers/tty/vt/consolemap.c
@@ -539,7 +539,7 @@ static int con_allocate_new(struct vc_data *vc)
{
struct uni_pagedict *new, *old = *vc->uni_pagedict_loc;
- new = kzalloc_obj(*new, GFP_KERNEL);
+ new = kzalloc_obj(*new);
if (!new)
return -ENOMEM;
diff --git a/drivers/tty/vt/vc_screen.c b/drivers/tty/vt/vc_screen.c
index 824a74626548..4d2d46c95fef 100644
--- a/drivers/tty/vt/vc_screen.c
+++ b/drivers/tty/vt/vc_screen.c
@@ -131,7 +131,7 @@ vcs_poll_data_get(struct file *file)
if (poll)
return poll;
- poll = kzalloc_obj(*poll, GFP_KERNEL);
+ poll = kzalloc_obj(*poll);
if (!poll)
return NULL;
poll->cons_num = console(file_inode(file));
diff --git a/drivers/tty/vt/vt.c b/drivers/tty/vt/vt.c
index cca7bdf8f2fe..c1f152d8b03b 100644
--- a/drivers/tty/vt/vt.c
+++ b/drivers/tty/vt/vt.c
@@ -1065,7 +1065,7 @@ int vc_allocate(unsigned int currcons) /* return 0 on success */
/* although the numbers above are not valid since long ago, the
point is still up-to-date and the comment still has its value
even if only as a historical artifact. --mj, July 1998 */
- param.vc = vc = kzalloc_obj(struct vc_data, GFP_KERNEL);
+ param.vc = vc = kzalloc_obj(struct vc_data);
if (!vc)
return -ENOMEM;