Skip to content

Commit 4a2ad26

Browse files
Jiri Slaby (SUSE)gregkh
authored andcommitted
tty: n_tty: use 'retval' instead of 'c'
In n_tty_read(), there is a separate int variable 'c' and is used only to hold an int value returned from job_control(). There is also a 'retval' variable typed ssize_t. So drop this single occurrence of 'c' and reuse 'retval' which is used on all other places to hold the value returned from n_tty_read(). Note that 'retval' needs not be initialized now. Drop that. 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 c77247a commit 4a2ad26

File tree

1 file changed

+4
-5
lines changed

1 file changed

+4
-5
lines changed

drivers/tty/n_tty.c

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2154,9 +2154,8 @@ static ssize_t n_tty_read(struct tty_struct *tty, struct file *file, u8 *kbuf,
21542154
struct n_tty_data *ldata = tty->disc_data;
21552155
u8 *kb = kbuf;
21562156
DEFINE_WAIT_FUNC(wait, woken_wake_function);
2157-
int c;
21582157
int minimum, time;
2159-
ssize_t retval = 0;
2158+
ssize_t retval;
21602159
long timeout;
21612160
bool packet;
21622161
size_t old_tail;
@@ -2192,9 +2191,9 @@ static ssize_t n_tty_read(struct tty_struct *tty, struct file *file, u8 *kbuf,
21922191
return kb - kbuf;
21932192
}
21942193

2195-
c = job_control(tty, file);
2196-
if (c < 0)
2197-
return c;
2194+
retval = job_control(tty, file);
2195+
if (retval < 0)
2196+
return retval;
21982197

21992198
/*
22002199
* Internal serialization of reads.

0 commit comments

Comments
 (0)