From: SF Markus Elfring <hidden> Date: 2015-12-31 21:48:12
From: Markus Elfring <redacted>
Date: Thu, 31 Dec 2015 22:40:39 +0100
Adjust a jump target to eliminate a check before error logging.
Use the identifier "report_failure" instead of "err".
Signed-off-by: Markus Elfring <redacted>
---
drivers/net/ethernet/cavium/thunder/nicvf_main.c | 15 +++++++--------
1 file changed, 7 insertions(+), 8 deletions(-)
From: Robert Richter <rric@kernel.org> Date: 2016-01-07 11:07:09
On 31.12.15 22:47:31, SF Markus Elfring wrote:
From: Markus Elfring <redacted>
Date: Thu, 31 Dec 2015 22:40:39 +0100
Adjust a jump target to eliminate a check before error logging.
Use the identifier "report_failure" instead of "err".
I don't see much value in those changes. Using the 'err' label is ok
as it is not misleading and common use. And, there is no need to
optimize the check since this is not the fast path and will be
compiler optimized anyway. So let's keep the code as it is with the
flavor of the original author.
-Robert
From: Joe Perches <joe@perches.com> Date: 2016-01-07 19:44:12
On Thu, 2016-01-07 at 20:30 +0100, SF Markus Elfring wrote:
quoted
quoted
Adjust a jump target to eliminate a check before error logging.
Use the identifier "report_failure" instead of "err".
I don't see much value in those changes
Thanks for your feedback.
quoted
Using the 'err' label is ok as it is not misleading and common use.
Is such a short jump label enough explanation for the information
"what" and "why"?
When there is only one type of error possible, yes.
quoted
And, there is no need to optimize the check since this is not the
fast path
Really? - Is it a bit more efficient to avoid a double check for the
variable "ret" at the end of the current implementation for the
discussed function?
Before asking questions you could answer yourself,
please look at object code produced by the compiler
before and after your proposed changes.
From: SF Markus Elfring <hidden> Date: 2016-01-07 19:57:33
quoted
Is it a bit more efficient to avoid a double check for the
variable "ret" at the end of the current implementation for the
discussed function?
Before asking questions you could answer yourself,
please look at object code produced by the compiler
before and after your proposed changes.
* Do any more source code reviewers wonder about the need
for such a double check?
* Which object code representations would you find representative
for a further constructive discussion around this
software component?
Regards,
Markus
From: Joe Perches <joe@perches.com> Date: 2016-01-07 20:28:55
On Thu, 2016-01-07 at 21:07 +0100, SF Markus Elfring wrote:
quoted
quoted
* Which object code representations would you find representative
? for a further constructive discussion around this
? software component?
Evidence of actual object code improvement
How do you think about to provide a function implementation
which looks a bit more efficient by default?
It's not a matter of "looks a bit more efficient".
it's taste, style, and repetition for various functions.
Some prefer that source code be "templatized" regardless
of the number of exit points that any particular use of a
specific function type.
Some of your patches are converting these templatized
functions to a different form for no added value.
These patches make the local source code inconsistent
and generally goes against the authors preferred style.
From: SF Markus Elfring <hidden> Date: 2016-01-07 20:39:35
Some prefer that source code be "templatized" regardless
of the number of exit points that any particular use of a
specific function type.
This is another interesting view on involved implementation details.
Some of your patches are converting these templatized
functions to a different form for no added value.
Would you like to distinguish a bit more between my evolving
collection of update suggestions and the concrete proposal
for the function "nicvf_register_interrupts"?
These patches make the local source code inconsistent
and generally goes against the authors preferred style.
Which programming approach will be the leading one here finally?
Regards,
Markus
From: Joe Perches <joe@perches.com> Date: 2016-01-07 20:42:12
On Thu, 2016-01-07 at 21:38 +0100, SF Markus Elfring wrote:
quoted
Some prefer that source code be "templatized" regardless
of the number of exit points that any particular use of a
specific function type.
[]
quoted
Some of your patches are converting these templatized
functions to a different form for no added value.
Would you like to distinguish a bit more between my evolving
collection of update suggestions and the concrete proposal
for the function "nicvf_register_interrupts"?
No.
quoted
These patches make the local source code inconsistent
and generally goes against the authors preferred style.
Which programming approach will be the leading one here finally?
Whatever the developer wants.
There is no _best_ or _only_ style for this.