Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

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

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
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -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)