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

Re: [RFC v3 1/2] v4l: Do not use enums in IOCTL structs



On Wed, 2012-05-02 at 19:17 -0300, Mauro Carvalho Chehab wrote:

> We can speed-up the conversions, with something like:
> 
> enum foo {
> 	BAR
> };
> 
> if (sizeof(foo) != sizeof(u32))
> 	call_compat_logic().
> 
> I suspect that sizeof() won't work inside a macro. 

sizeof() is evaluated at compile time, after preprocessing. 
It should work inside of a macro.

See the ARRAY_SIZE() macro in include/linux/kernel.h for a well tested
example.

Regards,
Andy



--
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


[Linux Input]     [Video for Linux]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Photos]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Devices]     [Yosemite Backpacking]

Add to Google Powered by Linux