[LEDE-DEV] [PATCH] mountd: Add static qualifier to missing variable declarations.

Rosen Penev rosenp at gmail.com
Sat Dec 17 15:41:05 PST 2016


-Wmissing-variable-declarations is missing in gcc but available in clang.

Signed-off by: Rosen Penev <rosenp at gmail.com>
---
 autofs.c |  8 ++++----
 fs.c     |  2 +-
 led.c    |  4 ++--
 mount.c  | 12 ++++++------
 signal.c |  2 +-
 timer.c  |  2 +-
 6 files changed, 15 insertions(+), 15 deletions(-)

diff --git a/autofs.c b/autofs.c
index 4ad782d..8c69cbe 100644
--- a/autofs.c
+++ b/autofs.c
@@ -30,11 +30,11 @@
 #include "include/ucix.h"
 #include "include/autofs.h"
 
-int fdin = 0; /* data coming out of the kernel */
-int fdout = 0;/* data going into the kernel */
-dev_t dev;
+static int fdin = 0; /* data coming out of the kernel */
+static int fdout = 0;/* data going into the kernel */
+static dev_t dev;
 
-time_t uci_timeout;
+static time_t uci_timeout;
 char uci_path[32];
 
 static void umount_autofs(void)
diff --git a/fs.c b/fs.c
index ca77a76..d9bcc63 100644
--- a/fs.c
+++ b/fs.c
@@ -191,7 +191,7 @@ out:
 	return ret;
 }
 
-dfunc funcs[] = {
+static dfunc funcs[] = {
 	detect_ext23,
 	detect_exfat,
 	detect_fat,
diff --git a/led.c b/led.c
index 62554e6..d373de0 100644
--- a/led.c
+++ b/led.c
@@ -14,7 +14,7 @@
  *   Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
  *
  *   Provided by fon.com
- *   Copyright (C) 2009 John Crispin <blogic at openwrt.org> 
+ *   Copyright (C) 2009 John Crispin <blogic at openwrt.org>
  */
 
 
@@ -27,7 +27,7 @@
 #include "include/timer.h"
 #include "include/led.h"
 
-char usbled[16];
+static char usbled[16];
 
 void led_ping(void)
 {
diff --git a/mount.c b/mount.c
index 8330abe..da62ae9 100644
--- a/mount.c
+++ b/mount.c
@@ -31,7 +31,7 @@
 
 int mount_new(char *path, char *dev);
 
-struct list_head mounts;
+static struct list_head mounts;
 
 struct mount {
 	struct list_head list;
@@ -48,7 +48,7 @@ struct mount {
 	int fs;
 };
 
-char *fs_names[] = {
+static char *fs_names[] = {
 	"",
 	"",
 	"mbr",
@@ -67,8 +67,8 @@ char *fs_names[] = {
 #define MAX_MOUNTED		32
 #define MAX_MOUNT_NAME	32
 
-char mounted[MAX_MOUNTED][3][MAX_MOUNT_NAME];
-int mounted_count = 0;
+static char mounted[MAX_MOUNTED][3][MAX_MOUNT_NAME];
+static int mounted_count = 0;
 extern char uci_path[32];
 
 static void mount_dump_uci_state(void)
@@ -663,8 +663,8 @@ static int dir_filter2(const struct dirent *a)
 	return 0;
 }
 #define MAX_BLOCK	64
-char block[MAX_BLOCK][MAX_BLOCK];
-int blk_cnt = 0;
+static char block[MAX_BLOCK][MAX_BLOCK];
+static int blk_cnt = 0;
 
 static int check_block(char *b)
 {
diff --git a/signal.c b/signal.c
index 4a4450c..6ab77da 100644
--- a/signal.c
+++ b/signal.c
@@ -7,7 +7,7 @@
 #include "include/led.h"
 #include "include/signal.h"
 
-void (*crtlc_cb)(void) = 0;
+static void (*crtlc_cb)(void) = 0;
 
 static void handlerINT(int s)
 {
diff --git a/timer.c b/timer.c
index b3adff4..f634af5 100644
--- a/timer.c
+++ b/timer.c
@@ -9,7 +9,7 @@
 
 /* when using this file, alarm() is used */
 
-struct list_head timers;
+static struct list_head timers;
 
 struct timer {
 	struct list_head list;
-- 
2.9.3




More information about the Lede-dev mailing list