Zitat von Andy Shevchenko <andy.shevchenko@xxxxxxxxx>:
On Thu, May 17, 2018 at 8:03 PM, Guido Kiener
<guido@xxxxxxxxxxxxxxxxxx> wrote:
Add ioctls USBTMC_IOCTL_GET_TIMEOUT / USBTMC_IOCTL_SET_TIMEOUT to
get/set I/O timeout for specific file handle.
+static int usbtmc_ioctl_get_timeout(struct usbtmc_file_data *file_data,
+ void __user *arg)
+{
+ __u32 timeout;
+
+ timeout = file_data->timeout;
Why do you need __u32 on kernel side?
Would plain u32 work?
It compiles and links with u32 and __u32 (and even double). AFAIK __u32 is for
user code and u32 for kernel code. So, correct is here what the
maintainer says
or experienced kernel developers :-).
My opinion here is that put_user(..) and get_user(..) should always
copy to the
same type to always have a safe copy operation from/to userland. So I prefer
__u32.
If you are sure that u32 is more correct here, then we use u32.
Best regards,
Guido
+
+ return put_user(timeout, (__u32 __user *)arg);
+}
+static int usbtmc_ioctl_set_timeout(struct usbtmc_file_data *file_data,
+ void __user *arg)
+{
+ __u32 timeout;
Ditto.
+ return 0;
+}
--
With Best Regards,
Andy Shevchenko
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html