Skip to content

Commit 1e61947

Browse files
Jiri Slaby (SUSE)gregkh
authored andcommitted
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)" <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 4a2ad26 commit 1e61947

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

drivers/tty/n_tty.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2498,19 +2498,19 @@ static int n_tty_ioctl(struct tty_struct *tty, unsigned int cmd,
24982498
unsigned long arg)
24992499
{
25002500
struct n_tty_data *ldata = tty->disc_data;
2501-
int retval;
2501+
unsigned int num;
25022502

25032503
switch (cmd) {
25042504
case TIOCOUTQ:
25052505
return put_user(tty_chars_in_buffer(tty), (int __user *) arg);
25062506
case TIOCINQ:
25072507
down_write(&tty->termios_rwsem);
25082508
if (L_ICANON(tty) && !L_EXTPROC(tty))
2509-
retval = inq_canon(ldata);
2509+
num = inq_canon(ldata);
25102510
else
2511-
retval = read_cnt(ldata);
2511+
num = read_cnt(ldata);
25122512
up_write(&tty->termios_rwsem);
2513-
return put_user(retval, (unsigned int __user *) arg);
2513+
return put_user(num, (unsigned int __user *) arg);
25142514
default:
25152515
return n_tty_ioctl_helper(tty, cmd, arg);
25162516
}

0 commit comments

Comments
 (0)