All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: "Leizhen (ThunderTown)" <thunder.leizhen@huawei.com>
Cc: Rain River <rain.1986.08.12@gmail.com>,
	Zhu Yanjun <zyjzyj2000@gmail.com>,
	"David S . Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, netdev <netdev@vger.kernel.org>
Subject: Re: [PATCH 1/1] forcedeth: Delete a redundant condition branch
Date: Tue, 11 May 2021 14:20:23 +0200	[thread overview]
Message-ID: <YJp2hwGLeYcOt+gu@lunn.ch> (raw)
In-Reply-To: <20f15fbc-347f-b76d-24f4-da08f76fd603@huawei.com>

> 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

      reply	other threads:[~2021-05-11 12:20 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-10 13:56 [PATCH 1/1] forcedeth: Delete a redundant condition branch Zhen Lei
2021-05-10 14:19 ` Zhu Yanjun
2021-05-10 18:31   ` Jakub Kicinski
2021-05-10 19:52     ` Andrew Lunn
2021-05-10 23:31       ` Jakub Kicinski
2021-05-11  5:24         ` Leon Romanovsky
2021-05-10 19:59 ` Andrew Lunn
2021-05-11  1:43   ` Leizhen (ThunderTown)
2021-05-11 12:20     ` Andrew Lunn [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YJp2hwGLeYcOt+gu@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=rain.1986.08.12@gmail.com \
    --cc=thunder.leizhen@huawei.com \
    --cc=zyjzyj2000@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.