linux/drivers/staging/media
Laurent Pinchart 83c42283bf media: Prefer designated initializers over memset for subdev pad ops
[ Upstream commit e3a69496a1 ]

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>
History 2023-05-24 17:32:36 +01:00
..
atomisp media: atomisp: Only set default_run_mode on first open of a stream/asd 2023-03-10 09:33:44 +01:00
deprecated media: av7110: prevent underflow in write_ts_to_decoder() 2023-05-11 23:03:10 +09:00
imx media: Prefer designated initializers over memset for subdev pad ops 2023-05-24 17:32:36 +01:00
ipu3 ipu3-imgu: Fix NULL pointer dereference in imgu_subdev_set_selection() 2023-01-07 11:11:51 +01:00
max96712 i2c: Make remove callback return void 2022-08-16 12:46:26 +02:00
meson/vdec media: meson: vdec: fix possible refcount leak in vdec_probe() 2022-09-24 08:55:43 +02:00
omap4iss media: Prefer designated initializers over memset for subdev pad ops 2023-05-24 17:32:36 +01:00
rkvdec media: rkvdec: fix use after free bug in rkvdec_remove 2023-05-11 23:03:14 +09:00
sunxi media: cedrus: fix use after free bug in cedrus_remove due to race condition 2023-05-11 23:03:14 +09:00
tegra-video staging: media: tegra-video: fix device_node use after free 2023-01-07 11:11:49 +01:00
Kconfig media: destage Hantro VPU driver 2022-08-31 10:23:50 +02:00
Makefile media: destage Hantro VPU driver 2022-08-31 10:23:50 +02:00