[alsa-devel] [PATCH 11/39] firewire-lib: Add support for channel mapping

Clemens Ladisch clemens at ladisch.de
Tue Mar 11 09:23:19 CET 2014

Takashi Sakamoto wrote:
> (Mar 10 2014 06:20), Clemens Ladisch wrote:
>> This change is not necessary.  I used a separate local variable
>> deliberately to allow the compiler to recognize that it cannot be
>> aliased with the buffer contents.
> I cannot understand your intention.

In code like this:

        for (... s->channels ...)
            buffer[i] = ...;

it is, as far as the compiler knows, possible that &buffer[i] and
&s->channels actually point to the same variable, so s->channels must
be reloaded in every loop iteration.  A local variable avoids that.

(Whether this optimization is worth it is another question ...)

>> AFAICS the dual-wire format could be handled easier by setting pcm_positions[]
>> in the dice driver.
> Currently I have no interests of dice driver.

Okay, I'll write a patch on top of that.


More information about the Alsa-devel mailing list