On Wed, Feb 07, 2007 at 11:10:24AM +0100, Laurent Pinchart wrote:
> 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.
I am all for having compiler checks as strict as possible.
Thing is, you have two pieces of code (uvcvideo.h and uvc_video.c)
which conflict in the use of this field, so one way or the other
you need to sort it out :)
The alternative then could be to fix uvc_video.c::uvc_video_decode()
around line 296:
/* Copy the video data to the buffer. */
len -= data[0];
maxlen = buf->buf.length - buf->buf.bytesused;
- mem = queue->mem + buf->buf.m.offset + buf->buf.bytesused;
+ mem = (char *)queue->mem + buf->buf.m.offset + buf->buf.bytesused;
nbytes = min(len, maxlen);
memcpy(mem, data + data[0], nbytes);
buf->buf.bytesused += nbytes;
> > On passing - i notice that in a couple of structs
> > in uvcvideo.h you are used unnamed unions, which are
>..
> 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.
ok it was just a portability issue, which i can handle locally
on FreeBSD.
thanks
luigi
_______________________________________________
Linux-uvc-devel mailing list
[email protected]
https://lists.berlios.de/mailman/listinfo/linux-uvc-devel