Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tty: make tty_set_operations an inline

Since commit f34d7a5b7010 (tty: The big operations rework) in 2008,
tty_set_operations() is a simple one-line assignment. There is no reason
for this to be an exported function, hence move it to a header and make
an inline from that.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Link: https://lore.kernel.org/r/20210723074317.32690-7-jslaby@suse.cz
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Jiri Slaby and committed by
Greg Kroah-Hartman
cb9ea618 56ec5880

+6 -9
-7
drivers/tty/tty_io.c
··· 3438 3438 } 3439 3439 EXPORT_SYMBOL(tty_driver_kref_put); 3440 3440 3441 - void tty_set_operations(struct tty_driver *driver, 3442 - const struct tty_operations *op) 3443 - { 3444 - driver->ops = op; 3445 - }; 3446 - EXPORT_SYMBOL(tty_set_operations); 3447 - 3448 3441 void put_tty_driver(struct tty_driver *d) 3449 3442 { 3450 3443 tty_driver_kref_put(d);
+6 -2
include/linux/tty_driver.h
··· 330 330 extern struct tty_driver *__tty_alloc_driver(unsigned int lines, 331 331 struct module *owner, unsigned long flags); 332 332 extern void put_tty_driver(struct tty_driver *driver); 333 - extern void tty_set_operations(struct tty_driver *driver, 334 - const struct tty_operations *op); 335 333 extern struct tty_driver *tty_find_polling_driver(char *name, int *line); 336 334 337 335 extern void tty_driver_kref_put(struct tty_driver *driver); ··· 342 344 { 343 345 kref_get(&d->kref); 344 346 return d; 347 + } 348 + 349 + static inline void tty_set_operations(struct tty_driver *driver, 350 + const struct tty_operations *op) 351 + { 352 + driver->ops = op; 345 353 } 346 354 347 355 /* tty driver magic number */