]> err.no Git - linux-2.6/commitdiff
V4L/DVB (5883): V4L: Fix a compile warning on non-32-bit machines.
authorSakari Ailus <sakari.ailus@nokia.com>
Fri, 20 Jul 2007 16:12:51 +0000 (13:12 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Wed, 10 Oct 2007 01:02:57 +0000 (22:02 -0300)
Fix a compile warning on non-32-bit machines in v4l2-int-device.h.
Add internal ioctl interface fallback function for ioctls with one
argument.

Signed-off-by: Sakari Ailus <sakari.ailus@nokia.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
drivers/media/video/v4l2-int-device.c
include/media/v4l2-int-device.h

index 7885d9b38c922f38e92accedb9f1af88f9020a71..aa2a8156338d1aa9c2c4ea96c457a67349267763 100644 (file)
@@ -115,13 +115,9 @@ void v4l2_int_device_unregister(struct v4l2_int_device *d)
        mutex_unlock(&mutex);
 }
 
-static int no_such_ioctl(struct v4l2_int_device *d)
-{
-       return -EINVAL;
-}
-
 /* Adapted from search_extable in extable.c. */
-static v4l2_int_ioctl_func *find_ioctl(struct v4l2_int_slave *slave, int cmd)
+static v4l2_int_ioctl_func *find_ioctl(struct v4l2_int_slave *slave, int cmd,
+                                      v4l2_int_ioctl_func *no_such_ioctl)
 {
        const struct v4l2_int_ioctl_desc *first = slave->ioctls;
        const struct v4l2_int_ioctl_desc *last =
@@ -140,15 +136,29 @@ static v4l2_int_ioctl_func *find_ioctl(struct v4l2_int_slave *slave, int cmd)
                        return mid->func;
        }
 
-       return &no_such_ioctl;
+       return no_such_ioctl;
+}
+
+static int no_such_ioctl_0(struct v4l2_int_device *d)
+{
+       return -EINVAL;
 }
 
 int v4l2_int_ioctl_0(struct v4l2_int_device *d, int cmd)
 {
-       return ((v4l2_int_ioctl_func_0 *)find_ioctl(d->u.slave, cmd))(d);
+       return ((v4l2_int_ioctl_func_0 *)
+               find_ioctl(d->u.slave, cmd,
+                          (v4l2_int_ioctl_func *)&no_such_ioctl_0))(d);
+}
+
+static int no_such_ioctl_1(struct v4l2_int_device *d, void *arg)
+{
+       return -EINVAL;
 }
 
 int v4l2_int_ioctl_1(struct v4l2_int_device *d, int cmd, void *arg)
 {
-       return ((v4l2_int_ioctl_func_1 *)find_ioctl(d->u.slave, cmd))(d, arg);
+       return ((v4l2_int_ioctl_func_1 *)
+               find_ioctl(d->u.slave, cmd,
+                          (v4l2_int_ioctl_func *)&no_such_ioctl_1))(d, arg);
 }
index 2b6fc1122f6cf10832fbde968b2568a9ed83aa92..deb28ce6685dc78134789b037b0e3e4b738d514f 100644 (file)
@@ -170,7 +170,7 @@ int v4l2_int_ioctl_1(struct v4l2_int_device *d, int cmd, void *arg);
                                            arg_type asterisk arg)      \
        {                                                               \
                return v4l2_int_ioctl_1(d, vidioc_int_##name##_num,     \
-                                       (void *)arg);                   \
+                                       (void *)(unsigned long)arg);    \
        }                                                               \
                                                                        \
        static inline struct v4l2_int_ioctl_desc                        \