Messages in this thread | | | From | OGAWA Hirofumi <> | Subject | Re: [PATCH RFC] Add FAT_IOCTL_GET_VOLUME_ID | Date | Mon, 01 Jul 2013 15:19:31 +0900 |
| |
OGAWA Hirofumi <hirofumi@mail.parknet.co.jp> writes:
>> + case FAT_IOCTL_GET_VOLUME_ID: >> + id = fat_ioctl_volume_id(inode); >> + return copy_to_user((unsigned int *)arg, &id, sizeof(id)); > >> + case FAT_IOCTL_GET_VOLUME_ID: >> + id = fat_ioctl_volume_id(inode); >> + return copy_to_user((unsigned int *)arg, &id, sizeof(id)); > > This pattern seems to from put_user(). > > Unnecessary cast of 1st arg. And copy_to_user() returns remaining bytes > when fail (not error code).
Ah, actually, this needs cast, but it is to annotate for sparse. Well, is there any reason to restrict this only on the directory?
For now, fat_generic_ioctl() looks easier way to do this. (fat_generic_ioctl() should work for the both of compat code and dir/file)
Thanks. -- OGAWA Hirofumi <hirofumi@mail.parknet.co.jp>
| |