Re: [RFC PATCHv2 1/4] drivers/otp: add initial support for OTP memory

Arnd Bergmann
2011-03-27T11:19:05Z

On Sunday 27 March 2011 05:52:04 Mike Frysinger wrote:
> On Sat, Mar 26, 2011 at 16:51, Arnd Bergmann wrote:
> > Fine with me, if you can name at least one possible use for a flag.
>
> i tend to assume that i cant think of all cases when i first write up
> something, so better to leave a hole for the future ;)

This makes sense for real syscalls, where adding a new one is a lot
of work. For an ioctl, adding a flag is almost exactly the same
amount of work as adding another ioctl command, but it adds complexity
for the first one, e.g. you need to decide how to handle unknown
flags passed to the kernel (ignore, bail out, or a combination).

It also makes correctly using the ioctl harder and adds a tiny
amount of overhead for parsing the flags and copying the addititional
word. Adding a flags word "just in case" is therfore counterproductive.

Arnd