diff options
author | Laurent Pinchart <laurent.pinchart@ideasonboard.com> | 2023-02-15 17:18:39 +0200 |
---|---|---|
committer | Hans Verkuil <hverkuil-cisco@xs4all.nl> | 2023-04-12 09:46:07 +0200 |
commit | e18a7e9a2d34a32482e4069fcedf30a7bc9e9ef5 (patch) | |
tree | 8df9e432aa2fd7f6c9e45b9700610a0a8262b8ab /drivers/media/pci/cobalt | |
parent | e3a69496a1cde364c74a600d7a370179b58aed29 (diff) | |
download | linux-stable-e18a7e9a2d34a32482e4069fcedf30a7bc9e9ef5.tar.gz linux-stable-e18a7e9a2d34a32482e4069fcedf30a7bc9e9ef5.tar.bz2 linux-stable-e18a7e9a2d34a32482e4069fcedf30a7bc9e9ef5.zip |
media: Use designated initializers for all subdev pad ops
Structures passed to subdev pad operations are all zero-initialized when
declaring variables. In most cases, this is done with designated
initializers to initialize some of the fields to specific values, but in
a minority of cases the structures are zero-initialized by assigning
them to '{ 0 }' or '{ }'.
Improve coding style consistency by using designated initializers where
possible, always initializing the 'which' field.
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
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>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Diffstat (limited to 'drivers/media/pci/cobalt')
-rw-r--r-- | drivers/media/pci/cobalt/cobalt-v4l2.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/media/pci/cobalt/cobalt-v4l2.c b/drivers/media/pci/cobalt/cobalt-v4l2.c index 284c0909a282..4bfbcca14f60 100644 --- a/drivers/media/pci/cobalt/cobalt-v4l2.c +++ b/drivers/media/pci/cobalt/cobalt-v4l2.c @@ -910,7 +910,9 @@ static int cobalt_s_fmt_vid_out(struct file *file, void *priv_fh, { struct cobalt_stream *s = video_drvdata(file); struct v4l2_pix_format *pix = &f->fmt.pix; - struct v4l2_subdev_format sd_fmt = { 0 }; + struct v4l2_subdev_format sd_fmt = { + .which = V4L2_SUBDEV_FORMAT_ACTIVE, + }; u32 code; if (cobalt_try_fmt_vid_out(file, priv_fh, f)) @@ -941,7 +943,6 @@ static int cobalt_s_fmt_vid_out(struct file *file, void *priv_fh, s->xfer_func = pix->xfer_func; s->ycbcr_enc = pix->ycbcr_enc; s->quantization = pix->quantization; - sd_fmt.which = V4L2_SUBDEV_FORMAT_ACTIVE; v4l2_fill_mbus_format(&sd_fmt.format, pix, code); v4l2_subdev_call(s->sd, pad, set_fmt, NULL, &sd_fmt); return 0; |