diff options
author | Uwe Kleine-König <u.kleine-koenig@pengutronix.de> | 2017-03-02 17:01:36 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2017-03-03 07:15:14 +0100 |
commit | 74f750fe65587dc0c46100a0f2b94879b2b1f863 (patch) | |
tree | 6d52150b0cc2bc9bdd936c017058fb0aa80d23c6 /fs | |
parent | 2eacc573df81ca35dd40d7a853d4a7c37c72857f (diff) | |
download | barebox-74f750fe65587dc0c46100a0f2b94879b2b1f863.tar.gz barebox-74f750fe65587dc0c46100a0f2b94879b2b1f863.tar.xz |
tftp: trivial code simplification
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/tftp.c | 10 |
1 files changed, 4 insertions, 6 deletions
@@ -568,13 +568,11 @@ static int tftp_read(struct device_d *dev, FILE *f, void *buf, size_t insize) while (insize) { now = kfifo_get(priv->fifo, buf, insize); + outsize += now; + buf += now; + insize -= now; if (priv->state == STATE_DONE) - return outsize + now; - if (now) { - outsize += now; - buf += now; - insize -= now; - } + return outsize; if (TFTP_FIFO_SIZE - kfifo_len(priv->fifo) >= priv->blocksize) tftp_send(priv); |