Re: [PATCH 17/32] staging: gasket: annotate ioctl arg with __user

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

 



On Thu, Jul 19, 2018 at 07:44:53PM -0700, Todd Poynor wrote:
> >>  /* Type of the ioctl permissions check callback. See below. */
> >>  typedef int (*gasket_ioctl_permissions_cb_t)(
> >> -     struct file *filp, uint cmd, ulong arg);
> >> +     struct file *filp, uint cmd, void __user *arg);
> >>
> >>  /*
> >>   * Device type descriptor.
> >> @@ -549,7 +549,7 @@ struct gasket_driver_desc {
> >>        * return -EINVAL. Should return an error status (either -EINVAL or
> >>        * the error result of the ioctl being handled).
> >>        */
> >> -     long (*ioctl_handler_cb)(struct file *filp, uint cmd, ulong arg);
> >> +     long (*ioctl_handler_cb)(struct file *filp, uint cmd, void __user *arg);
> >
> > Why are you not using the typedef above?
> 
> There's a typedef for the permissions check callback, but not for the
> handler callback.  It's a bit confusing, so I tried adding a typedef
> for the handler, but now checkpatch is spanking me for adding new
> typedefs -- maybe I should drop the existing typedef?

No, typedefs for function pointers is just fine, checkpatch should not
be complaining about that.  And even if it is, it's just a guideline,
not a hard rule that you have to abide by everything it says :)

thanks,

greg k-h
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux