[PATCH v2] fix or supress various sparse warnings
Johannes Berg
johannes at sipsolutions.net
Thu Jan 26 04:09:25 PST 2017
From: Johannes Berg <johannes.berg at intel.com>
Signed-off-by: Johannes Berg <johannes.berg at intel.com>
---
src/ap/taxonomy.c | 1 +
src/fst/fst_iface.h | 2 +-
src/rsn_supp/tdls.c | 3 ++-
wpa_supplicant/rrm.c | 4 ++--
wpa_supplicant/wpa_supplicant.c | 5 ++++-
5 files changed, 10 insertions(+), 5 deletions(-)
diff --git a/src/ap/taxonomy.c b/src/ap/taxonomy.c
index cea8b726f47a..ae157a7c91d6 100644
--- a/src/ap/taxonomy.c
+++ b/src/ap/taxonomy.c
@@ -21,6 +21,7 @@
#include "common/wpa_ctrl.h"
#include "hostapd.h"
#include "sta_info.h"
+#include "taxonomy.h"
/* Copy a string with no funny schtuff allowed; only alphanumerics. */
diff --git a/src/fst/fst_iface.h b/src/fst/fst_iface.h
index 0eb27325a2b8..cbaa7d81788d 100644
--- a/src/fst/fst_iface.h
+++ b/src/fst/fst_iface.h
@@ -106,7 +106,7 @@ static inline void fst_iface_update_mb_ie(struct fst_iface *i,
const u8 *addr,
const u8 *buf, size_t size)
{
- return i->iface_obj.update_mb_ie(i->iface_obj.ctx, addr, buf, size);
+ i->iface_obj.update_mb_ie(i->iface_obj.ctx, addr, buf, size);
}
static inline const u8 * fst_iface_get_peer_first(struct fst_iface *i,
diff --git a/src/rsn_supp/tdls.c b/src/rsn_supp/tdls.c
index f57311e8bfab..e4ac24ff2b92 100644
--- a/src/rsn_supp/tdls.c
+++ b/src/rsn_supp/tdls.c
@@ -1201,9 +1201,10 @@ skip_ies:
#ifdef CONFIG_TDLS_TESTING
if (tdls_testing & TDLS_TESTING_DIFF_BSSID) {
+ struct wpa_tdls_lnkid *l = (struct wpa_tdls_lnkid *) pos;
+
wpa_printf(MSG_DEBUG, "TDLS: Testing - use incorrect BSSID in "
"Link Identifier");
- struct wpa_tdls_lnkid *l = (struct wpa_tdls_lnkid *) pos;
wpa_tdls_linkid(sm, peer, l);
l->bssid[5] ^= 0x01;
pos += sizeof(*l);
diff --git a/wpa_supplicant/rrm.c b/wpa_supplicant/rrm.c
index 92cc8ce27582..36a8336e7a88 100644
--- a/wpa_supplicant/rrm.c
+++ b/wpa_supplicant/rrm.c
@@ -633,8 +633,8 @@ static int * wpas_beacon_request_freqs(struct wpa_supplicant *wpa_s,
}
-int wpas_get_op_chan_phy(int freq, const u8 *ies, size_t ies_len,
- u8 *op_class, u8 *chan, u8 *phy_type)
+static int wpas_get_op_chan_phy(int freq, const u8 *ies, size_t ies_len,
+ u8 *op_class, u8 *chan, u8 *phy_type)
{
const u8 *ie;
int sec_chan = 0, vht = 0;
diff --git a/wpa_supplicant/wpa_supplicant.c b/wpa_supplicant/wpa_supplicant.c
index bc59c6760990..8f88b46108bc 100644
--- a/wpa_supplicant/wpa_supplicant.c
+++ b/wpa_supplicant/wpa_supplicant.c
@@ -3746,8 +3746,11 @@ static int wpa_set_htcap_mcs(struct wpa_supplicant *wpa_s,
wpa_msg(wpa_s, MSG_DEBUG, "set_htcap, ht_mcs -:%s:-", ht_mcs);
for (i = 0; i < IEEE80211_HT_MCS_MASK_LEN; i++) {
+ long v;
+
errno = 0;
- long v = strtol(tmp, &end, 16);
+ v = strtol(tmp, &end, 16);
+
if (errno == 0) {
wpa_msg(wpa_s, MSG_DEBUG,
"htcap value[%i]: %ld end: %p tmp: %p",
--
2.9.3
More information about the Hostap
mailing list