Received: by 2002:a05:6602:2086:0:0:0:0 with SMTP id a6csp4723230ioa; Wed, 27 Apr 2022 09:41:13 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxWnBn5AAxkT6Yt75uC5H+vUij66Kzi/rT6sCjAunmw1JPa5oZOGzk2Gux9oNQx1/Evzmhm X-Received: by 2002:a17:902:f54e:b0:15d:7b2:2ff3 with SMTP id h14-20020a170902f54e00b0015d07b22ff3mr18486616plf.95.1651077673294; Wed, 27 Apr 2022 09:41:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651077673; cv=none; d=google.com; s=arc-20160816; b=McNx+qVSHOmV4io+iyXUvi8eOI0xshwy5g5N2w+LC/OuWNZJwNgaxdWBcj3tE8sYKS OngVAxk+mhMSZQNyOBTVqgTCtLiuKyxdTA46k98OrkcT8EJBFUdeTcXfieJPRwIlxvVI wTmBlMYaQbnrTwWV58bVyk0Wz+6I9iUEnDxalCTXxPRMsINIlbTBALFLgGveFLsYpK8s Ba5WQIuSJhMwtBARd8Hty4l14saouofPYzDG9Gx3wsuW2mFVV8cmvEPfm61whdBQeXIj AMmi7Y/IArXnS7YTxkq+bAFi09g/oAcN/ORuxTRFFZfbCaZzOG6BffvDKduGjOGnAJG1 vn2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=no2dRxhaPo5kKkkNtYDviUL8aWZxcIpM0ihWfE784Qo=; b=M1X/UVuwToMcQhg7rtBIjDKzPpRyYSdKrTUkkYFmBQvl6BkQlrxxl9GorZN1As4DH9 HQC5Suqv7roUTsM/QS/+uzolYhVwspT5KPHYANIM1/gfmIGMUVQq+yNZkIB53KY2WhjK CQWgti9959v4GcMvb+VKvRez+U5P7HrWQmQrkNDfDJsLDcBHZdpZdzBnrEBPGYcPPRn9 XRCDE+WK0fp6W9ssrJQ3SIPxTmZeh8IpMe9AHjcVfzIY6ltvGRV/tWuoxHoe9yfefCOs gh6cgJTv0SIbKhtwJ8idTvoGBgqStxmdXRnVBZUc36Dn63+EzjBVO9HXkiEyJZqfQt38 xg+Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=QSugq2x0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id v21-20020a17090a899500b001ca9f3c1cc5si5422338pjn.57.2022.04.27.09.41.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Apr 2022 09:41:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=QSugq2x0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4AD6C44105C; Wed, 27 Apr 2022 09:10:57 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241863AbiD0QNu (ORCPT + 99 others); Wed, 27 Apr 2022 12:13:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52444 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241917AbiD0QMR (ORCPT ); Wed, 27 Apr 2022 12:12:17 -0400 Received: from mail-pl1-x633.google.com (mail-pl1-x633.google.com [IPv6:2607:f8b0:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 58E0D3F3D53; Wed, 27 Apr 2022 09:08:31 -0700 (PDT) Received: by mail-pl1-x633.google.com with SMTP id d15so1960593plh.2; Wed, 27 Apr 2022 09:08:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=no2dRxhaPo5kKkkNtYDviUL8aWZxcIpM0ihWfE784Qo=; b=QSugq2x0W9ZgFZS2awb0WG1lP1D6yw+gw1IeXAl14ic+8y8v4p/ptpenf+qyKnO/aP PtDMqmvYgNp7f5ji3XOX9KSZBcjjTH1W5s29F16RqsAhYBzAw/173R2GBEnaGHKabzk7 LRa74Ag+maLLZ7cOva724Wvu+fNrrndGJodwNBSWsFT9yrqQqQH4CQkib7hs74qVqrZV wjgyIY/DvcbYflbFFz/soFDlXspEu6X7kJt84WRQy/eEoermUy4a8BoMc6MFlRD/9Cpw YMfJdMNn4IKO++kv9ylkRPfmy6LF8MYM13x46HIax9NIIQv6j1cNB2SHJr6Uq6KYAXyR icJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=no2dRxhaPo5kKkkNtYDviUL8aWZxcIpM0ihWfE784Qo=; b=VvRtkw+ZPCnWgkbnJGesgLVluK93OD2jqY0UF4XyNi1E7OusptHXC2T/cNsz+5I3d8 e1ajqYdCi7qQVm2TrbWlN4U9gWzlTI4xh1ShWkz8L945QANXLCeDBwRBzwihRaunlAkQ JFiUjcESxgN3jIzCifdnmX+VQqtOb/uPg+YpWsWi/9IFMO7DsA7OqrM3msPhSiN8Vd1k 4sLpft8KX8WpnfUTClblVnylaU3juJiJvxfynRWWCfOya2R5Iy9JbL8bMRDAQQl0v8Cn vIGtG13atzRKJFsJc19zrYMFSY+Jw2kJVEVA1tin1De815FusP4QSxKpJaOaTIGqvPYa rk9w== X-Gm-Message-State: AOAM532JOaM48LMDacGcQGoq/b/vdZzjohOgALviAhtcW3jWgDk23GdU hxsWbT22D5+TFWDyOcNfHyWd++v+TdJpPtB/o20= X-Received: by 2002:a17:90a:8591:b0:1b9:da10:2127 with SMTP id m17-20020a17090a859100b001b9da102127mr44674409pjn.13.1651075660046; Wed, 27 Apr 2022 09:07:40 -0700 (PDT) MIME-Version: 1.0 References: <202204271656.OTIj2QNJ-lkp@intel.com> In-Reply-To: From: Alexei Starovoitov Date: Wed, 27 Apr 2022 09:07:29 -0700 Message-ID: Subject: Re: [PATCH] libbpf: fix returnvar.cocci warnings To: kernel test robot , Julia Lawall Cc: Andrii Nakryiko , kbuild-all@lists.01.org, Linux Memory Management List , Alexei Starovoitov , Daniel Borkmann , Martin KaFai Lau , Song Liu , Yonghong Song , John Fastabend , KP Singh , Network Development , bpf , LKML Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Apr 27, 2022 at 1:04 AM kernel test robot wrote: > > From: kernel test robot > > tools/lib/bpf/relo_core.c:1064:8-11: Unneeded variable: "len". Return "0" on line 1086 > > > Remove unneeded variable used to store return value. > > Generated by: scripts/coccinelle/misc/returnvar.cocci > > Fixes: b58af63aab11 ("libbpf: Refactor CO-RE relo human description formatting routine") > CC: Andrii Nakryiko > Reported-by: kernel test robot > Signed-off-by: kernel test robot > --- > > tree: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master > head: f02ac5c95dfd45d2f50ecc68d79177de326c668c > commit: b58af63aab11e4ae00fe96de9505759cfdde8ee9 [6746/7265] libbpf: Refactor CO-RE relo human description formatting routine > :::::: branch date: 2 hours ago > :::::: commit date: 9 hours ago > > tools/lib/bpf/relo_core.c | 10 +++++----- > 1 file changed, 5 insertions(+), 5 deletions(-) > > --- a/tools/lib/bpf/relo_core.c > +++ b/tools/lib/bpf/relo_core.c > @@ -1061,7 +1061,7 @@ static int bpf_core_format_spec(char *bu > const struct btf_enum *e; > const char *s; > __u32 type_id; > - int i, len = 0; > + int i; > > #define append_buf(fmt, args...) \ > ({ \ > @@ -1083,7 +1083,7 @@ static int bpf_core_format_spec(char *bu > type_id, btf_kind_str(t), str_is_empty(s) ? "" : s); > > if (core_relo_is_type_based(spec->relo_kind)) > - return len; > + return 0; cocci is wrong. It missed append_buf() macro. Please fix cocci so we don't have to manually deal with broken patches like this one.