Re: [PATCHv4] MTD: New ioctl calls for >4GiB device support

From: Arnd Bergmann
Date: Tue Mar 31 2009 - 06:52:33 EST


On Tuesday 31 March 2009, Kevin Cernekee wrote:
> +struct mtd_oob_buf64 {
> +ÂÂÂÂÂÂÂuint64_t start;
> +ÂÂÂÂÂÂÂuint32_t res0;
> +ÂÂÂÂÂÂÂuint32_t length;
> +ÂÂÂÂÂÂÂunsigned char __user *ptr;
> +ÂÂÂÂÂÂÂuint32_t res1[8];
> +};

Does this have to use an indirect pointer? We normally try to avoid
ioctl interfaces like this, because they are hard to trace and you
need a compat wrapper. You might be able to at least avoid the wrapper
by defining the data structure with a __u64 to take the pointer.

If you leave the data structure the way it is, you should at least
move the compat_ioctl handling into mtdchar.c from compat_ioctl.c.
It will simplify your code and help reduce the size of the common
ioctl handling.

Arnd <><
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/