Skip to content

Commit

Permalink
drivers/misc/sgi-gru/grukdump.c: cleanup gru_dump_context() a little
Browse files Browse the repository at this point in the history
"ret" is zero here so we can remove the "!ret" part of the condition.
"uhdr" is alread a __user pointer so we can remove the cast.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Dimitri Sivanich <sivanich@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Dan Carpenter authored and Linus Torvalds committed Apr 7, 2014
1 parent d7c0847 commit b6a83d9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions drivers/misc/sgi-gru/grukdump.c
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,10 @@ static int gru_dump_context(struct gru_state *gru, int ctxnum,
hdr.cbrcnt = cbrcnt;
hdr.dsrcnt = dsrcnt;
hdr.cch_locked = cch_locked;
if (!ret && copy_to_user((void __user *)uhdr, &hdr, sizeof(hdr)))
ret = -EFAULT;
if (copy_to_user(uhdr, &hdr, sizeof(hdr)))
return -EFAULT;

return ret ? ret : bytes;
return bytes;
}

int gru_dump_chiplet_request(unsigned long arg)
Expand Down

0 comments on commit b6a83d9

Please sign in to comment.