Re: ASoC: da7218: Use common error handling code in da7218_of_to_pdata()

From: SF Markus Elfring
Date: Fri Nov 24 2017 - 08:51:53 EST


>>> Add a jump target so that a bit of exception handling can be better reused
>>> in an if branch of this function.
>
>> Hmm. Doesn't really gain an awful lot this. Would understand if there were
>> multiple return paths, but in that case I'd have implemented something like
>> this anyway. Also your patch description isn't really correct. You're re-using
>> code from the sunny day scenario to handle an exception.
>
> Other people have given him similar feedback on his other patches with
> this pattern. I'm not intending to apply any of them.

I can offer another bit of information for a software development discussion. ð

The affected source file can be compiled for the processor architecture âx86_64â
by a tool like âGCC 6.4.1+r251631-1.3â from the software distribution
âopenSUSE Tumbleweedâ with the following command example.

my_cc=/usr/bin/gcc-6 \
&& my_module=sound/soc/codecs/da7218.o \
&& for XYZ in 0 s 3; do echo " _____ $XYZ _____" \
&& my_extra="-O$XYZ" \
&& git checkout ':/^ASoC: da7218: Delete two error messages for a failed memory allocation in da7218_of_to_pdata' \
&& make -j4 CC="${my_cc}" HOSTCC="${my_cc}" EXTRA_CFLAGS="${my_extra}" allmodconfig "${my_module}" \
&& size "${my_module}" \
&& git checkout ':/^ASoC: da7218: Use common error handling code in da7218_of_to_pdata' \
&& make -j4 CC="${my_cc}" HOSTCC="${my_cc}" EXTRA_CFLAGS="${my_extra}" allmodconfig "${my_module}" \
&& size "${my_module}"; done


ð Do you find the following differences worth for further clarification?

ââââââââââââââââââ
â setting â text â
ââââââââââââââââââ
â O0 â -25 â
â Os â -14 â
â O3 â +11 â
ââââââââââââââââââ


Regards,
Markus