]> git.ipfire.org Git - thirdparty/iw.git/commitdiff
iw: fix various static checker warnings
authorJohannes Berg <johannes.berg@intel.com>
Thu, 11 Oct 2018 10:26:02 +0000 (12:26 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Thu, 11 Oct 2018 10:26:12 +0000 (12:26 +0200)
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
ibss.c
iw.h
mesh.c
ocb.c
scan.c
station.c

diff --git a/ibss.c b/ibss.c
index 84f1e956b80e9e71c79538bbd33c294d1472e43e..f0e3de8bb43805965537a3ec09690d1f1059fb05 100644 (file)
--- a/ibss.c
+++ b/ibss.c
@@ -37,7 +37,7 @@ static int join_ibss(struct nl80211_state *state,
        argv += parsed;
        argc -= parsed;
 
-       put_chandef(msg, &chandef);
+       err = put_chandef(msg, &chandef);
        if (err)
                return err;
 
diff --git a/iw.h b/iw.h
index bdd39ee7b82176b4e3f3412ec6ddd1849ab9b624..b0166da941ba751ad7771d9dcc988bc6d9150e6a 100644 (file)
--- a/iw.h
+++ b/iw.h
@@ -130,6 +130,7 @@ struct chandef {
        __COMMAND(&(__section ## _ ## section), name, #name, args, cmd, flags, 1, idby, handler, NULL, NULL)
 
 #define TOPLEVEL(_name, _args, _nlcmd, _flags, _idby, _handler, _help) \
+       extern struct cmd __section ## _ ## _name; /* sparse */         \
        struct cmd                                                      \
        __section ## _ ## _name                                         \
        __attribute__((used)) __attribute__((section("__cmd"))) = {     \
@@ -142,6 +143,7 @@ struct chandef {
                .help = (_help),                                        \
         }
 #define SECTION(_name)                                                 \
+       extern struct cmd __section ## _ ## _name; /* sparse */         \
        struct cmd __section ## _ ## _name                              \
        __attribute__((used)) __attribute__((section("__cmd"))) = {     \
                .name = (#_name),                                       \
diff --git a/mesh.c b/mesh.c
index f7564fc079fc6070d0b23ac5e1e9fb41618c0928..00610cd60a65cc9cb023d966b85b9f9a05fc97e7 100644 (file)
--- a/mesh.c
+++ b/mesh.c
@@ -467,7 +467,7 @@ static int join_mesh(struct nl80211_state *state,
                argv += parsed + 1;
                argc -= parsed + 1;
 
-               put_chandef(msg, &chandef);
+               err = put_chandef(msg, &chandef);
                if (err)
                        return err;
        }
diff --git a/ocb.c b/ocb.c
index dfdaf59e7095479cd4907ee31715ebf92ddbf9dd..fc9579b8f3d0603bb0c003ec69395e32360b9089 100644 (file)
--- a/ocb.c
+++ b/ocb.c
@@ -21,7 +21,7 @@ static int join_ocb(struct nl80211_state *state,
        if (err)
                return err;
 
-       put_chandef(msg, &chandef);
+       err = put_chandef(msg, &chandef);
        if (err)
                return err;
 
diff --git a/scan.c b/scan.c
index a798c70a7dccbcaab40432c52faa67f0dffa92b3..ca7dbc6d36c95194de99ce0e74038dd494393b18 100644 (file)
--- a/scan.c
+++ b/scan.c
@@ -2003,7 +2003,8 @@ static void print_vendor(unsigned char len, unsigned char *data,
                    wifiprinters[data[3]].name &&
                    wifiprinters[data[3]].flags & BIT(ptype)) {
                        print_ie(&wifiprinters[data[3]],
-                                data[3], len - 4, data + 4, 0);
+                                data[3], len - 4, data + 4,
+                                NULL);
                        return;
                }
                if (!unknown)
@@ -2020,7 +2021,8 @@ static void print_vendor(unsigned char len, unsigned char *data,
                    wfa_printers[data[3]].name &&
                    wfa_printers[data[3]].flags & BIT(ptype)) {
                        print_ie(&wfa_printers[data[3]],
-                                data[3], len - 4, data + 4, 0);
+                                data[3], len - 4, data + 4,
+                                NULL);
                        return;
                }
                if (!unknown)
index dba56b73f3558e91a42bab9cac0a9fea27f2c8aa..e1477efe88e3644381b762c32180e48562f3e22e 100644 (file)
--- a/station.c
+++ b/station.c
@@ -99,7 +99,8 @@ int parse_txq_stats(char *buf, int buflen, struct nlattr *tid_stats_attr, int he
        return pos - buf;
 
 }
-void parse_tid_stats(struct nlattr *tid_stats_attr)
+
+static void parse_tid_stats(struct nlattr *tid_stats_attr)
 {
        struct nlattr *stats_info[NL80211_TID_STATS_MAX + 1], *tidattr, *info;
        static struct nla_policy stats_policy[NL80211_TID_STATS_MAX + 1] = {
@@ -146,7 +147,7 @@ void parse_tid_stats(struct nlattr *tid_stats_attr)
                printf("\n\tTXQs:%s", txqbuf);
 }
 
-void parse_bss_param(struct nlattr *bss_param_attr)
+static void parse_bss_param(struct nlattr *bss_param_attr)
 {
        struct nlattr *bss_param_info[NL80211_STA_BSS_PARAM_MAX + 1], *info;
        static struct nla_policy bss_poilcy[NL80211_STA_BSS_PARAM_MAX + 1] = {