On Thursday 06 August 2009 20:10:38 Trent Piepho wrote: > On Thu, 6 Aug 2009, Hans Verkuil wrote: > > > Why do you need two routines that will always return zero? Why to create a > > > code > > > that will never be used? v4l2-compat-ioctl32.c is already complex enough > > > without adding any bogus code. > > > > When the RDS encoder driver from Eduardo is added, then he will add the > > string controls to ctrl_is_pointer() since his driver is the first to > > actually implement string controls. > > Could one of the upper bits of the control id be used as a flag? It would > make it a lot easier to check the control's type than by using some inline > function with a giant case statement that needs to be updated each time a > new control is added. No, you can't. That would require users to OR that flag each time you want to use such a control. My original plan was to just check for a non-zero size field, the theory being that applications would set the old reserved field to 0. Unfortunately, several apps do not init those reserved fields, so they would fail. Note to ourselves: the next time we require apps to zero reserved fields we really have to check that they do and return an error otherwise... Anyway, I expect that these functions are a temporary measure anyway. Once we can move the control handling to the v4l2 framework this sort of info should be available readily from the framework without requiring such ugly switches. Regards, Hans -- Hans Verkuil - video4linux developer - sponsored by TANDBERG Telecom -- 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