Skip to content

Commit

Permalink
tile-srom.c driver: minor code cleanup
Browse files Browse the repository at this point in the history
Signed-off-by: Chris Metcalf <cmetcalf@tilera.com>
  • Loading branch information
Chris Metcalf committed Apr 2, 2012
1 parent e2e110d commit 16418bb
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions drivers/char/tile-srom.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 16418bb

Please sign in to comment.