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

tty/serial: Make ->dcd_change()+uart_handle_dcd_change() status bool active

Convert status parameter for ->dcd_change() and
uart_handle_dcd_change() to bool which matches to how the parameter is
used.

Rename status to active to better describe what the parameter means.

Acked-by: Rodolfo Giometti <giometti@enneenne.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-9-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
0388a152 5d420399

+14 -15
+3 -3
drivers/pps/clients/pps-ldisc.c
··· 13 13 #include <linux/pps_kernel.h> 14 14 #include <linux/bug.h> 15 15 16 - static void pps_tty_dcd_change(struct tty_struct *tty, unsigned int status) 16 + static void pps_tty_dcd_change(struct tty_struct *tty, bool active) 17 17 { 18 18 struct pps_device *pps; 19 19 struct pps_event_time ts; ··· 29 29 return; 30 30 31 31 /* Now do the PPS event report */ 32 - pps_event(pps, &ts, status ? PPS_CAPTUREASSERT : 32 + pps_event(pps, &ts, active ? PPS_CAPTUREASSERT : 33 33 PPS_CAPTURECLEAR, NULL); 34 34 35 35 dev_dbg(pps->dev, "PPS %s at %lu\n", 36 - status ? "assert" : "clear", jiffies); 36 + active ? "assert" : "clear", jiffies); 37 37 } 38 38 39 39 static int (*alias_n_tty_open)(struct tty_struct *tty);
+4 -4
drivers/tty/serial/serial_core.c
··· 3252 3252 /** 3253 3253 * uart_handle_dcd_change - handle a change of carrier detect state 3254 3254 * @uport: uart_port structure for the open port 3255 - * @status: new carrier detect status, nonzero if active 3255 + * @active: new carrier detect status 3256 3256 * 3257 3257 * Caller must hold uport->lock. 3258 3258 */ 3259 - void uart_handle_dcd_change(struct uart_port *uport, unsigned int status) 3259 + void uart_handle_dcd_change(struct uart_port *uport, bool active) 3260 3260 { 3261 3261 struct tty_port *port = &uport->state->port; 3262 3262 struct tty_struct *tty = port->tty; ··· 3268 3268 ld = tty_ldisc_ref(tty); 3269 3269 if (ld) { 3270 3270 if (ld->ops->dcd_change) 3271 - ld->ops->dcd_change(tty, status); 3271 + ld->ops->dcd_change(tty, active); 3272 3272 tty_ldisc_deref(ld); 3273 3273 } 3274 3274 } ··· 3276 3276 uport->icount.dcd++; 3277 3277 3278 3278 if (uart_dcd_enabled(uport)) { 3279 - if (status) 3279 + if (active) 3280 3280 wake_up_interruptible(&port->open_wait); 3281 3281 else if (tty) 3282 3282 tty_hangup(tty);
+4 -4
drivers/tty/serial/sunhv.c
··· 87 87 88 88 if (c == CON_HUP) { 89 89 hung_up = 1; 90 - uart_handle_dcd_change(port, 0); 90 + uart_handle_dcd_change(port, false); 91 91 } else if (hung_up) { 92 92 hung_up = 0; 93 - uart_handle_dcd_change(port, 1); 93 + uart_handle_dcd_change(port, true); 94 94 } 95 95 96 96 if (port->state == NULL) { ··· 133 133 bytes_read = 1; 134 134 } else if (stat == CON_HUP) { 135 135 hung_up = 1; 136 - uart_handle_dcd_change(port, 0); 136 + uart_handle_dcd_change(port, false); 137 137 continue; 138 138 } else { 139 139 /* HV_EWOULDBLOCK, etc. */ ··· 143 143 144 144 if (hung_up) { 145 145 hung_up = 0; 146 - uart_handle_dcd_change(port, 1); 146 + uart_handle_dcd_change(port, true); 147 147 } 148 148 149 149 if (port->sysrq != 0 && *con_read_page) {
+1 -2
include/linux/serial_core.h
··· 897 897 * The following are helper functions for the low level drivers. 898 898 */ 899 899 900 - extern void uart_handle_dcd_change(struct uart_port *uport, 901 - unsigned int status); 900 + extern void uart_handle_dcd_change(struct uart_port *uport, bool active); 902 901 extern void uart_handle_cts_change(struct uart_port *uport, 903 902 unsigned int status); 904 903
+2 -2
include/linux/tty_ldisc.h
··· 170 170 * send, please arise a tasklet or workqueue to do the real data transfer. 171 171 * Do not send data in this hook, it may lead to a deadlock. 172 172 * 173 - * @dcd_change: [DRV] ``void ()(struct tty_struct *tty, unsigned int status)`` 173 + * @dcd_change: [DRV] ``void ()(struct tty_struct *tty, bool active)`` 174 174 * 175 175 * Tells the discipline that the DCD pin has changed its status. Used 176 176 * exclusively by the %N_PPS (Pulse-Per-Second) line discipline. ··· 238 238 void (*receive_buf)(struct tty_struct *tty, const unsigned char *cp, 239 239 const char *fp, int count); 240 240 void (*write_wakeup)(struct tty_struct *tty); 241 - void (*dcd_change)(struct tty_struct *tty, unsigned int status); 241 + void (*dcd_change)(struct tty_struct *tty, bool active); 242 242 int (*receive_buf2)(struct tty_struct *tty, const unsigned char *cp, 243 243 const char *fp, int count); 244 244 void (*lookahead_buf)(struct tty_struct *tty, const unsigned char *cp,