Commit 77b425e4 authored by Jiri Slaby (SUSE)'s avatar Jiri Slaby (SUSE) Committed by Greg Kroah-Hartman
Browse files

tty: make tty_change_softcar() more understandable



* rename 'arg' to 'enable' as that is what it means.
* make 'bit' a tcflag_t, not int, as that is what cflags are.

Signed-off-by: default avatar"Jiri Slaby (SUSE)" <jirislaby@kernel.org>
Link: https://lore.kernel.org/r/20230810091510.13006-9-jirislaby@kernel.org


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d1150d29
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -737,17 +737,17 @@ static int set_ltchars(struct tty_struct *tty, struct ltchars __user *ltchars)
/**
 *	tty_change_softcar	-	carrier change ioctl helper
 *	@tty: tty to update
 *	@arg: enable/disable CLOCAL
 *	@enable: enable/disable CLOCAL
 *
 *	Perform a change to the CLOCAL state and call into the driver
 *	layer to make it visible. All done with the termios rwsem
 */

static int tty_change_softcar(struct tty_struct *tty, int arg)
static int tty_change_softcar(struct tty_struct *tty, bool enable)
{
	int ret = 0;
	int bit = arg ? CLOCAL : 0;
	struct ktermios old;
	tcflag_t bit = enable ? CLOCAL : 0;

	down_write(&tty->termios_rwsem);
	old = tty->termios;