Remove unused variables

This commit is contained in:
Jouni Malinen 2011-10-23 12:42:55 +03:00
parent 80267c9cec
commit 46eeedac61
4 changed files with 21 additions and 17 deletions

View file

@ -1230,7 +1230,10 @@ static int robust_action_frame(u8 category)
static void handle_action(struct hostapd_data *hapd, static void handle_action(struct hostapd_data *hapd,
const struct ieee80211_mgmt *mgmt, size_t len) const struct ieee80211_mgmt *mgmt, size_t len)
{ {
#if defined(CONFIG_IEEE80211W) || defined(CONFIG_IEEE80211R)
struct sta_info *sta; struct sta_info *sta;
sta = ap_get_sta(hapd, mgmt->sa);
#endif /* CONFIG_IEEE80211W || CONFIG_IEEE80211R */
if (len < IEEE80211_HDRLEN + 1) { if (len < IEEE80211_HDRLEN + 1) {
hostapd_logger(hapd, mgmt->sa, HOSTAPD_MODULE_IEEE80211, hostapd_logger(hapd, mgmt->sa, HOSTAPD_MODULE_IEEE80211,
@ -1240,7 +1243,6 @@ static void handle_action(struct hostapd_data *hapd,
return; return;
} }
sta = ap_get_sta(hapd, mgmt->sa);
#ifdef CONFIG_IEEE80211W #ifdef CONFIG_IEEE80211W
if (sta && (sta->flags & WLAN_STA_MFP) && if (sta && (sta->flags & WLAN_STA_MFP) &&
!(mgmt->frame_control & host_to_le16(WLAN_FC_ISWEP) && !(mgmt->frame_control & host_to_le16(WLAN_FC_ISWEP) &&

View file

@ -2764,7 +2764,6 @@ static int wpa_driver_test_send_action(void *priv, unsigned int freq,
static void test_send_action_cb(void *eloop_ctx, void *timeout_ctx) static void test_send_action_cb(void *eloop_ctx, void *timeout_ctx)
{ {
struct wpa_driver_test_data *drv = eloop_ctx; struct wpa_driver_test_data *drv = eloop_ctx;
int res;
if (drv->pending_action_tx == NULL) if (drv->pending_action_tx == NULL)
return; return;
@ -2777,12 +2776,12 @@ static void test_send_action_cb(void *eloop_ctx, void *timeout_ctx)
} }
wpa_printf(MSG_DEBUG, "P2P: Sending pending Action frame to " wpa_printf(MSG_DEBUG, "P2P: Sending pending Action frame to "
MACSTR, MAC2STR(drv->pending_action_dst)); MACSTR, MAC2STR(drv->pending_action_dst));
res = wpa_driver_test_send_action(drv, drv->pending_action_freq, 0, wpa_driver_test_send_action(drv, drv->pending_action_freq, 0,
drv->pending_action_dst, drv->pending_action_dst,
drv->pending_action_src, drv->pending_action_src,
drv->pending_action_bssid, drv->pending_action_bssid,
wpabuf_head(drv->pending_action_tx), wpabuf_head(drv->pending_action_tx),
wpabuf_len(drv->pending_action_tx)); wpabuf_len(drv->pending_action_tx));
} }
#endif /* CONFIG_P2P */ #endif /* CONFIG_P2P */

View file

@ -778,19 +778,18 @@ static int p2p_run_after_scan(struct p2p_data *p2p)
enum p2p_after_scan op; enum p2p_after_scan op;
if (p2p->after_scan_tx) { if (p2p->after_scan_tx) {
int ret;
/* TODO: schedule p2p_run_after_scan to be called from TX /* TODO: schedule p2p_run_after_scan to be called from TX
* status callback(?) */ * status callback(?) */
wpa_msg(p2p->cfg->msg_ctx, MSG_DEBUG, "P2P: Send pending " wpa_msg(p2p->cfg->msg_ctx, MSG_DEBUG, "P2P: Send pending "
"Action frame at p2p_scan completion"); "Action frame at p2p_scan completion");
ret = p2p->cfg->send_action(p2p->cfg->cb_ctx, p2p->cfg->send_action(p2p->cfg->cb_ctx,
p2p->after_scan_tx->freq, p2p->after_scan_tx->freq,
p2p->after_scan_tx->dst, p2p->after_scan_tx->dst,
p2p->after_scan_tx->src, p2p->after_scan_tx->src,
p2p->after_scan_tx->bssid, p2p->after_scan_tx->bssid,
(u8 *) (p2p->after_scan_tx + 1), (u8 *) (p2p->after_scan_tx + 1),
p2p->after_scan_tx->len, p2p->after_scan_tx->len,
p2p->after_scan_tx->wait_time); p2p->after_scan_tx->wait_time);
os_free(p2p->after_scan_tx); os_free(p2p->after_scan_tx);
p2p->after_scan_tx = NULL; p2p->after_scan_tx = NULL;
return 1; return 1;

View file

@ -557,7 +557,9 @@ int wps_parse_msg(const struct wpabuf *msg, struct wps_parse_attr *attr)
{ {
const u8 *pos, *end; const u8 *pos, *end;
u16 type, len; u16 type, len;
#ifdef WPS_WORKAROUNDS
u16 prev_type = 0; u16 prev_type = 0;
#endif /* WPS_WORKAROUNDS */
os_memset(attr, 0, sizeof(*attr)); os_memset(attr, 0, sizeof(*attr));
pos = wpabuf_head(msg); pos = wpabuf_head(msg);
@ -622,7 +624,9 @@ int wps_parse_msg(const struct wpabuf *msg, struct wps_parse_attr *attr)
if (wps_set_attr(attr, type, pos, len) < 0) if (wps_set_attr(attr, type, pos, len) < 0)
return -1; return -1;
#ifdef WPS_WORKAROUNDS
prev_type = type; prev_type = type;
#endif /* WPS_WORKAROUNDS */
pos += len; pos += len;
} }