Re: [PATCH v4] mmc: Add ioctl to let userspace apps send ACMDs

John Calixto
2011-04-12T23:08:59Z

[-- Attachment #1: Type: TEXT/PLAIN, Size: 1038 bytes --]

On Wed, 13 Apr 2011, Arnd Bergmann wrote:
> On Tuesday 12 April 2011, Michał Mirosław wrote:
> > > + unsigned int cmd_timeout_ms;
> > > + __u64 data_ptr; /* DAT buffer */
> >
> > This will be more natural if you have an anonymous union here:
> > union {
> > __u64 data_ptr_
> > void *data_ptr;
> > };
>
> No, that really does not work. It's important for all members of the ioctl data
> structure to have a fixed size, independent of the size of long or pointer.
>
> If you do a union, the pointer ends up in the first 32 bits of the 64 bit member,
> which does not work on big-endian architectures. It also doesn't work on 31
> bit architectures, although that is a minor worry here.
>

Gah! OK, so much for the v5 I just sent then. What do you think about
the compat_ioctl that I sent in v2? It means having the extra 32-bit
compat structure, but at least all the compat overhead is conditional
upon CONFIG_COMPAT. If you're not using CONFIG_COMPAT, you don't get
any compat cruft.

John