Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BB585C433ED for ; Tue, 11 May 2021 12:20:33 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 892B16188B for ; Tue, 11 May 2021 12:20:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231532AbhEKMVi (ORCPT ); Tue, 11 May 2021 08:21:38 -0400 Received: from vps0.lunn.ch ([185.16.172.187]:34934 "EHLO vps0.lunn.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231429AbhEKMVh (ORCPT ); Tue, 11 May 2021 08:21:37 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Type:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Sender:Reply-To:Content-Transfer-Encoding:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=nYiN4ObFpoOGO3znd/xq12Uh2Pvor93u/J+O6JGegJU=; b=q+i1b4YntA7o596ER5FSfmWSlZ gM1rFD8lBgf9AASJ3eJ1V2imEF7sxmDFbJ5GEe30FgXox1W4MllCLR22Z6WcTRT503aPF+QBXXhsS ccKm/YIQBrnDj3CPoOtpPcHeHpUbolyb4VDlO8lqdhTUENf9wfN05KYIzpmbgsdHA+6Y=; Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from ) id 1lgRN9-003jZu-87; Tue, 11 May 2021 14:20:23 +0200 Date: Tue, 11 May 2021 14:20:23 +0200 From: Andrew Lunn To: "Leizhen (ThunderTown)" Cc: Rain River , Zhu Yanjun , "David S . Miller" , Jakub Kicinski , netdev Subject: Re: [PATCH 1/1] forcedeth: Delete a redundant condition branch Message-ID: References: <20210510135656.3960-1-thunder.leizhen@huawei.com> <20f15fbc-347f-b76d-24f4-da08f76fd603@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20f15fbc-347f-b76d-24f4-da08f76fd603@huawei.com> Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org > If it must exist, it should be in the form of comments. Otherwise, the > intuition is that there was a mistake in writing this code. I agree that it could look like there is an error in the code. But that is where the bot stops and the human takes over. When you read the code, and understand what it does, you can see there is no error. You should also look at the history. This is old code, if it was broken, it would of been fixed by now, since the hulk bot has been around for quiet a while. For me, the optimization argument is not correct. We have a lot of code, in macros for example, where we assume the compiler will optimize it. Think about all the if (IS_ENABLED(CONFIG_FOO)) {} code. The code you are suggesting to change is also on the very slow path. We want to optimize it for human understandability, not code generation. It is much more important humans understand it, than the few microsecods it takes the compiler to optimize it. Andrew