aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil-cisco@xs4all.nl>2021-04-21 10:10:27 +0200
committerHans Verkuil <hverkuil-cisco@xs4all.nl>2021-04-21 10:10:27 +0200
commit928c17308039c0e48ac72388ac4ea0be371ff00e (patch)
tree67b9ffafd03e58e87bb320c640cce785dd8ffe1d
parentd5f30a0722c2aa28eba90739062faf231cf9133d (diff)
v4l2-ctl: add missing const, use {} instead of memset
Add missing const to the static struct mbus_name mbus_names array. Use struct v4l2_subdev_mbus_code_enum mbus_code = {}; instead of memsetting the struct to zero. This is based on a patch from Rosen Penev <rosenp@gmail.com>. Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-rw-r--r--utils/v4l2-ctl/v4l2-ctl-subdev.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/utils/v4l2-ctl/v4l2-ctl-subdev.cpp b/utils/v4l2-ctl/v4l2-ctl-subdev.cpp
index d0f391bb..ecfd3244 100644
--- a/utils/v4l2-ctl/v4l2-ctl-subdev.cpp
+++ b/utils/v4l2-ctl/v4l2-ctl-subdev.cpp
@@ -5,7 +5,7 @@ struct mbus_name {
__u32 code;
};
-static struct mbus_name mbus_names[] = {
+static const struct mbus_name mbus_names[] = {
{ "Fixed", MEDIA_BUS_FMT_FIXED },
#include "media-bus-format-names.h"
{ nullptr, 0 }
@@ -568,9 +568,8 @@ static void print_mbus_code(__u32 code)
static void print_mbus_codes(int fd, __u32 pad)
{
- struct v4l2_subdev_mbus_code_enum mbus_code;
+ struct v4l2_subdev_mbus_code_enum mbus_code = {};
- memset(&mbus_code, 0, sizeof(mbus_code));
mbus_code.pad = pad;
mbus_code.which = V4L2_SUBDEV_FORMAT_TRY;

Privacy Policy