lkml.org 
[lkml]   [2013]   [Jul]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH RFC] Add FAT_IOCTL_GET_VOLUME_ID
Date
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>


\
 
 \ /
  Last update: 2013-07-01 09:01    [W:0.050 / U:1.168 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site