From: Johannes Berg Date: Thu, 11 Oct 2018 10:26:02 +0000 (+0200) Subject: iw: fix various static checker warnings X-Git-Tag: v5.0~20 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=bcdceae17af0d9a423cf35a3082359dd85044a69;p=thirdparty%2Fiw.git iw: fix various static checker warnings Signed-off-by: Johannes Berg --- diff --git a/ibss.c b/ibss.c index 84f1e95..f0e3de8 100644 --- 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 bdd39ee..b0166da 100644 --- 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 f7564fc..00610cd 100644 --- 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 dfdaf59..fc9579b 100644 --- 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 a798c70..ca7dbc6 100644 --- 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) diff --git a/station.c b/station.c index dba56b7..e1477ef 100644 --- 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] = {