Re: [PATCH v6] mmc: Add mmc CMD+ACMD passthrough ioctl

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

 



On Thursday 21 April 2011, Michał Mirosław wrote:
> W dniu 21 kwietnia 2011 13:15 użytkownik Arnd Bergmann <arnd@xxxxxxxx> napisał:

> static int mmc_blk_compat_ioctl(struct block_device *bdev, fmode_t mode,
>     unsigned int cmd, unsigned long arg)
> {
>   struct mmc_ioc_cmd blk;
> 
>   if (cmd != MMC_IOC_CMD)
>     return -EINVAL;
> 
>   copy_from_user(compat_ptr(arg), &blk) ...
>   blk.data_ptr = compat_ptr(blk.__data_ptr_storage32);
> 
>   return mmc_blk_ioctl_cmd(bdev, &blk);
> }

Yes, this works, but it requires having a compat_ioctl() handler function that
knows about the data structure, which we generally try to avoid.
The same method would even work if you only had a pointer member in the
structure and did not even attempt to make the structure compatible.

	Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-mmc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux USB Devel]     [Linux Media]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux