public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH -next] bpf: simplify code in btf_parse_hdr
@ 2022-09-17  8:42 williamsukatube
  2022-09-20  5:18 ` Yonghong Song
  2022-09-21 17:40 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: williamsukatube @ 2022-09-17  8:42 UTC (permalink / raw)
  To: martin.lau, bpf, linux-kernel
  Cc: ast, daniel, andrii, song, yhs, john.fastabend, kpsingh, sdf,
	haoluo, jolsa, William Dean

From: William Dean <williamsukatube@163.com>

It could directly return 'btf_check_sec_info' to simplify code.

Signed-off-by: William Dean <williamsukatube@163.com>
---
 kernel/bpf/btf.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/kernel/bpf/btf.c b/kernel/bpf/btf.c
index 7e64447659f3..80eda86ddfce 100644
--- a/kernel/bpf/btf.c
+++ b/kernel/bpf/btf.c
@@ -4854,7 +4854,6 @@ static int btf_parse_hdr(struct btf_verifier_env *env)
 	u32 hdr_len, hdr_copy, btf_data_size;
 	const struct btf_header *hdr;
 	struct btf *btf;
-	int err;

 	btf = env->btf;
 	btf_data_size = btf->data_size;
@@ -4911,11 +4910,7 @@ static int btf_parse_hdr(struct btf_verifier_env *env)
 		return -EINVAL;
 	}

-	err = btf_check_sec_info(env, btf_data_size);
-	if (err)
-		return err;
-
-	return 0;
+	return btf_check_sec_info(env, btf_data_size);
 }

 static int btf_check_type_tags(struct btf_verifier_env *env,
--
2.25.1


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

* Re: [PATCH -next] bpf: simplify code in btf_parse_hdr
  2022-09-17  8:42 [PATCH -next] bpf: simplify code in btf_parse_hdr williamsukatube
@ 2022-09-20  5:18 ` Yonghong Song
  2022-09-21 17:40 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Yonghong Song @ 2022-09-20  5:18 UTC (permalink / raw)
  To: williamsukatube, martin.lau, bpf, linux-kernel
  Cc: ast, daniel, andrii, song, john.fastabend, kpsingh, sdf, haoluo,
	jolsa



On 9/17/22 1:42 AM, williamsukatube@163.com wrote:
> From: William Dean <williamsukatube@163.com>
> 
> It could directly return 'btf_check_sec_info' to simplify code.
> 
> Signed-off-by: William Dean <williamsukatube@163.com>

Acked-by: Yonghong Song <yhs@fb.com>

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

* Re: [PATCH -next] bpf: simplify code in btf_parse_hdr
  2022-09-17  8:42 [PATCH -next] bpf: simplify code in btf_parse_hdr williamsukatube
  2022-09-20  5:18 ` Yonghong Song
@ 2022-09-21 17:40 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2022-09-21 17:40 UTC (permalink / raw)
  To: None
  Cc: martin.lau, bpf, linux-kernel, ast, daniel, andrii, song, yhs,
	john.fastabend, kpsingh, sdf, haoluo, jolsa

Hello:

This patch was applied to bpf/bpf-next.git (master)
by Martin KaFai Lau <martin.lau@kernel.org>:

On Sat, 17 Sep 2022 16:42:48 +0800 you wrote:
> From: William Dean <williamsukatube@163.com>
> 
> It could directly return 'btf_check_sec_info' to simplify code.
> 
> Signed-off-by: William Dean <williamsukatube@163.com>
> ---
>  kernel/bpf/btf.c | 7 +------
>  1 file changed, 1 insertion(+), 6 deletions(-)
> 
> [...]

Here is the summary with links:
  - [-next] bpf: simplify code in btf_parse_hdr
    https://git.kernel.org/bpf/bpf-next/c/3a74904ceff3

You are awesome, thank you!
-- 
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html



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

end of thread, other threads:[~2022-09-21 17:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-09-17  8:42 [PATCH -next] bpf: simplify code in btf_parse_hdr williamsukatube
2022-09-20  5:18 ` Yonghong Song
2022-09-21 17:40 ` patchwork-bot+netdevbpf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox