media: Prefer designated initializers over memset for subdev pad ops
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Wed, 15 Feb 2023 15:18:39 +0000 (17:18 +0200)
committerHans Verkuil <hverkuil-cisco@xs4all.nl>
Wed, 12 Apr 2023 07:46:06 +0000 (09:46 +0200)
commite3a69496a1cde364c74a600d7a370179b58aed29
treeb7126106ed563f46d6087763dcaf4bd66ebc04a8
parentecefa105cc44fff6d170ac5f441e76cb229f8e19
media: Prefer designated initializers over memset for subdev pad ops

Structures passed to subdev pad operations are all zero-initialized, but
not always with the same kind of code constructs. While most drivers
used designated initializers, which zero all the fields that are not
specified, when declaring variables, some use memset(). Those two
methods lead to the same end result, and, depending on compiler
optimizations, may even be completely equivalent, but they're not
consistent.

Improve coding style consistency by using designated initializers
instead of calling memset(). Where applicable, also move the variables
to inner scopes of for loops to ensure correct initialization in all
iterations.

Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Reviewed-by: Lad Prabhakar <prabhakar.csengg@gmail.com> # For am437x
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Reviewed-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Reviewed-by: Kieran Bingham <kieran.bingham+renesas@ideasonboard.com>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
drivers/media/platform/renesas/vsp1/vsp1_drm.c
drivers/media/platform/renesas/vsp1/vsp1_entity.c
drivers/media/platform/samsung/exynos4-is/fimc-capture.c
drivers/media/platform/ti/am437x/am437x-vpfe.c
drivers/media/platform/ti/cal/cal-video.c
drivers/media/usb/dvb-usb/cxusb-analog.c
drivers/staging/media/imx/imx-media-capture.c
drivers/staging/media/imx/imx-media-utils.c
drivers/staging/media/omap4iss/iss_video.c