summaryrefslogtreecommitdiff
path: root/drivers/tty/n_tty.c
diff options
context:
space:
mode:
authorJiri Slaby (SUSE) <jirislaby@kernel.org>2023-09-19 10:51:43 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-10-03 14:31:15 +0200
commit1e619477a9c8d6e2ec05a53cda97558fdf9f440e (patch)
treef20ac34e03be2a18da309b280ea78d2e824dcc70 /drivers/tty/n_tty.c
parent4a2ad26613867a9a6c49abf7b9319e2a5f6671b0 (diff)
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>
Diffstat (limited to 'drivers/tty/n_tty.c')
-rw-r--r--drivers/tty/n_tty.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c
index 71aa898b077a..e917faa0b84c 100644
--- a/drivers/tty/n_tty.c
+++ b/drivers/tty/n_tty.c
@@ -2498,7 +2498,7 @@ static int n_tty_ioctl(struct tty_struct *tty, unsigned int cmd,
unsigned long arg)
{
struct n_tty_data *ldata = tty->disc_data;
- int retval;
+ unsigned int num;
switch (cmd) {
case TIOCOUTQ:
@@ -2506,11 +2506,11 @@ static int n_tty_ioctl(struct tty_struct *tty, unsigned int cmd,
case TIOCINQ:
down_write(&tty->termios_rwsem);
if (L_ICANON(tty) && !L_EXTPROC(tty))
- retval = inq_canon(ldata);
+ num = inq_canon(ldata);
else
- retval = read_cnt(ldata);
+ num = read_cnt(ldata);
up_write(&tty->termios_rwsem);
- return put_user(retval, (unsigned int __user *) arg);
+ return put_user(num, (unsigned int __user *) arg);
default:
return n_tty_ioctl_helper(tty, cmd, arg);
}