[alsa-devel] [PATCH] ALSA: firewire-lib: drop skip argument from helper functions to queue a packet
Takashi Sakamoto
o-takashi at sakamocchi.jp
Wed May 11 18:14:53 CEST 2016
Hi Clemens,
On May 11 2016 16:48, Clemens Ladisch wrote:
> Takashi Sakamoto wrote:
>> On most of audio and music units on IEEE 1394 bus which ALSA firewire stack
>> supports (or plans to support), CIP with two quadlets header is used.
>> Thus, there's no cases to queue packets with blank payload. If such packets
>> are going to be queued, it means that they're for skips of the cycle.
>>
>> This commit simplifies helper functions to queue a packet.
>
>> @@ -383,8 +382,10 @@ static int queue_packet(struct amdtp_stream *s,
>> p.tag = TAG_CIP;
>> p.header_length = header_length;
>> - p.payload_length = (!skip) ? payload_length : 0;
>> - p.skip = skip;
>> + if (payload_length > 0)
>> + p.payload_length = payload_length;
>> + else
>> + p.skip = true;
>
> This can be simplified to:
> p.payload_length = payload_length;
> p.skip = payload_length == 0;
Yep, but I prefer to split assignment from evaluation in different
lines, just from my taste.
> Acked-by: Clemens Ladisch <clemens at ladisch.de>
Thanks
Takashi Sakamoto
More information about the Alsa-devel
mailing list