media: uvcvideo: Remove void casting for the status endpoint
authorRicardo Ribalda <ribalda@chromium.org>
Tue, 20 Dec 2022 22:56:44 +0000 (23:56 +0100)
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Sun, 15 Jan 2023 21:45:10 +0000 (23:45 +0200)
commitadfd3910c27fbc0959ae5f1dafaec563f7d0bdd2
tree5481736eba5f65952bf84dfcbbdc6e0496d0bcdc
parent0ce75d5ecd9edaa027c0c2a7df0edcdf59ea7738
media: uvcvideo: Remove void casting for the status endpoint

Make the code more resilient, by replacing the castings with proper
structure definitions and using offsetof() instead of open coding the
location of the data.

Suggested-by: Sergey Senozhatsky <senozhatsky@chromium.org>
Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Reviewed-by: Andrzej Pietrasiewicz <andrzej.p@collabora.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Sergey Senozhatsky <senozhatsky@chromium.org>
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
drivers/media/usb/uvc/uvc_status.c
drivers/media/usb/uvc/uvcvideo.h