All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch review] uvc_driver: fix compile warning
@ 2009-04-19 20:03 Alexey Klimov
  2009-04-20 17:25 ` Laurent Pinchart
  0 siblings, 1 reply; 5+ messages in thread
From: Alexey Klimov @ 2009-04-19 20:03 UTC (permalink / raw)
  To: Laurent Pinchart, Mauro Carvalho Chehab; +Cc: linux-media, Hans Verkuil

Hello, all
I saw warnings in v4l-dvb daily build.
May this patch be helpful?

Signed-off-by: Alexey Klimov <klimov.linux@gmail.com>

--
diff -r cda79523a93c linux/drivers/media/video/uvc/uvc_driver.c
--- a/linux/drivers/media/video/uvc/uvc_driver.c	Thu Apr 16 18:30:38 2009 +0200
+++ b/linux/drivers/media/video/uvc/uvc_driver.c	Sun Apr 19 23:58:02 2009 +0400
@@ -1726,7 +1726,7 @@
 static int __uvc_resume(struct usb_interface *intf, int reset)
 {
 	struct uvc_device *dev = usb_get_intfdata(intf);
-	int ret;
+	int ret = 0;
 
 	uvc_trace(UVC_TRACE_SUSPEND, "Resuming interface %u\n",
 		intf->cur_altsetting->desc.bInterfaceNumber);
 



-- 
Best regards, Klimov Alexey


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [patch review] uvc_driver: fix compile warning
  2009-04-19 20:03 [patch review] uvc_driver: fix compile warning Alexey Klimov
@ 2009-04-20 17:25 ` Laurent Pinchart
  2009-04-20 17:50   ` Mauro Carvalho Chehab
  0 siblings, 1 reply; 5+ messages in thread
From: Laurent Pinchart @ 2009-04-20 17:25 UTC (permalink / raw)
  To: Alexey Klimov; +Cc: Mauro Carvalho Chehab, linux-media, Hans Verkuil

Hi Alexey,

On Sunday 19 April 2009 22:03:09 Alexey Klimov wrote:
> Hello, all
> I saw warnings in v4l-dvb daily build.
> May this patch be helpful?

I can't reproduce the problem with gcc 4.3.2.

Hans, what's the policy for fixing gcc-related issues ? Should the code use 
uninitialized_var() to make every gcc version happy, or can ignore the 
warnings when a newer gcc version fixes the problem 

> Signed-off-by: Alexey Klimov <klimov.linux@gmail.com>
>
> --
> diff -r cda79523a93c linux/drivers/media/video/uvc/uvc_driver.c
> --- a/linux/drivers/media/video/uvc/uvc_driver.c	Thu Apr 16 18:30:38 2009
> +0200 +++ b/linux/drivers/media/video/uvc/uvc_driver.c	Sun Apr 19 23:58:02
> 2009 +0400 @@ -1726,7 +1726,7 @@
>  static int __uvc_resume(struct usb_interface *intf, int reset)
>  {
>  	struct uvc_device *dev = usb_get_intfdata(intf);
> -	int ret;
> +	int ret = 0;
>
>  	uvc_trace(UVC_TRACE_SUSPEND, "Resuming interface %u\n",
>  		intf->cur_altsetting->desc.bInterfaceNumber);

Laurent Pinchart


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [patch review] uvc_driver: fix compile warning
  2009-04-20 17:25 ` Laurent Pinchart
@ 2009-04-20 17:50   ` Mauro Carvalho Chehab
  2009-04-20 20:12     ` Laurent Pinchart
  0 siblings, 1 reply; 5+ messages in thread
From: Mauro Carvalho Chehab @ 2009-04-20 17:50 UTC (permalink / raw)
  To: Laurent Pinchart; +Cc: Alexey Klimov, linux-media, Hans Verkuil

On Mon, 20 Apr 2009 19:25:00 +0200
Laurent Pinchart <laurent.pinchart@skynet.be> wrote:

> Hi Alexey,
> 
> On Sunday 19 April 2009 22:03:09 Alexey Klimov wrote:
> > Hello, all
> > I saw warnings in v4l-dvb daily build.
> > May this patch be helpful?
> 
> I can't reproduce the problem with gcc 4.3.2.
> 
> Hans, what's the policy for fixing gcc-related issues ? Should the code use 
> uninitialized_var() to make every gcc version happy, or can ignore the 
> warnings when a newer gcc version fixes the problem 

Laurent,

The kernel way is to use unitialized_var() on such cases.

Personally, I don't like very much this approach, since it will get rid forever
of such error for that var. However, a future patch could make that var truly
uninitialized. So, an extra care should be taken on every patch touching a var
that uses uninitialized_var() macro.

>From my side, I accept patches with both ways to fix it.

Cheers,
Mauro

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [patch review] uvc_driver: fix compile warning
  2009-04-20 17:50   ` Mauro Carvalho Chehab
@ 2009-04-20 20:12     ` Laurent Pinchart
  2009-04-20 20:47       ` Mauro Carvalho Chehab
  0 siblings, 1 reply; 5+ messages in thread
From: Laurent Pinchart @ 2009-04-20 20:12 UTC (permalink / raw)
  To: Mauro Carvalho Chehab; +Cc: Alexey Klimov, linux-media, Hans Verkuil

Hi Mauro,

On Monday 20 April 2009 19:50:31 Mauro Carvalho Chehab wrote:
> On Mon, 20 Apr 2009 19:25:00 +0200
>
> Laurent Pinchart <laurent.pinchart@skynet.be> wrote:
> > Hi Alexey,
> >
> > On Sunday 19 April 2009 22:03:09 Alexey Klimov wrote:
> > > Hello, all
> > > I saw warnings in v4l-dvb daily build.
> > > May this patch be helpful?
> >
> > I can't reproduce the problem with gcc 4.3.2.
> >
> > Hans, what's the policy for fixing gcc-related issues ? Should the code
> > use uninitialized_var() to make every gcc version happy, or can ignore
> > the warnings when a newer gcc version fixes the problem
>
> Laurent,
>
> The kernel way is to use unitialized_var() on such cases.
>
> Personally, I don't like very much this approach, since it will get rid
> forever of such error for that var. However, a future patch could make that
> var truly uninitialized. So, an extra care should be taken on every patch
> touching a var that uses uninitialized_var() macro.
>
> From my side, I accept patches with both ways to fix it.

I wasn't talking about ' = 0' vs. 'uninitialized_var()', but rather about 
submitting a patch vs. considering the problem fixed because gcc 4.3.2 doesn't 
spit a warning while gcc 4.3.1 does.

Cheers,

Laurent Pinchart


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [patch review] uvc_driver: fix compile warning
  2009-04-20 20:12     ` Laurent Pinchart
@ 2009-04-20 20:47       ` Mauro Carvalho Chehab
  0 siblings, 0 replies; 5+ messages in thread
From: Mauro Carvalho Chehab @ 2009-04-20 20:47 UTC (permalink / raw)
  To: Laurent Pinchart; +Cc: Alexey Klimov, linux-media, Hans Verkuil

On Mon, 20 Apr 2009 22:12:47 +0200
Laurent Pinchart <laurent.pinchart@skynet.be> wrote:

> Hi Mauro,
> 
> On Monday 20 April 2009 19:50:31 Mauro Carvalho Chehab wrote:
> > On Mon, 20 Apr 2009 19:25:00 +0200
> >
> > Laurent Pinchart <laurent.pinchart@skynet.be> wrote:
> > > Hi Alexey,
> > >
> > > On Sunday 19 April 2009 22:03:09 Alexey Klimov wrote:
> > > > Hello, all
> > > > I saw warnings in v4l-dvb daily build.
> > > > May this patch be helpful?
> > >
> > > I can't reproduce the problem with gcc 4.3.2.
> > >
> > > Hans, what's the policy for fixing gcc-related issues ? Should the code
> > > use uninitialized_var() to make every gcc version happy, or can ignore
> > > the warnings when a newer gcc version fixes the problem
> >
> > Laurent,
> >
> > The kernel way is to use unitialized_var() on such cases.
> >
> > Personally, I don't like very much this approach, since it will get rid
> > forever of such error for that var. However, a future patch could make that
> > var truly uninitialized. So, an extra care should be taken on every patch
> > touching a var that uses uninitialized_var() macro.
> >
> > From my side, I accept patches with both ways to fix it.
> 
> I wasn't talking about ' = 0' vs. 'uninitialized_var()', but rather about 
> submitting a patch vs. considering the problem fixed because gcc 4.3.2 doesn't 
> spit a warning while gcc 4.3.1 does.

Since 4.3.1 is a supported gcc version, it is better to fix the warning for it.

Cheers,
Mauro

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-04-20 20:47 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-19 20:03 [patch review] uvc_driver: fix compile warning Alexey Klimov
2009-04-20 17:25 ` Laurent Pinchart
2009-04-20 17:50   ` Mauro Carvalho Chehab
2009-04-20 20:12     ` Laurent Pinchart
2009-04-20 20:47       ` Mauro Carvalho Chehab

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.