Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp17492imn; Thu, 28 Jul 2022 20:27:14 -0700 (PDT) X-Google-Smtp-Source: AGRyM1slNuZN1mvQJHL4Oo6GecqikGW3yKL5j2qVW/8P3S2sb6CKXOoAjtsQbtDg4146pRlspkYD X-Received: by 2002:a05:6a00:1145:b0:52b:78c:fa26 with SMTP id b5-20020a056a00114500b0052b078cfa26mr1505728pfm.27.1659065234404; Thu, 28 Jul 2022 20:27:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659065234; cv=none; d=google.com; s=arc-20160816; b=g1FQB0J8ILvhFnBOXrcPfG4KLKZu2+Zdm0W2S582czpUHZwizO2v9etBM4WyoqHCae o75ZZC4k4S7gSWsHqKcG/0yX5qw1OIIxWLalj0puxGPiZXTZ2ATyhJp8fDBFMZ1MelY8 WPRbMWq78ym5B46RMgm+nbTYJEQqFAsEadCKZe7M6qP4o6bHLrGY2xVvMBf7GwDzG+DL YnWizJNrkkO1ucIxCd+I5U8pWj6MMfWGUshnV3tU4+n0U0YzrWRRGaPQ95aO7eJSJxZB KTbZfE3Fq9Qd7w3crDpZcncGRlvTabEymKEd5N4JZVBLm4k9WEHMhgM8+a6CB1dnpu2G nyxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=p+eNqUFzAh35JQT7E63CPeJG1c7obYJM/kyRGHxVTEo=; b=S/57yfdBve/aG1gt+znrcLPIB3S7cC3kAwjMa4R+NtMPQZUJtwxB5SVZo0xoSgRrB2 HVJH+eJ5suoxwos3qqgorcn7iI/YS5/aPR9kZ+zwbG1vpzy2EAYt7qdLcM/FP1731cin uTw86SwPCretWY7P9wUoHeUyZOOmDKmP6qE/z5MqCyhLw0M5ast0ygJSC2npjzkVD+xf qSKDHLpfl7VVA8P6SX/Xm6wBMRfFd+IM4eA639aUD4H/ZM5uZuh8d+Edt+6QRJ5WQns5 jzcnXf8Z7QNkzvaTX9rEOgBiBP/2b39MjUdEXt7io48ukJz6L+J5/Nw2va8zsSqRIz1Y suUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bnjCJQRk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b15-20020a170903228f00b0016163a204cfsi3287660plh.334.2022.07.28.20.26.59; Thu, 28 Jul 2022 20:27:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=bnjCJQRk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233859AbiG2DQF (ORCPT + 99 others); Thu, 28 Jul 2022 23:16:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55184 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230469AbiG2DQC (ORCPT ); Thu, 28 Jul 2022 23:16:02 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [IPv6:2604:1380:40e1:4800::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AD3857A502; Thu, 28 Jul 2022 20:16:00 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 0BB8CCE260F; Fri, 29 Jul 2022 03:15:59 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1E5B0C433C1; Fri, 29 Jul 2022 03:15:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1659064557; bh=p+eNqUFzAh35JQT7E63CPeJG1c7obYJM/kyRGHxVTEo=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=bnjCJQRkS0624rRxyzVtacd8ESQXXwEk99zxbSzAZ5Qz5hvMtPreW/aIJU1deJrPF QWASyw6zXNpwyJXTe+SPF5G077tvBrbDKwy5ZOlJkUNwb+mxIr1b3Pgc2D7W12qKb6 8BdinEs3mSYW7om2da3fK3QYCHa+AYt86gJQ9NyPVBPVSStUdPO/uaiJUP1OTAiBAe 8xmTbJ2xBWZ+aXhOVcjpaNQJS5Kk4h8BveREGgSVwAwXeafVD/wRdg9j4kDKJyLYUg A/klzNipt1rV6Oe/s9YT1xPCY4JjNZXnYpzKBA+Kbic9mGhlpfSlTAW6ktE/Wz8viv 5hiTThqZTINQg== Date: Thu, 28 Jul 2022 20:15:56 -0700 From: Jakub Kicinski To: Li zeming Cc: jhs@mojatatu.com, xiyou.wangcong@gmail.com, jiri@resnulli.us, davem@davemloft.net, edumazet@google.com, pabeni@redhat.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] sched/net/act: Remove temporary state variables Message-ID: <20220728201556.230b9efd@kernel.org> In-Reply-To: <20220727094146.5990-1-zeming@nfschina.com> References: <20220727094146.5990-1-zeming@nfschina.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham 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, 27 Jul 2022 17:41:46 +0800 Li zeming wrote: > The temporary variable ret could be removed and the corresponding state > can be directly returned. How many case like this are there in the kernel? What tool are you using to find this? We should focus on creating CI tools which can help catch instances of this pattern in new code before it gets added, rather than cleaning up old code. It just makes backports harder for hardly any gain.