Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp709221pxj; Fri, 28 May 2021 13:44:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxOyQ8N1MDb/RqABecyKPTe+2LNj6CSmq4x9JrYI8gC+pjWlU7oUWCw00f7K3bC/wFtLtHK X-Received: by 2002:a92:c906:: with SMTP id t6mr3696847ilp.10.1622234673215; Fri, 28 May 2021 13:44:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622234673; cv=none; d=google.com; s=arc-20160816; b=T0+ajq6wAopRavfBxs0KPkyJLZQH7JcnHfvJMh5H4uxvJ1cRFhhFic4WyEgPJcGXIX zu6xfJ0Vo69zt34qCsEqE5OY/5qxsHp6A4iQFI8E9ylPhu2Gy4gye7tfwF4i7DdKL1XP 5mzqpLqYoB0EJIB/LsRnYWqTN3SukETsusei9xRY33dtaT0ASG1c49cVPWFq4ZkxWsdj AZ22EEouhnJTChiRksvJxJSh4R7shoqZnci/FRZRmYtxWzkZ+HaCaYWgNEARlxAABEn0 raxiQQTnh2xfjpefvZtAMG/V23iin5lDkC57jZQovF/ORGXeCovCJ+l/Oza2xkdELzar /m6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=kbQ2WyuiQ/INRd2Zu1pp/AYBlWcZ3X/VUiBynxFp9qE=; b=Rr5swwaMrIv/8tctUpQp9VtF2M8es/qskgZ4nl9wyctVbkXqeIjLdvposIczEFha9m D1CRFVQwM8tEDeoBz8RHGT74r1cNOuAz3nD0uqokG9QZ/qzuv8q3d88j39DOSqw02fNF qj+a3+0qdVSmWHbbYUV/2YnefNjQGzGTDE6Ux4f/VS9sjip3YbpVIMi42IHzZgSbnM5Z 7O8wTJNUIuKoqNyrcRyaNerm7394XAdRXCDr45DywZo23MmecAGO+OGo/TERPWlplZIu h4h69LxOvuhSqUKvcQNNLHt7GI6ZKV4LwZgwJZ72VUnua1Lg48zEXNmScHuhnVSdtsNi SjsQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s13si6423114iow.103.2021.05.28.13.44.19; Fri, 28 May 2021 13:44:33 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229586AbhE1UpU (ORCPT + 99 others); Fri, 28 May 2021 16:45:20 -0400 Received: from www62.your-server.de ([213.133.104.62]:37180 "EHLO www62.your-server.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229482AbhE1UpT (ORCPT ); Fri, 28 May 2021 16:45:19 -0400 Received: from sslproxy03.your-server.de ([88.198.220.132]) by www62.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92.3) (envelope-from ) id 1lmizB-000G7u-UB; Fri, 28 May 2021 22:21:38 +0200 Received: from [85.7.101.30] (helo=linux.home) by sslproxy03.your-server.de with esmtpsa (TLSv1.3:TLS_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lmizB-000WbL-Kt; Fri, 28 May 2021 22:21:37 +0200 Subject: Re: [PATCH][next] bpf: devmap: remove redundant assignment of variable drops To: Maciej Fijalkowski , Colin King Cc: Alexei Starovoitov , "David S . Miller" , Jakub Kicinski , Jesper Dangaard Brouer , John Fastabend , Andrii Nakryiko , Martin KaFai Lau , Song Liu , Yonghong Song , KP Singh , netdev@vger.kernel.org, bpf@vger.kernel.org, kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org References: <20210527143637.795393-1-colin.king@canonical.com> <20210527145549.GA7570@ranger.igk.intel.com> From: Daniel Borkmann Message-ID: <70c6e7d3-7faf-c4e7-3ae5-78f9a8e4c2b3@iogearbox.net> Date: Fri, 28 May 2021 22:21:36 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.2 MIME-Version: 1.0 In-Reply-To: <20210527145549.GA7570@ranger.igk.intel.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Authenticated-Sender: daniel@iogearbox.net X-Virus-Scanned: Clear (ClamAV 0.103.2/26184/Fri May 28 13:05:50 2021) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/27/21 4:55 PM, Maciej Fijalkowski wrote: > On Thu, May 27, 2021 at 03:36:37PM +0100, Colin King wrote: >> From: Colin Ian King >> >> The variable drops is being assigned a value that is never >> read, it is being updated later on. The assignment is redundant and >> can be removed. > > Acked-by: Maciej Fijalkowski > > Would help if you would have CCed me given the fact that hour ago I > confirmed that it could be removed :p but no big deal. Thanks guys, fyi, took in this one for bpf-next [0], since more unneeded code removed. [0] https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git/commit/?id=e8e0f0f484780d7b90a63ea50020ac4bb027178d >> Addresses-Coverity: ("Unused value") >> Signed-off-by: Colin Ian King >> --- >> kernel/bpf/devmap.c | 2 -- >> 1 file changed, 2 deletions(-) >> >> diff --git a/kernel/bpf/devmap.c b/kernel/bpf/devmap.c >> index f9148daab0e3..fe3873b5d13d 100644 >> --- a/kernel/bpf/devmap.c >> +++ b/kernel/bpf/devmap.c >> @@ -388,8 +388,6 @@ static void bq_xmit_all(struct xdp_dev_bulk_queue *bq, u32 flags) >> to_send = dev_map_bpf_prog_run(bq->xdp_prog, bq->q, cnt, dev); >> if (!to_send) >> goto out; >> - >> - drops = cnt - to_send; >> } >> >> sent = dev->netdev_ops->ndo_xdp_xmit(dev, to_send, bq->q, flags); >> -- >> 2.31.1 >>