Re: [PATCH 01/19] User-space API definition

From: Nikos Mavrogiannopoulos
Date: Sat Aug 21 2010 - 03:35:54 EST


2010/8/20 Stefan Richter <stefanr@xxxxxxxxxxxxxxxxx>:

>> +struct ncr_session_input_data {
>> + Â Â const void __user *data;
>> + Â Â __kernel_size_t data_size;
>> +};
>> +
>> +};
> Why not using fixed-size fit-all members?
> struct ncr_session_input_data {
> Â Â Â Â__u64 data; Â Â Â Â Â Â /* user pointer, cast to/from u64 */
> Â Â Â Â__u32 data_size; Â Â Â Â/* or __u64? */
> };

A reason is that using (void*) is cleaner as an API. It avoids the
pointer to int casting and the warnings that such a cast will have.

regards,
Nikos
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/