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

tty: Cleanup tty_port_set_initialized() bool parameter

Make callers pass true/false consistently for bool val.

Reviewed-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Reviewed-by: Jiri Slaby <jirislaby@kernel.org>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Link: https://lore.kernel.org/r/20230117090358.4796-2-ilpo.jarvinen@linux.intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Ilpo Järvinen and committed by
Greg Kroah-Hartman
515be7ba 3bec2f77

+20 -20
+2 -2
drivers/ipack/devices/ipoctal.c
··· 647 647 tty_port_hangup(&channel->tty_port); 648 648 649 649 ipoctal_reset_channel(channel); 650 - tty_port_set_initialized(&channel->tty_port, 0); 650 + tty_port_set_initialized(&channel->tty_port, false); 651 651 wake_up_interruptible(&channel->tty_port.open_wait); 652 652 } 653 653 ··· 659 659 return; 660 660 661 661 ipoctal_reset_channel(channel); 662 - tty_port_set_initialized(&channel->tty_port, 0); 662 + tty_port_set_initialized(&channel->tty_port, false); 663 663 } 664 664 665 665 static void ipoctal_cleanup(struct tty_struct *tty)
+2 -2
drivers/s390/char/con3215.c
··· 629 629 if (tty_port_initialized(&raw->port)) 630 630 return 0; 631 631 raw->line_pos = 0; 632 - tty_port_set_initialized(&raw->port, 1); 632 + tty_port_set_initialized(&raw->port, true); 633 633 spin_lock_irqsave(get_ccwdev_lock(raw->cdev), flags); 634 634 raw3215_try_io(raw); 635 635 spin_unlock_irqrestore(get_ccwdev_lock(raw->cdev), flags); ··· 659 659 spin_lock_irqsave(get_ccwdev_lock(raw->cdev), flags); 660 660 remove_wait_queue(&raw->empty_wait, &wait); 661 661 set_current_state(TASK_RUNNING); 662 - tty_port_set_initialized(&raw->port, 1); 662 + tty_port_set_initialized(&raw->port, true); 663 663 } 664 664 spin_unlock_irqrestore(get_ccwdev_lock(raw->cdev), flags); 665 665 }
+2 -2
drivers/tty/amiserial.c
··· 502 502 */ 503 503 change_speed(tty, info, NULL); 504 504 505 - tty_port_set_initialized(port, 1); 505 + tty_port_set_initialized(port, true); 506 506 local_irq_restore(flags); 507 507 return 0; 508 508 ··· 556 556 557 557 set_bit(TTY_IO_ERROR, &tty->flags); 558 558 559 - tty_port_set_initialized(&info->tport, 0); 559 + tty_port_set_initialized(&info->tport, false); 560 560 local_irq_restore(flags); 561 561 } 562 562
+1 -1
drivers/tty/moxa.c
··· 1484 1484 MoxaPortLineCtrl(ch, 1, 1); 1485 1485 MoxaPortEnable(ch); 1486 1486 MoxaSetFifo(ch, ch->type == PORT_16550A); 1487 - tty_port_set_initialized(&ch->port, 1); 1487 + tty_port_set_initialized(&ch->port, true); 1488 1488 } 1489 1489 mutex_unlock(&ch->port.mutex); 1490 1490 mutex_unlock(&moxa_openlock);
+1 -1
drivers/tty/mxser.c
··· 1063 1063 } else { 1064 1064 retval = mxser_activate(port, tty); 1065 1065 if (retval == 0) 1066 - tty_port_set_initialized(port, 1); 1066 + tty_port_set_initialized(port, true); 1067 1067 } 1068 1068 mutex_unlock(&port->mutex); 1069 1069 return retval;
+2 -2
drivers/tty/n_gsm.c
··· 2059 2059 tty_port_tty_hangup(&dlci->port, false); 2060 2060 gsm_dlci_clear_queues(dlci->gsm, dlci); 2061 2061 /* Ensure that gsmtty_open() can return. */ 2062 - tty_port_set_initialized(&dlci->port, 0); 2062 + tty_port_set_initialized(&dlci->port, false); 2063 2063 wake_up_interruptible(&dlci->port.open_wait); 2064 2064 } else 2065 2065 dlci->gsm->dead = true; ··· 3880 3880 dlci->modem_rx = 0; 3881 3881 /* We could in theory open and close before we wait - eg if we get 3882 3882 a DM straight back. This is ok as that will have caused a hangup */ 3883 - tty_port_set_initialized(port, 1); 3883 + tty_port_set_initialized(port, true); 3884 3884 /* Start sending off SABM messages */ 3885 3885 if (gsm->initiator) 3886 3886 gsm_dlci_begin_open(dlci);
+3 -3
drivers/tty/serial/serial_core.c
··· 290 290 set_bit(TTY_IO_ERROR, &tty->flags); 291 291 292 292 if (tty_port_initialized(port)) { 293 - tty_port_set_initialized(port, 0); 293 + tty_port_set_initialized(port, false); 294 294 295 295 /* 296 296 * Turn off DTR and RTS early. ··· 2347 2347 unsigned int mctrl; 2348 2348 2349 2349 tty_port_set_suspended(port, 1); 2350 - tty_port_set_initialized(port, 0); 2350 + tty_port_set_initialized(port, false); 2351 2351 2352 2352 spin_lock_irq(&uport->lock); 2353 2353 ops->stop_tx(uport); ··· 2458 2458 uart_rs485_config(uport); 2459 2459 ops->start_tx(uport); 2460 2460 spin_unlock_irq(&uport->lock); 2461 - tty_port_set_initialized(port, 1); 2461 + tty_port_set_initialized(port, true); 2462 2462 } else { 2463 2463 /* 2464 2464 * Failed to resume - maybe hardware went away?
+2 -2
drivers/tty/tty_port.c
··· 367 367 goto out; 368 368 369 369 if (tty_port_initialized(port)) { 370 - tty_port_set_initialized(port, 0); 370 + tty_port_set_initialized(port, false); 371 371 /* 372 372 * Drop DTR/RTS if HUPCL is set. This causes any attached 373 373 * modem to hang up the line. ··· 788 788 return retval; 789 789 } 790 790 } 791 - tty_port_set_initialized(port, 1); 791 + tty_port_set_initialized(port, true); 792 792 } 793 793 mutex_unlock(&port->mutex); 794 794 return tty_port_block_til_ready(port, tty, filp);
+1 -1
drivers/usb/serial/console.c
··· 169 169 tty_save_termios(tty); 170 170 tty_kref_put(tty); 171 171 } 172 - tty_port_set_initialized(&port->port, 1); 172 + tty_port_set_initialized(&port->port, true); 173 173 } 174 174 /* Now that any required fake tty operations are completed restore 175 175 * the tty port count */