diff mbox series

[v7,2/6] ivtv-ioctl.c: Do not initialize the reserved field of struct v4l2_fmtdesc

Message ID 20200413202351.1359754-3-niklas.soderlund+renesas@ragnatech.se (mailing list archive)
State New, archived
Headers show
Series v4l2-dev/ioctl: Add V4L2_CAP_IO_MC | expand

Commit Message

Niklas Söderlund April 13, 2020, 8:23 p.m. UTC
One of the reserved fields are about to be used. Instead of updating the
driver to only initialize three instead of four reserved fields remove
the explicit assignment.  As if one field in a struct is assigned, the
memory is zeroed and explicit assignment is redundant.

Reported-by: kbuild test robot <lkp@intel.com>
Suggested-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
---
 drivers/media/pci/ivtv/ivtv-ioctl.c | 4 ----
 1 file changed, 4 deletions(-)

Comments

Hans Verkuil April 17, 2020, 7:22 a.m. UTC | #1
Hi Niklas,

On 13/04/2020 22:23, Niklas Söderlund wrote:
> One of the reserved fields are about to be used. Instead of updating the
> driver to only initialize three instead of four reserved fields remove
> the explicit assignment.  As if one field in a struct is assigned, the
> memory is zeroed and explicit assignment is redundant.
> 
> Reported-by: kbuild test robot <lkp@intel.com>
> Suggested-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>

Can you replace this with this patch from Laurent when you post the v8?

https://patchwork.linuxtv.org/patch/62430/

I like that one better, and it fixes cx18 as well.

Regards,

	Hans

> ---
>  drivers/media/pci/ivtv/ivtv-ioctl.c | 4 ----
>  1 file changed, 4 deletions(-)
> 
> diff --git a/drivers/media/pci/ivtv/ivtv-ioctl.c b/drivers/media/pci/ivtv/ivtv-ioctl.c
> index 137853944e4619cb..8a45c50411c74831 100644
> --- a/drivers/media/pci/ivtv/ivtv-ioctl.c
> +++ b/drivers/media/pci/ivtv/ivtv-ioctl.c
> @@ -922,12 +922,10 @@ static int ivtv_enum_fmt_vid_cap(struct file *file, void *fh, struct v4l2_fmtdes
>  	static const struct v4l2_fmtdesc hm12 = {
>  		0, V4L2_BUF_TYPE_VIDEO_CAPTURE, 0,
>  		"HM12 (YUV 4:2:0)", V4L2_PIX_FMT_HM12,
> -		{ 0, 0, 0, 0 }
>  	};
>  	static const struct v4l2_fmtdesc mpeg = {
>  		0, V4L2_BUF_TYPE_VIDEO_CAPTURE, V4L2_FMT_FLAG_COMPRESSED,
>  		"MPEG", V4L2_PIX_FMT_MPEG,
> -		{ 0, 0, 0, 0 }
>  	};
>  	struct ivtv *itv = fh2id(fh)->itv;
>  	struct ivtv_stream *s = &itv->streams[fh2id(fh)->type];
> @@ -948,12 +946,10 @@ static int ivtv_enum_fmt_vid_out(struct file *file, void *fh, struct v4l2_fmtdes
>  	static const struct v4l2_fmtdesc hm12 = {
>  		0, V4L2_BUF_TYPE_VIDEO_OUTPUT, 0,
>  		"HM12 (YUV 4:2:0)", V4L2_PIX_FMT_HM12,
> -		{ 0, 0, 0, 0 }
>  	};
>  	static const struct v4l2_fmtdesc mpeg = {
>  		0, V4L2_BUF_TYPE_VIDEO_OUTPUT, V4L2_FMT_FLAG_COMPRESSED,
>  		"MPEG", V4L2_PIX_FMT_MPEG,
> -		{ 0, 0, 0, 0 }
>  	};
>  	struct ivtv *itv = fh2id(fh)->itv;
>  	struct ivtv_stream *s = &itv->streams[fh2id(fh)->type];
>
diff mbox series

Patch

diff --git a/drivers/media/pci/ivtv/ivtv-ioctl.c b/drivers/media/pci/ivtv/ivtv-ioctl.c
index 137853944e4619cb..8a45c50411c74831 100644
--- a/drivers/media/pci/ivtv/ivtv-ioctl.c
+++ b/drivers/media/pci/ivtv/ivtv-ioctl.c
@@ -922,12 +922,10 @@  static int ivtv_enum_fmt_vid_cap(struct file *file, void *fh, struct v4l2_fmtdes
 	static const struct v4l2_fmtdesc hm12 = {
 		0, V4L2_BUF_TYPE_VIDEO_CAPTURE, 0,
 		"HM12 (YUV 4:2:0)", V4L2_PIX_FMT_HM12,
-		{ 0, 0, 0, 0 }
 	};
 	static const struct v4l2_fmtdesc mpeg = {
 		0, V4L2_BUF_TYPE_VIDEO_CAPTURE, V4L2_FMT_FLAG_COMPRESSED,
 		"MPEG", V4L2_PIX_FMT_MPEG,
-		{ 0, 0, 0, 0 }
 	};
 	struct ivtv *itv = fh2id(fh)->itv;
 	struct ivtv_stream *s = &itv->streams[fh2id(fh)->type];
@@ -948,12 +946,10 @@  static int ivtv_enum_fmt_vid_out(struct file *file, void *fh, struct v4l2_fmtdes
 	static const struct v4l2_fmtdesc hm12 = {
 		0, V4L2_BUF_TYPE_VIDEO_OUTPUT, 0,
 		"HM12 (YUV 4:2:0)", V4L2_PIX_FMT_HM12,
-		{ 0, 0, 0, 0 }
 	};
 	static const struct v4l2_fmtdesc mpeg = {
 		0, V4L2_BUF_TYPE_VIDEO_OUTPUT, V4L2_FMT_FLAG_COMPRESSED,
 		"MPEG", V4L2_PIX_FMT_MPEG,
-		{ 0, 0, 0, 0 }
 	};
 	struct ivtv *itv = fh2id(fh)->itv;
 	struct ivtv_stream *s = &itv->streams[fh2id(fh)->type];