Re: [PATCH 1/1] forcedeth: Delete a redundant condition branch
From: Leizhen (ThunderTown) <hidden>
Date: 2021-05-11 01:44:09
On 2021/5/11 3:59, Andrew Lunn wrote:
On Mon, May 10, 2021 at 09:56:56PM +0800, Zhen Lei wrote:quoted
The statement of the last "if (adv_lpa & LPA_10HALF)" branch is the same as the "else" branch. Delete it to simplify code. No functional change. Signed-off-by: Zhen Lei <redacted>Hi Zhen Could you teach your bot to check lore.kernel.org and see if the same patch has been submitted before? If it has, there is probably a reason why it was rejected. You need to check if that reason it still true.
This is a tool that comes with the kernel. Now it's all about manual Google searches to see if someone has posted it. So there could be a mistake. Although the compiler can optimize this "if" branch, but I think those that can optimize directly should try to avoid relying on the machine. 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. That's why the kernel tool reports it. At least the developers of the tool has the same point of view as mine.
Andrew
.