Skip to content

Commit b6a83d9

Browse files
Dan Carpentertorvalds
authored andcommitted
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>
1 parent d7c0847 commit b6a83d9

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

‎drivers/misc/sgi-gru/grukdump.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,10 +178,10 @@ static int gru_dump_context(struct gru_state *gru, int ctxnum,
178178
hdr.cbrcnt = cbrcnt;
179179
hdr.dsrcnt = dsrcnt;
180180
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;
183183

184-
return ret ? ret : bytes;
184+
return bytes;
185185
}
186186

187187
int gru_dump_chiplet_request(unsigned long arg)

0 commit comments

Comments
 (0)