Re: [PULL] http://linuxtv.org/hg/~jfrancois/v4l-dvb/

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

 



On Fri, 22 Jan 2010 18:54:46 -0200
Mauro Carvalho Chehab <mchehab@xxxxxxxxxxxxx> wrote:

> Huh?
> -static int reg_w_buf(struct gspca_dev *gspca_dev,
> +static void reg_w_buf(struct gspca_dev *gspca_dev,
>                   __u8 index,
>                   const char *buffer, int len)
>  {
>         int ret;
>  
> +       if (gspca_dev->usb_err < 0)
> +               return;
> 
> This is an ugly and non-standard way to report errors in C. Just
> return the error code.

Perhaps, but a code as:

	foo(x);
	bar(y);
	bla(z);
	...

is more readable, smaller and quicker (less MMU switches) than:

	rc = foo(x);
	if (rc < 0)
		return rc;
	rc = bar(y);
	if (rc < 0)
		return rc;
	rc = bla(z);
	if (rc < 0)
		return rc;
	...

An other way to do it is to use longjump, but I don't think it works in
the kernel...

Best 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