From bc29c7512fff1770c98fc369228bd56541df2791 Mon Sep 17 00:00:00 2001 From: Laurent Pinchart Date: Mon, 7 Apr 2025 22:51:19 +0300 Subject: Constify various global variables Multiple global variables are not meant to be modified. Make the const. While at it, drop an incorrect description of a section header. Signed-off-by: Laurent Pinchart Reviewed-by: Sakari Ailus --- yavta.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'yavta.c') diff --git a/yavta.c b/yavta.c index 89b5c4a..4f7306d 100644 --- a/yavta.c +++ b/yavta.c @@ -185,7 +185,7 @@ static int pause_init(void) } /* ----------------------------------------------------------------------------- - * Pause Handling + * Format handling */ static bool video_is_mplane(struct device *dev) @@ -214,7 +214,7 @@ static bool video_is_output(struct device *dev) dev->type == V4L2_BUF_TYPE_META_OUTPUT; } -static struct { +static const struct { enum v4l2_buf_type type; bool supported; const char *name; @@ -261,7 +261,7 @@ static const char *v4l2_buf_type_name(enum v4l2_buf_type type) return "Unknown"; } -static struct v4l2_format_info { +static const struct v4l2_format_info { const char *name; unsigned int fourcc; unsigned char n_planes; @@ -449,6 +449,10 @@ static const char *v4l2_field_name(enum v4l2_field field) return "unknown"; } +/* ----------------------------------------------------------------------------- + * + */ + static void video_set_buf_type(struct device *dev, enum v4l2_buf_type type) { dev->type = type; @@ -2329,7 +2333,7 @@ static void usage(const char *argv0) #define OPT_DATA_PREFIX 271 #define OPT_RESET_CONTROLS 272 -static struct option opts[] = { +static const struct option opts[] = { {"buffer-size", 1, 0, OPT_BUFFER_SIZE}, {"buffer-type", 1, 0, 'B'}, {"capture", 2, 0, 'c'}, -- cgit v1.2.3