diff options
author | Chris Metcalf <cmetcalf@tilera.com> | 2012-03-30 19:03:04 -0400 |
---|---|---|
committer | Chris Metcalf <cmetcalf@tilera.com> | 2012-04-02 12:14:10 -0400 |
commit | 16418bb1da8a685e639c6c4f2d3096f762e8b0fb (patch) | |
tree | 39a145c1b921d198410e88eeadf583fa4561b4ad /drivers/char/tile-srom.c | |
parent | e2e110d7596656e2badd21c48713bd01e1b40f44 (diff) |
tile-srom.c driver: minor code cleanup
Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
Diffstat (limited to 'drivers/char/tile-srom.c')
-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, | |||
194 | 194 | ||
195 | hv_retval = _srom_read(srom->hv_devhdl, kernbuf, | 195 | hv_retval = _srom_read(srom->hv_devhdl, kernbuf, |
196 | *f_pos, bytes_this_pass); | 196 | *f_pos, bytes_this_pass); |
197 | if (hv_retval > 0) { | 197 | if (hv_retval <= 0) { |
198 | if (copy_to_user(buf, kernbuf, hv_retval) != 0) { | ||
199 | retval = -EFAULT; | ||
200 | break; | ||
201 | } | ||
202 | } else if (hv_retval <= 0) { | ||
203 | if (retval == 0) | 198 | if (retval == 0) |
204 | retval = hv_retval; | 199 | retval = hv_retval; |
205 | break; | 200 | break; |
206 | } | 201 | } |
207 | 202 | ||
203 | if (copy_to_user(buf, kernbuf, hv_retval) != 0) { | ||
204 | retval = -EFAULT; | ||
205 | break; | ||
206 | } | ||
207 | |||
208 | retval += hv_retval; | 208 | retval += hv_retval; |
209 | *f_pos += hv_retval; | 209 | *f_pos += hv_retval; |
210 | buf += hv_retval; | 210 | buf += hv_retval; |