Re: [PATCH] crypto: n2_core: insert '!err' condition in else scope

From
Geyslan Gregório Bem <hidden>
Date
2013-10-19 23:13:27
Also in
lkml
Reply to
David Miller, 2013-10-19
2013/10/19 David Miller [off-list ref]:
From: Geyslan Gregório Bem <redacted>
Date: Sat, 19 Oct 2013 19:42:35 -0300
quoted
2013/10/19 David Miller [off-list ref]:
quoted
From: "Geyslan G. Bem" <redacted>
Date: Sat, 19 Oct 2013 10:09:31 -0300
quoted
This patch moves the '!err' condition into the above else scope,
what is more obvious and has the secondary goal of avoid false-positives
in statical analyze tools.

Signed-off-by: Geyslan G. Bem <redacted>
I do not think patches should be applied to satisfy tools if the
code is semantically correct.
Yes, Miller, I agree. But as I mentioned:
".. and has as the 'secondary' goal of avoid false-positives in
statical analyze tools."

The 'primary' goal is to not repeat a condition test:
"This patch moves the '!err' condition into the above else scope, what
is more obvious ..."
I still do not feel that this change is a net-positive.  Sorry.
Miller,

I can understand you. You don't want to break your git history
(blame). But when a code is clearly more readable/understandable you
must assume that it has a huge net-positive.

The patch improves the code in three ways:
- Only one if/else;
- Not blame on static analysis tools.
- And avoid more discussion about that in the future (nobody will send
patches like this to disturb you about that part of code).

The decision is yours.

Thanks again.
Thread (6 messages) 6 messages, 3 authors, last reply 2013-10-20
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help