Commit b6a83d92 authored by Dan Carpenter's avatar Dan Carpenter Committed by Linus Torvalds

drivers/misc/sgi-gru/grukdump.c: cleanup gru_dump_context() a little

"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: default avatarDan Carpenter <dan.carpenter@oracle.com>
Acked-by: default avatarDimitri Sivanich <sivanich@sgi.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent d7c0847f
......@@ -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)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment