[yavta] [PATCH 2/3] Constify various global variables

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Laurent Pinchart <laurent.pinchart+renesas@xxxxxxxxxxxxxxxx>

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@xxxxxxxxxxxxxxxx>
---
 yavta.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

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'},
-- 
Regards,

Laurent Pinchart





[Index of Archives]     [Linux Samsung SOC]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux