Re: [media] bt8xx: One function call less in bttv_input_init() after error detection

From: Daniele Nicolodi
Date: Mon Dec 12 2016 - 12:56:26 EST


On 12/12/16 10:15 AM, SF Markus Elfring wrote:
>>> I suggest to check return values immediately after each function call.
>>> An error situation can be detected earlier then and only the required
>>> clean-up functionality will be executed at the end.
>>
>> Which improvement does this bring?
>
> * How do you think about to avoid requesting additional system resources
> when it was determined that a previously required memory allocation failed?

I think it is an irrelevant problem in the case at hand.

> * Can the corresponding exception handling become a bit more efficient?

Where more efficient merely means sparing one function call? I think it
is completely irrelevant in the case at hand and code clarity must be
preferred to pointless optimization.

>> Why?
>
> Do you care for any results from static source code analysis?

Static source code analysis, in the form you are doing with Coccinelle,
may help in identifying problems in a code base when a specific pattern
has been identified to be problematic. In the static code analysis
results you present, it is not clear what the problematic pattern is.
Independently of how you identified the code section you propose to
change, there is no problem to fix.

As a general advise, Markus, replying to questions with other questions
is a a bad debate form. Questions, as opposed to statements, cannot be
confuted. Also, every time you receive an answer to one of your
questions, you reply with another question broadening the span of the
discussion. However, you do not present evidence supporting your initial
statement that some changes in the code are beneficial.

Cheers,
Daniele