diff options
author | Peter Hurley <peter@hurleysoftware.com> | 2015-11-27 14:11:03 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2015-12-13 22:59:48 -0500 |
commit | e661cf702003030daf2001cb88eb586300a18ee4 (patch) | |
tree | 92407126f080b4821d76155eb2cbb83d6649fc76 /drivers/tty | |
parent | 679e7c2999f963e542c6f4c3d3c9a0688b5d3587 (diff) |
n_tty: Clarify copy_from_read_buf()
Add a temporary for the computed source address and substitute
where appropriate. No functional change.
Signed-off-by: Peter Hurley <peter@hurleysoftware.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/tty')
-rw-r--r-- | drivers/tty/n_tty.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/tty/n_tty.c b/drivers/tty/n_tty.c index b2b01d5439b7..bc613b868e71 100644 --- a/drivers/tty/n_tty.c +++ b/drivers/tty/n_tty.c | |||
@@ -2014,11 +2014,11 @@ static int copy_from_read_buf(struct tty_struct *tty, | |||
2014 | n = min(head - ldata->read_tail, N_TTY_BUF_SIZE - tail); | 2014 | n = min(head - ldata->read_tail, N_TTY_BUF_SIZE - tail); |
2015 | n = min(*nr, n); | 2015 | n = min(*nr, n); |
2016 | if (n) { | 2016 | if (n) { |
2017 | retval = copy_to_user(*b, read_buf_addr(ldata, tail), n); | 2017 | const unsigned char *from = read_buf_addr(ldata, tail); |
2018 | retval = copy_to_user(*b, from, n); | ||
2018 | n -= retval; | 2019 | n -= retval; |
2019 | is_eof = n == 1 && read_buf(ldata, tail) == EOF_CHAR(tty); | 2020 | is_eof = n == 1 && *from == EOF_CHAR(tty); |
2020 | tty_audit_add_data(tty, read_buf_addr(ldata, tail), n, | 2021 | tty_audit_add_data(tty, from, n, ldata->icanon); |
2021 | ldata->icanon); | ||
2022 | smp_store_release(&ldata->read_tail, ldata->read_tail + n); | 2022 | smp_store_release(&ldata->read_tail, ldata->read_tail + n); |
2023 | /* Turn single EOF into zero-length read */ | 2023 | /* Turn single EOF into zero-length read */ |
2024 | if (L_EXTPROC(tty) && ldata->icanon && is_eof && | 2024 | if (L_EXTPROC(tty) && ldata->icanon && is_eof && |