On Tue, Dec 15, 2015 at 07:48:22PM +0000, Simmons, James A. wrote:
> >On Tue, Dec 15, 2015 at 06:14:19PM +0000, Simmons, James A. wrote:
> >>   
> >> >>  struct libcfs_ioctl_hdr {
> >> >>         __u32 ioc_len;
> >> >> @@ -87,6 +88,13 @@ do {                                             \
> >> >>         data.ioc_hdr.ioc_len = sizeof(data);                    \
> >> >>  } while (0)
> >> >>  
> >> >> +#define LIBCFS_IOC_INIT_V2(data, hdr)                  \
> >> >> +do {                                                   \
> >> >> +       memset(&(data), 0, sizeof(data));               \
> >> >> +       (data).hdr.ioc_version = LIBCFS_IOCTL_VERSION2; \
> >> >> +       (data).hdr.ioc_len = sizeof(data);              \
> >> >> +} while (0)
> >> >> +
> >> >
> >> >Do we really need this?
> >> 
> >> Would you be okay if this was a inline function? This is used by user
> >> land and kernel space code.
> >
> >Then your code is broken, please never do that.
> 
> This brings up a good point. This header doesn't contain structures for 
> userland so it is a uapi
> type header.  Should such headers only contain data structures?

Yes, that would make more sense.

thanks,

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

Reply via email to