diff options
author | Chris Metcalf <cmetcalf@tilera.com> | 2012-03-31 01:03:04 +0200 |
---|---|---|
committer | Chris Metcalf <cmetcalf@tilera.com> | 2012-04-02 18:14:10 +0200 |
commit | 16418bb1da8a685e639c6c4f2d3096f762e8b0fb (patch) | |
tree | 39a145c1b921d198410e88eeadf583fa4561b4ad /drivers | |
parent | edac: say "TILEGx" not "TILEPro" for the tilegx edac driver (diff) | |
download | linux-16418bb1da8a685e639c6c4f2d3096f762e8b0fb.tar.xz linux-16418bb1da8a685e639c6c4f2d3096f762e8b0fb.zip |
tile-srom.c driver: minor code cleanup
Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/char/tile-srom.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/drivers/char/tile-srom.c b/drivers/char/tile-srom.c index 4dc019408fac..3b22a606f79d 100644 --- a/drivers/char/tile-srom.c +++ b/drivers/char/tile-srom.c @@ -194,17 +194,17 @@ static ssize_t srom_read(struct file *filp, char __user *buf, hv_retval = _srom_read(srom->hv_devhdl, kernbuf, *f_pos, bytes_this_pass); - if (hv_retval > 0) { - if (copy_to_user(buf, kernbuf, hv_retval) != 0) { - retval = -EFAULT; - break; - } - } else if (hv_retval <= 0) { + if (hv_retval <= 0) { if (retval == 0) retval = hv_retval; break; } + if (copy_to_user(buf, kernbuf, hv_retval) != 0) { + retval = -EFAULT; + break; + } + retval += hv_retval; *f_pos += hv_retval; buf += hv_retval; |