Re: [staging-next 6/6] staging/easycap: reduce code nesting in easycap_sound.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sun, Mar 06, 2011 at 12:55:25AM +0200, Tomas Winkler wrote:
> diff --git a/drivers/staging/easycap/easycap_sound.c b/drivers/staging/easycap/easycap_sound.c
> index 5829e26..0164132 100644
> --- a/drivers/staging/easycap/easycap_sound.c
> +++ b/drivers/staging/easycap/easycap_sound.c
> @@ -142,122 +142,118 @@ easycap_alsa_complete(struct urb *purb)
>  			    strerror(purb->iso_frame_desc[i].status),
>  			    purb->iso_frame_desc[i].status);
>  		}
> -		if (!purb->iso_frame_desc[i].status) {
> -			more = purb->iso_frame_desc[i].actual_length;
> -			if (!more)
> -				peasycap->audio_mt++;
> -			else {
> -				if (peasycap->audio_mt) {
> -					JOM(12, "%4i empty audio urb frames\n",
> -					    peasycap->audio_mt);
> -					peasycap->audio_mt = 0;
> -				}
> +		if (purb->iso_frame_desc[i].status == 0) {

Isn't this test reversed?  Status is non-zero on errors.

> +			JOM(12, "discarding audio samples because "
> +			    "%i=purb->iso_frame_desc[i].status\n",
> +			    purb->iso_frame_desc[i].status);
> +			continue;
> +		}

regards,
dan carpenter
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel


[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux