LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH 2/2] bpf: btf: remove a couple conditions
@ 2018-04-27 14:04 Dan Carpenter
  2018-04-27 17:20 ` Martin KaFai Lau
  0 siblings, 1 reply; 8+ messages in thread
From: Dan Carpenter @ 2018-04-27 14:04 UTC (permalink / raw)
  To: Alexei Starovoitov, Martin KaFai Lau
  Cc: Daniel Borkmann, netdev, linux-kernel, kernel-janitors

We know "err" is zero so we can remove these and pull the code in one
indent level.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
---
This applies to the BPF tree (linux-next)

diff --git a/kernel/bpf/btf.c b/kernel/bpf/btf.c
index e631b6fd60d3..7cb0905f37c2 100644
--- a/kernel/bpf/btf.c
+++ b/kernel/bpf/btf.c
@@ -1973,16 +1973,14 @@ static struct btf *btf_parse(void __user *btf_data, u32 btf_data_size,
 	if (err)
 		goto errout;
 
-	if (!err && log->level && bpf_verifier_log_full(log)) {
+	if (log->level && bpf_verifier_log_full(log)) {
 		err = -ENOSPC;
 		goto errout;
 	}
 
-	if (!err) {
-		btf_verifier_env_free(env);
-		btf_get(btf);
-		return btf;
-	}
+	btf_verifier_env_free(env);
+	btf_get(btf);
+	return btf;
 
 errout:
 	btf_verifier_env_free(env);

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

end of thread, other threads:[~2018-04-28  1:27 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-27 14:04 [PATCH 2/2] bpf: btf: remove a couple conditions Dan Carpenter
2018-04-27 17:20 ` Martin KaFai Lau
2018-04-27 17:55   ` Martin KaFai Lau
2018-04-27 19:39     ` Dan Carpenter
2018-04-27 20:21       ` Daniel Borkmann
2018-04-27 20:31         ` Dan Carpenter
2018-04-27 21:26           ` Martin KaFai Lau
2018-04-28  1:27             ` Martin KaFai Lau

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).