Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: 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>

authored by

Dan Carpenter and committed by
Linus Torvalds
b6a83d92 d7c0847f

+3 -3
+3 -3
drivers/misc/sgi-gru/grukdump.c
··· 178 178 hdr.cbrcnt = cbrcnt; 179 179 hdr.dsrcnt = dsrcnt; 180 180 hdr.cch_locked = cch_locked; 181 - if (!ret && copy_to_user((void __user *)uhdr, &hdr, sizeof(hdr))) 182 - ret = -EFAULT; 181 + if (copy_to_user(uhdr, &hdr, sizeof(hdr))) 182 + return -EFAULT; 183 183 184 - return ret ? ret : bytes; 184 + return bytes; 185 185 } 186 186 187 187 int gru_dump_chiplet_request(unsigned long arg)