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

tty: vt: reformat tioclinux()



Reformat tioclinux() to what we are used to. That is:
* format switch-case (one less indent level),
* format comments (the same indent level), and
* add a newline before return.

Signed-off-by: default avatarJiri Slaby (SUSE) <jirislaby@kernel.org>
Link: https://lore.kernel.org/r/20230420093559.13200-1-jirislaby@kernel.org


Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent f06c2a90
Loading
Loading
Loading
Loading
+84 −83
Original line number Diff line number Diff line
@@ -3143,8 +3143,7 @@ int tioclinux(struct tty_struct *tty, unsigned long arg)
		return -EFAULT;
	ret = 0;

	switch (type)
	{
	switch (type) {
	case TIOCL_SETSEL:
		ret = set_selection_user((struct tiocl_selection
					 __user *)(p+1), tty);
@@ -3163,12 +3162,11 @@ int tioclinux(struct tty_struct *tty, unsigned long arg)
		console_unlock();
		break;
	case TIOCL_GETSHIFTSTATE:

		/*
	 * Make it possible to react to Shift+Mousebutton.
	 * Note that 'shift_state' is an undocumented
	 * kernel-internal variable; programs not closely
	 * related to the kernel should not use this.
		 * Make it possible to react to Shift+Mousebutton. Note that
		 * 'shift_state' is an undocumented kernel-internal variable;
		 * programs not closely related to the kernel should not use
		 * this.
		 */
		data = vt_get_shift_state();
		ret = put_user(data, p);
@@ -3199,18 +3197,20 @@ int tioclinux(struct tty_struct *tty, unsigned long arg)
		}
		break;
	case TIOCL_GETFGCONSOLE:
			/* No locking needed as this is a transiently
			   correct return anyway if the caller hasn't
			   disabled switching */
		/*
		 * No locking needed as this is a transiently correct return
		 * anyway if the caller hasn't disabled switching.
		 */
		ret = fg_console;
		break;
	case TIOCL_SCROLLCONSOLE:
		if (get_user(lines, (s32 __user *)(p+4))) {
			ret = -EFAULT;
		} else {
				/* Need the console lock here. Note that lots
				   of other calls need fixing before the lock
				   is actually useful ! */
			/*
			 * Needs the console lock here. Note that lots of other
			 * calls need fixing before the lock is actually useful!
			 */
			console_lock();
			scrollfront(vc_cons[fg_console].d, lines);
			console_unlock();
@@ -3230,6 +3230,7 @@ int tioclinux(struct tty_struct *tty, unsigned long arg)
		ret = -EINVAL;
		break;
	}

	return ret;
}