[alsa-devel] [PATCH] ALSA: firewire-lib: drop skip argument from helper functions to queue a packet

Takashi Iwai tiwai at suse.de
Wed May 11 20:37:38 CEST 2016


On Wed, 11 May 2016 18:14:53 +0200,
Takashi Sakamoto wrote:
> 
> 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>

OK, applied as is now.


thanks,

Takashi


More information about the Alsa-devel mailing list