All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] kprobes: Remove an unneeded condition
@ 2017-03-21 20:43 Dan Carpenter
  2017-03-21 22:55 ` Masami Hiramatsu
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Dan Carpenter @ 2017-03-21 20:43 UTC (permalink / raw)
  To: kernel-janitors

We know that "addr" is non-NULL here so there is no need to check if
"addr + offset" is NULL.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/kernel/kprobes.c b/kernel/kprobes.c
index d733479a10ee..88617178a63e 100644
--- a/kernel/kprobes.c
+++ b/kernel/kprobes.c
@@ -1403,9 +1403,7 @@ static kprobe_opcode_t *_kprobe_addr(kprobe_opcode_t *addr,
 			return ERR_PTR(-ENOENT);
 	}
 
-	addr = (kprobe_opcode_t *)(((char *)addr) + offset);
-	if (addr)
-		return addr;
+	return (kprobe_opcode_t *)(((char *)addr) + offset);
 
 invalid:
 	return ERR_PTR(-EINVAL);

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2017-03-27  2:21 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-21 20:43 [PATCH] kprobes: Remove an unneeded condition Dan Carpenter
2017-03-21 22:55 ` Masami Hiramatsu
2017-03-22  9:34 ` Dan Carpenter
2017-03-23  0:15 ` Masami Hiramatsu
2017-03-24  9:50   ` [PATCH v2] kprobes: cleanup _kprobe_addr() Dan Carpenter
2017-03-24  9:50     ` Dan Carpenter
2017-03-27  2:19     ` Masami Hiramatsu
2017-03-27  2:19       ` Masami Hiramatsu
2017-03-23  9:22 ` [PATCH] kprobes: Remove an unneeded condition Dan Carpenter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.