linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH bpf-next v2] bpf: bpf_struct_ops: Remove unnecessary initial values of variables
  2023-08-04 17:59 [PATCH bpf-next v2] bpf: bpf_struct_ops: Remove unnecessary initial values of variables Li kunyu
@ 2023-08-03 12:08 ` Simon Horman
  2023-08-04  1:10 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: Simon Horman @ 2023-08-03 12:08 UTC (permalink / raw)
  To: Li kunyu
  Cc: martin.lau, ast, daniel, andrii, song, yhs, john.fastabend,
	kpsingh, sdf, haoluo, jolsa, bpf, netdev, linux-kernel

On Sat, Aug 05, 2023 at 01:59:29AM +0800, Li kunyu wrote:
> err and tlinks is assigned first, so it does not need to initialize the
> assignment.
> 
> Signed-off-by: Li kunyu <kunyu@nfschina.com>

Reviewed-by: Simon Horman <horms@kernel.org>


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

* Re: [PATCH bpf-next v2] bpf: bpf_struct_ops: Remove unnecessary initial values of variables
  2023-08-04 17:59 [PATCH bpf-next v2] bpf: bpf_struct_ops: Remove unnecessary initial values of variables Li kunyu
  2023-08-03 12:08 ` Simon Horman
@ 2023-08-04  1:10 ` patchwork-bot+netdevbpf
  1 sibling, 0 replies; 3+ messages in thread
From: patchwork-bot+netdevbpf @ 2023-08-04  1:10 UTC (permalink / raw)
  To: Li kunyu
  Cc: martin.lau, ast, daniel, andrii, song, yhs, john.fastabend,
	kpsingh, sdf, haoluo, jolsa, bpf, netdev, linux-kernel

Hello:

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

On Sat,  5 Aug 2023 01:59:29 +0800 you wrote:
> err and tlinks is assigned first, so it does not need to initialize the
> assignment.
> 
> Signed-off-by: Li kunyu <kunyu@nfschina.com>
> ---
>  v2:
>    Remove tlinks initialization assignment.
> 
> [...]

Here is the summary with links:
  - [bpf-next,v2] bpf: bpf_struct_ops: Remove unnecessary initial values of variables
    https://git.kernel.org/bpf/bpf-next/c/5964d1e4594e

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

* [PATCH bpf-next v2] bpf: bpf_struct_ops: Remove unnecessary initial values of variables
@ 2023-08-04 17:59 Li kunyu
  2023-08-03 12:08 ` Simon Horman
  2023-08-04  1:10 ` patchwork-bot+netdevbpf
  0 siblings, 2 replies; 3+ messages in thread
From: Li kunyu @ 2023-08-04 17:59 UTC (permalink / raw)
  To: martin.lau, ast, daniel, andrii, song, yhs, john.fastabend,
	kpsingh, sdf, haoluo, jolsa
  Cc: bpf, netdev, linux-kernel, Li kunyu

err and tlinks is assigned first, so it does not need to initialize the
assignment.

Signed-off-by: Li kunyu <kunyu@nfschina.com>
---
 v2:
   Remove tlinks initialization assignment.

 kernel/bpf/bpf_struct_ops.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/kernel/bpf/bpf_struct_ops.c b/kernel/bpf/bpf_struct_ops.c
index d3f0a4825fa6..c05585ed1f37 100644
--- a/kernel/bpf/bpf_struct_ops.c
+++ b/kernel/bpf/bpf_struct_ops.c
@@ -374,9 +374,9 @@ static long bpf_struct_ops_map_update_elem(struct bpf_map *map, void *key,
 	struct bpf_struct_ops_value *uvalue, *kvalue;
 	const struct btf_member *member;
 	const struct btf_type *t = st_ops->type;
-	struct bpf_tramp_links *tlinks = NULL;
+	struct bpf_tramp_links *tlinks;
 	void *udata, *kdata;
-	int prog_fd, err = 0;
+	int prog_fd, err;
 	void *image, *image_end;
 	u32 i;
 
@@ -818,7 +818,7 @@ static int bpf_struct_ops_map_link_update(struct bpf_link *link, struct bpf_map
 	struct bpf_struct_ops_map *st_map, *old_st_map;
 	struct bpf_map *old_map;
 	struct bpf_struct_ops_link *st_link;
-	int err = 0;
+	int err;
 
 	st_link = container_of(link, struct bpf_struct_ops_link, link);
 	st_map = container_of(new_map, struct bpf_struct_ops_map, map);
-- 
2.18.2


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

end of thread, other threads:[~2023-08-04  1:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-04 17:59 [PATCH bpf-next v2] bpf: bpf_struct_ops: Remove unnecessary initial values of variables Li kunyu
2023-08-03 12:08 ` Simon Horman
2023-08-04  1:10 ` 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;
as well as URLs for NNTP newsgroup(s).