From nobody Thu Sep 11 15:19:12 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B2EBBC001DE for ; Thu, 3 Aug 2023 01:28:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231674AbjHCB2V (ORCPT ); Wed, 2 Aug 2023 21:28:21 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54058 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230043AbjHCB2S (ORCPT ); Wed, 2 Aug 2023 21:28:18 -0400 Received: from mail.nfschina.com (unknown [42.101.60.195]) by lindbergh.monkeyblade.net (Postfix) with SMTP id 3647C26BA; Wed, 2 Aug 2023 18:28:17 -0700 (PDT) Received: from localhost.localdomain (unknown [219.141.250.2]) by mail.nfschina.com (Maildata Gateway V2.8.8) with ESMTPA id 3EEF1602E666B; Thu, 3 Aug 2023 09:28:14 +0800 (CST) X-MD-Sfrom: kunyu@nfschina.com X-MD-SrcIP: 219.141.250.2 From: Li kunyu To: martin.lau@linux.dev, ast@kernel.org, daniel@iogearbox.net, andrii@kernel.org, song@kernel.org, yhs@fb.com, john.fastabend@gmail.com, kpsingh@kernel.org, sdf@google.com, haoluo@google.com, jolsa@kernel.org Cc: bpf@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Li kunyu Subject: [PATCH bpf-next v2] bpf: bpf_struct_ops: Remove unnecessary initial values of variables Date: Sat, 5 Aug 2023 01:59:29 +0800 Message-Id: <20230804175929.2867-1-kunyu@nfschina.com> X-Mailer: git-send-email 2.18.2 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" err and tlinks is assigned first, so it does not need to initialize the assignment. Signed-off-by: Li kunyu Reviewed-by: Simon Horman --- 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_m= ap *map, void *key, struct bpf_struct_ops_value *uvalue, *kvalue; const struct btf_member *member; const struct btf_type *t =3D st_ops->type; - struct bpf_tramp_links *tlinks =3D NULL; + struct bpf_tramp_links *tlinks; void *udata, *kdata; - int prog_fd, err =3D 0; + int prog_fd, err; void *image, *image_end; u32 i; =20 @@ -818,7 +818,7 @@ static int bpf_struct_ops_map_link_update(struct bpf_li= nk *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 =3D 0; + int err; =20 st_link =3D container_of(link, struct bpf_struct_ops_link, link); st_map =3D container_of(new_map, struct bpf_struct_ops_map, map); --=20 2.18.2