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/tty/tty_io.c | |
| 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/tty/tty_io.c')
| -rw-r--r-- | drivers/tty/tty_io.c | 14 |
1 files changed, 7 insertions, 7 deletions
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; |
