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

Configure Feed

Select the types of activity you want to include in your feed.

tty: n_tty: rename and retype 'retval' in n_tty_ioctl()

The value stored to the current 'retval' is number of characters. It is
both obtained and put to user as unsigned. So make its type unsigned.
And provided it's not a "return value" per se, rename it to 'num'.

Signed-off-by: "Jiri Slaby (SUSE)" <jirislaby@kernel.org>
Link: https://lore.kernel.org/r/20230919085156.1578-3-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Jiri Slaby (SUSE) and committed by
Greg Kroah-Hartman
1e619477 4a2ad266

+4 -4
+4 -4
drivers/tty/n_tty.c
··· 2498 2498 unsigned long arg) 2499 2499 { 2500 2500 struct n_tty_data *ldata = tty->disc_data; 2501 - int retval; 2501 + unsigned int num; 2502 2502 2503 2503 switch (cmd) { 2504 2504 case TIOCOUTQ: ··· 2506 2506 case TIOCINQ: 2507 2507 down_write(&tty->termios_rwsem); 2508 2508 if (L_ICANON(tty) && !L_EXTPROC(tty)) 2509 - retval = inq_canon(ldata); 2509 + num = inq_canon(ldata); 2510 2510 else 2511 - retval = read_cnt(ldata); 2511 + num = read_cnt(ldata); 2512 2512 up_write(&tty->termios_rwsem); 2513 - return put_user(retval, (unsigned int __user *) arg); 2513 + return put_user(num, (unsigned int __user *) arg); 2514 2514 default: 2515 2515 return n_tty_ioctl_helper(tty, cmd, arg); 2516 2516 }