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: 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)" <jirislaby@kernel.org>
Link: https://lore.kernel.org/r/20230919085156.1578-2-jirislaby@kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

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

+4 -5
+4 -5
drivers/tty/n_tty.c
··· 2154 2154 struct n_tty_data *ldata = tty->disc_data; 2155 2155 u8 *kb = kbuf; 2156 2156 DEFINE_WAIT_FUNC(wait, woken_wake_function); 2157 - int c; 2158 2157 int minimum, time; 2159 - ssize_t retval = 0; 2158 + ssize_t retval; 2160 2159 long timeout; 2161 2160 bool packet; 2162 2161 size_t old_tail; ··· 2191 2192 return kb - kbuf; 2192 2193 } 2193 2194 2194 - c = job_control(tty, file); 2195 - if (c < 0) 2196 - return c; 2195 + retval = job_control(tty, file); 2196 + if (retval < 0) 2197 + return retval; 2197 2198 2198 2199 /* 2199 2200 * Internal serialization of reads.