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

tty: drop tty_schedule_flip()

Since commit a9c3f68f3cd8d (tty: Fix low_latency BUG) in 2014,
tty_flip_buffer_push() is only a wrapper to tty_schedule_flip(). All
users were converted in the previous patches, so remove
tty_schedule_flip() completely while inlining its body into
tty_flip_buffer_push().

One less exported function.

Reviewed-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
Link: https://lore.kernel.org/r/20211122111648.30379-4-jslaby@suse.cz
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Jiri Slaby and committed by
Greg Kroah-Hartman
5db96ef2 b68b9144

+8 -23
+8 -22
drivers/tty/tty_buffer.c
··· 402 402 EXPORT_SYMBOL(__tty_insert_flip_char); 403 403 404 404 /** 405 - * tty_schedule_flip - push characters to ldisc 406 - * @port: tty port to push from 407 - * 408 - * Takes any pending buffers and transfers their ownership to the 409 - * ldisc side of the queue. It then schedules those characters for 410 - * processing by the line discipline. 411 - */ 412 - 413 - void tty_schedule_flip(struct tty_port *port) 414 - { 415 - struct tty_bufhead *buf = &port->buf; 416 - 417 - /* paired w/ acquire in flush_to_ldisc(); ensures 418 - * flush_to_ldisc() sees buffer data. 419 - */ 420 - smp_store_release(&buf->tail->commit, buf->tail->used); 421 - queue_work(system_unbound_wq, &buf->work); 422 - } 423 - EXPORT_SYMBOL(tty_schedule_flip); 424 - 425 - /** 426 405 * tty_prepare_flip_string - make room for characters 427 406 * @port: tty port 428 407 * @chars: return pointer for character write area ··· 545 566 546 567 void tty_flip_buffer_push(struct tty_port *port) 547 568 { 548 - tty_schedule_flip(port); 569 + struct tty_bufhead *buf = &port->buf; 570 + 571 + /* 572 + * Paired w/ acquire in flush_to_ldisc(); ensures flush_to_ldisc() sees 573 + * buffer data. 574 + */ 575 + smp_store_release(&buf->tail->commit, buf->tail->used); 576 + queue_work(system_unbound_wq, &buf->work); 549 577 } 550 578 EXPORT_SYMBOL(tty_flip_buffer_push); 551 579
-1
include/linux/tty_flip.h
··· 17 17 int tty_prepare_flip_string(struct tty_port *port, unsigned char **chars, 18 18 size_t size); 19 19 void tty_flip_buffer_push(struct tty_port *port); 20 - void tty_schedule_flip(struct tty_port *port); 21 20 int __tty_insert_flip_char(struct tty_port *port, unsigned char ch, char flag); 22 21 23 22 static inline int tty_insert_flip_char(struct tty_port *port,