From: Johannes Berg Date: Mon, 8 Dec 2008 17:30:22 +0000 (+0100) Subject: fix sparse warnings X-Git-Tag: v0.9.8~10 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=656aa246fc6ea3eddbe233873cde7fcd21febd92;p=thirdparty%2Fiw.git fix sparse warnings --- diff --git a/genl.c b/genl.c index 8f83d13..e99ea9d 100644 --- a/genl.c +++ b/genl.c @@ -9,6 +9,8 @@ #include #include +#include "iw.h" + static int error_handler(struct sockaddr_nl *nla, struct nlmsgerr *err, void *arg) { diff --git a/iw.c b/iw.c index 5859180..7396052 100644 --- a/iw.c +++ b/iw.c @@ -23,7 +23,7 @@ #include "iw.h" #include "version.h" -int debug = 0; +static int debug = 0; static int nl80211_init(struct nl80211_state *state) { diff --git a/mesh.c b/mesh.c index d116422..d6edf3f 100644 --- a/mesh.c +++ b/mesh.c @@ -93,32 +93,32 @@ static uint32_t _parse_u32(const char *str, _any *ret) return 0; } -void _print_u8(struct nlattr *a) +static void _print_u8(struct nlattr *a) { printf("%d", nla_get_u8(a)); } -void _print_u16(struct nlattr *a) +static void _print_u16(struct nlattr *a) { printf("%d", nla_get_u16(a)); } -void _print_u16_timeout(struct nlattr *a) +static void _print_u16_timeout(struct nlattr *a) { printf("%d milliseconds", nla_get_u16(a)); } -void _print_u16_in_TUs(struct nlattr *a) +static void _print_u16_in_TUs(struct nlattr *a) { printf("%d TUs", nla_get_u16(a)); } -void _print_u32_timeout(struct nlattr *a) +static void _print_u32_timeout(struct nlattr *a) { printf("%u milliseconds", nla_get_u32(a)); } -void _print_u32_in_TUs(struct nlattr *a) +static void _print_u32_in_TUs(struct nlattr *a) { printf("%d TUs", nla_get_u32(a)); } @@ -213,6 +213,7 @@ static int set_interface_meshparam(struct nl_cb *cb, int err; uint32_t ret; const struct mesh_param_descr *mdescr; + struct nlattr *container; _any any; mdescr = find_mesh_param(argc, argv, "change"); @@ -233,8 +234,7 @@ static int set_interface_meshparam(struct nl_cb *cb, } /* Construct a netlink message */ - struct nlattr *container = - nla_nest_start(msg, NL80211_ATTR_MESH_PARAMS); + container = nla_nest_start(msg, NL80211_ATTR_MESH_PARAMS); if (!container) return -ENOBUFS; err = mdescr->nla_put_fn(msg, mdescr->mesh_param_num, &any); diff --git a/reg.c b/reg.c index e8d46a5..01573d3 100644 --- a/reg.c +++ b/reg.c @@ -11,7 +11,7 @@ #include "nl80211.h" #include "iw.h" -int isalpha_upper(char letter) +static int isalpha_upper(char letter) { if (letter >= 65 && letter <= 90) return 1;