public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* 2.6.28-mmotm1230 - include/media/v4l2-ioctl.h prototype mismatch
@ 2009-01-02 10:51 Valdis.Kletnieks
  2009-01-05  7:20 ` Andrew Morton
  0 siblings, 1 reply; 2+ messages in thread
From: Valdis.Kletnieks @ 2009-01-02 10:51 UTC (permalink / raw)
  To: Andrew Morton, mchehab; +Cc: linux-kernel, video4linux-list

[-- Attachment #1: Type: text/plain, Size: 1760 bytes --]

I'm seeing the following warning message during a kernel build:

  CC [M]  drivers/media/video/gspca/gspca.o
drivers/media/video/gspca/gspca.c:1811: warning: initialization from incompatible pointer type

The root cause appears to be a missed prototype change in a conversion from
ioctl to unlocked_ioctl - in struct file_operations, the former is an int,
but the latter is a long.  So we clean it up.

I have to admit not having checked deeply for second-order effects, but the
kernel builds without warnings and the result works for me.  The only other
use of __video_ioctl2 I can see is in drivers/media/video/ivtv/ivtv-ioctl.c,
and there it's used as a return value from a function already defined to return
a long, so we save an int->long cast...

Signed-off-by: Valdis Kletnieks <valdis.kletnieks@vt.edu>

--- linux-2.6.28-mmotm1230/include/media/v4l2-ioctl.h.dist	2009-01-01 17:23:00.000000000 -0500
+++ linux-2.6.28-mmotm1230/include/media/v4l2-ioctl.h	2009-01-02 05:40:45.000000000 -0500
@@ -297,7 +297,7 @@ extern int video_usercopy(struct file *f
 /* Standard handlers for V4L ioctl's */
 
 /* This prototype is used on fops.unlocked_ioctl */
-extern int __video_ioctl2(struct file *file,
+extern long __video_ioctl2(struct file *file,
 			unsigned int cmd, unsigned long arg);
 
 /* This prototype is used on fops.ioctl
--- linux-2.6.28-mmotm1230/drivers/media/video/v4l2-ioctl.c.dist	2009-01-01 17:22:50.000000000 -0500
+++ linux-2.6.28-mmotm1230/drivers/media/video/v4l2-ioctl.c	2009-01-02 05:45:39.000000000 -0500
@@ -1852,7 +1852,7 @@ static int __video_do_ioctl(struct file 
 	return ret;
 }
 
-int __video_ioctl2(struct file *file,
+long __video_ioctl2(struct file *file,
 	       unsigned int cmd, unsigned long arg)
 {
 	char	sbuf[128];




[-- Attachment #2: Type: application/pgp-signature, Size: 226 bytes --]

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

* Re: 2.6.28-mmotm1230 - include/media/v4l2-ioctl.h prototype mismatch
  2009-01-02 10:51 2.6.28-mmotm1230 - include/media/v4l2-ioctl.h prototype mismatch Valdis.Kletnieks
@ 2009-01-05  7:20 ` Andrew Morton
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Morton @ 2009-01-05  7:20 UTC (permalink / raw)
  To: Valdis.Kletnieks; +Cc: mchehab, linux-kernel, video4linux-list

On Fri, 02 Jan 2009 05:51:26 -0500 Valdis.Kletnieks@vt.edu wrote:

> I'm seeing the following warning message during a kernel build:
> 
>   CC [M]  drivers/media/video/gspca/gspca.o
> drivers/media/video/gspca/gspca.c:1811: warning: initialization from incompatible pointer type
> 
> The root cause appears to be a missed prototype change in a conversion from
> ioctl to unlocked_ioctl - in struct file_operations, the former is an int,
> but the latter is a long.  So we clean it up.
> 
> I have to admit not having checked deeply for second-order effects, but the
> kernel builds without warnings and the result works for me.  The only other
> use of __video_ioctl2 I can see is in drivers/media/video/ivtv/ivtv-ioctl.c,
> and there it's used as a return value from a function already defined to return
> a long, so we save an int->long cast...
> 
> Signed-off-by: Valdis Kletnieks <valdis.kletnieks@vt.edu>
> 
> --- linux-2.6.28-mmotm1230/include/media/v4l2-ioctl.h.dist	2009-01-01 17:23:00.000000000 -0500
> +++ linux-2.6.28-mmotm1230/include/media/v4l2-ioctl.h	2009-01-02 05:40:45.000000000 -0500
> @@ -297,7 +297,7 @@ extern int video_usercopy(struct file *f
>  /* Standard handlers for V4L ioctl's */
>  
>  /* This prototype is used on fops.unlocked_ioctl */
> -extern int __video_ioctl2(struct file *file,
> +extern long __video_ioctl2(struct file *file,
>  			unsigned int cmd, unsigned long arg);
>  
>  /* This prototype is used on fops.ioctl
> --- linux-2.6.28-mmotm1230/drivers/media/video/v4l2-ioctl.c.dist	2009-01-01 17:22:50.000000000 -0500
> +++ linux-2.6.28-mmotm1230/drivers/media/video/v4l2-ioctl.c	2009-01-02 05:45:39.000000000 -0500
> @@ -1852,7 +1852,7 @@ static int __video_do_ioctl(struct file 
>  	return ret;
>  }
>  
> -int __video_ioctl2(struct file *file,
> +long __video_ioctl2(struct file *file,
>  	       unsigned int cmd, unsigned long arg)
>  {
>  	char	sbuf[128];

That code seems to have magically disappeared from linux-next.

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

end of thread, other threads:[~2009-01-05  7:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-01-02 10:51 2.6.28-mmotm1230 - include/media/v4l2-ioctl.h prototype mismatch Valdis.Kletnieks
2009-01-05  7:20 ` Andrew Morton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox