Re: [PATCH] gspca main: reorganize loop

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

 



On Sun, 29 Nov 2009 11:24:31 +0100
Németh Márton <nm127@xxxxxxxxxxx> wrote:

> From: Márton Németh <nm127@xxxxxxxxxxx>
> 
> Eliminate redundant code by reorganizing the loop.
> 
> Signed-off-by: Márton Németh <nm127@xxxxxxxxxxx>
> ---
> diff -r 064a82aa2daa linux/drivers/media/video/gspca/gspca.c
> --- a/linux/drivers/media/video/gspca/gspca.c	Thu Nov 26
> 19:36:40 2009 +0100 +++
> b/linux/drivers/media/video/gspca/gspca.c	Sun Nov 29 11:09:33
> 2009 +0100 @@ -623,12 +623,12 @@ if (ret < 0)
>  			goto out;
>  	}
> -	ep = get_ep(gspca_dev);
> -	if (ep == NULL) {
> -		ret = -EIO;
> -		goto out;
> -	}
>  	for (;;) {
> +		ep = get_ep(gspca_dev);
> +		if (ep == NULL) {
> +			ret = -EIO;
> +			goto out;
> +		}
>  		PDEBUG(D_STREAM, "init transfer alt %d",
> gspca_dev->alt); ret = create_urbs(gspca_dev, ep);
>  		if (ret < 0)
> @@ -677,12 +677,6 @@
>  			ret =
> gspca_dev->sd_desc->isoc_nego(gspca_dev); if (ret < 0)
>  				goto out;
> -		} else {
> -			ep = get_ep(gspca_dev);
> -			if (ep == NULL) {
> -				ret = -EIO;
> -				goto out;
> -			}
>  		}
>  	}
>  out:

Hello Márton,

As you may see, in the loop, get_ep() is called only when isoc_nego()
is not called. So, your patch does not work.

Regards.

-- 
Ken ar c'hentañ	|	      ** Breizh ha Linux atav! **
Jef		|		http://moinejf.free.fr/
--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux