diff mbox series

[yavta,2/3] Constify various global variables

Message ID 20250408233323.7650-3-laurent.pinchart@ideasonboard.com
State New
Headers show
Series Add colorspace support | expand

Commit Message

Laurent Pinchart April 8, 2025, 11:33 p.m. UTC
From: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>

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 <laurent.pinchart+renesas@ideasonboard.com>
---
 yavta.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/yavta.c b/yavta.c
index 89b5c4a24cfc..4f7306daa0ce 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'},