On 16/07/15(Thu) 16:24, ludovic coues wrote: > I am looking for some insight about some choice in the code. > > In the file /sys/dev/usb/uvideo.h, the structure usb_video_header_desc > store a part of an USB descriptor. The entire descriptor is stored in > usb_video_header_desc_all which consist of fix, a pointer to the > former struct and baInterfaceNR, a pointer to uByte. > > I'm willing to replace that construction by merging the two struct. > The field fix would disappear and baInterfaceNR would be array of size > 1 at the end of the struct.
Please send a diff that implements that. If uvideo(4) works with it and that makes the header closer to the specification I don't see a reason not to integrate it. > But I don't know why this code is done this way. As it haven't been > touched since version 1.4 in 2008, I assume it's an old way of doing > things or a short term solution. If that the case, I'll go ahead and > change it. > Other possibility I think of is compiler on some architecture who > don't like struct ending with array of arbitrary size or that the > preferred way of doing things. Well you have a counter-example in the same file "struct usb_video_vc_processing_desc" M
