Re: [REVIEW PATCH 01/14] V4L: Int if: Dummy slave

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

 



Mauro Carvalho Chehab wrote:
On Mon, 12 Jan 2009 20:03:08 -0600
"Aguirre Rodriguez, Sergio Alberto" <saaguirre@xxxxxx> wrote:

+static struct v4l2_int_slave dummy_slave = {
+	/* Dummy pointer to avoid underflow in find_ioctl. */
+	.ioctls = (void *)0x80000000,

Why are you using here a magic number?

Not really a reason. It could be or actually perhaps anything equal to
or bigger than sizeof(struct v4l2_int_ioctl_desc) so that last doesn't
underflow:

        const struct v4l2_int_ioctl_desc *first = slave->ioctls;
        const struct v4l2_int_ioctl_desc *last =
                first + slave->num_ioctls - 1;

num_ioctls is zero. See find_ioctl in drivers/media/video/v4l2-int-device.c.

I guess that should be changed to sizeof(struct v4l2_int_ioctl_desc).

--
Sakari Ailus
sakari.ailus@xxxxxxxxx

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux