]> git.baikalelectronics.ru Git - kernel.git/commit
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 24 May 2023 16:32:36 +0000 (17:32 +0100)
commite655ce8972eef7c7fc8e8ce49e0b3e3f3552ada0
tree6649f7364ffb2333a2ac8f451f6b898bd277b3fa
parente155a9468d8f30078408c47c5c1be99db8bdc09f
media: Prefer designated initializers over memset for subdev pad ops

[ Upstream commit e3a69496a1cde364c74a600d7a370179b58aed29 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
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