mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-10-06 00:39:48 +00:00
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>
This commit is contained in:
parent
4a2ad26613
commit
1e619477a9
1 changed files with 4 additions and 4 deletions
|
@ -2498,7 +2498,7 @@ static int n_tty_ioctl(struct tty_struct *tty, unsigned int cmd,
|
||||||
unsigned long arg)
|
unsigned long arg)
|
||||||
{
|
{
|
||||||
struct n_tty_data *ldata = tty->disc_data;
|
struct n_tty_data *ldata = tty->disc_data;
|
||||||
int retval;
|
unsigned int num;
|
||||||
|
|
||||||
switch (cmd) {
|
switch (cmd) {
|
||||||
case TIOCOUTQ:
|
case TIOCOUTQ:
|
||||||
|
@ -2506,11 +2506,11 @@ static int n_tty_ioctl(struct tty_struct *tty, unsigned int cmd,
|
||||||
case TIOCINQ:
|
case TIOCINQ:
|
||||||
down_write(&tty->termios_rwsem);
|
down_write(&tty->termios_rwsem);
|
||||||
if (L_ICANON(tty) && !L_EXTPROC(tty))
|
if (L_ICANON(tty) && !L_EXTPROC(tty))
|
||||||
retval = inq_canon(ldata);
|
num = inq_canon(ldata);
|
||||||
else
|
else
|
||||||
retval = read_cnt(ldata);
|
num = read_cnt(ldata);
|
||||||
up_write(&tty->termios_rwsem);
|
up_write(&tty->termios_rwsem);
|
||||||
return put_user(retval, (unsigned int __user *) arg);
|
return put_user(num, (unsigned int __user *) arg);
|
||||||
default:
|
default:
|
||||||
return n_tty_ioctl_helper(tty, cmd, arg);
|
return n_tty_ioctl_helper(tty, cmd, arg);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue