media: uvcvideo: Use indexed loops in uvc_ctrl_init_ctrl()
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Mon, 18 Jul 2022 11:56:54 +0000 (13:56 +0200)
committerMauro Carvalho Chehab <mchehab@kernel.org>
Tue, 30 Aug 2022 14:05:00 +0000 (16:05 +0200)
commitc58874df1051c2baee8dabb8c476c3e476923923
treeafcef942c9ac49c9efc48bbd5833a0e0a2bf6c02
parentf0f078457f18f10696888f8d0e6aba9deb9cde92
media: uvcvideo: Use indexed loops in uvc_ctrl_init_ctrl()

As shown by the bug introduced in commit 86f7ef773156 ("media: uvcvideo:
Add support for per-device control mapping overrides"), the loop style
used by uvc_ctrl_init_ctrl() is error-prone. Rewrite the loops to use
indices instead.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Ricardo Ribalda <ribalda@chromium.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
drivers/media/usb/uvc/uvc_ctrl.c