Re: [alsa-devel] ALSA: nm256: Fine-tuning for three function implementations

From: Ondrej Zary
Date: Tue Nov 28 2017 - 07:33:25 EST


On Tuesday 28 November 2017, SF Markus Elfring wrote:
> >>>> There is a general source code transformation pattern involved.
> >>>> So I find that it is systematic.
> >>>>
> >>>> But I did not dare to develop a script variant for the semantic patch
> >>>> language (Coccinelle software) which can handle all special use cases
> >>>> as a few of them are already demonstrated in this tiny patch series.
> >>>
> >>> Then you're doing everything by hands,
> >>
> >> I am navigating through possible changes around the pattern
> >> âUse common error handling codeâ mostly manually so far.
> >>
> >>> and can be wrong
> >>
> >> Such a possibility remains as usual.
> >
> > "As usual" doesn't suffice.
>
> There can be additional means be used to reduce the probability
> of undesired side effects.
>
> > It must be "almost perfect" for such a code refactoring.
>
> Can you get the impression that the shown transformation patterns were
> correctly applied for the source file âsound/pci/nm256/nm256.câ?

Have you tested the driver? Probably not. Please don't "improve" working
drivers unless you have the hardware to test your changes. Patches like this
are known to cause regressions. If the hardware is rare (like the NM256), the
regression can hit years later when someone with such HW upgrades distro
(e.g. Debian stable).

--
Ondrej Zary