Hi Luigi,

> attached are just a couple of trivial patches to
> uvcvideo to suppress some compiler warnings - one
> related to a missing const, one related to
> pointer arithmetic done on a void *

I applied the missing const and the missing static modifications.

I'm not sure to agree with the void* arithmetic patch. Have a look at 
http://kerneltrap.org/node/3848. The mem field is a pointer to a storage 
area, which is not supposed to be accessed by the driver. Keeping the pointer 
void helps catching illegal accesses to the memory. I'd rather cast the 
pointer to an integer type before performing arithmetic.

> On passing - i notice that in a couple of structs
> in uvcvideo.h you are used unnamed unions, which are
> a gcc extension which is not guaranteed to be supported
> in the future.
>
> I suppose that, besides convenience, the choice has been
> inspired by a similar pattern in videodev2.h .
>
> Before the use gets too widespread, it might be a good
> idea to use standard C and put a name to the union ?
> The changes to the source now are relatively small,
> and this would prevent the use
> of unnamed unions in derived works, which would require
> far more work to be fixed.

I don't plan to make anonymous unions widespread in the driver. The two 
anonymous unions have been made anonymous to make the code easier to read, 
and not to mimic videodev2.h. I don't think they are an issue for internal 
driver structures.

Best regards, and thanks for your help.

Laurent Pinchart
_______________________________________________
Linux-uvc-devel mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/linux-uvc-devel

Reply via email to