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

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

 



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


[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux