Re: misc: bh1770glc: Use common error handling code in bh1770_power_state_store()

From: SF Markus Elfring
Date: Fri Oct 27 2017 - 14:04:48 EST


>> Adjust jump targets so that a bit of exception handling can be better
>> reused in an if branch of this function.
>
> What is the benefit brought by this change?

Will you notice that the object code size can be a bit smaller
because the call of the function âpm_runtime_putâ is specified at
two places in the implementation in comparison to three places before?


> Anyhow, are you seriously suggesting adding a goto to a label define
> within a if block?

Yes. - For this update suggestion.


> Is this somehow an Halloween related joke?

I hope not.

Another software design approach would be to move two statements from
the affected if branch to the end of this function. Such an adjustment
would have the consequence that the statement âgoto unlockâ will be
transformed into a jump to a backward target.
Would you prefer such an implementation variant instead?

Regards,
Markus