]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P: Suppress warning on non-P2P config
authorMasashi Honma <masashi.honma@gmail.com>
Thu, 16 Mar 2017 01:59:40 +0000 (10:59 +0900)
committerJouni Malinen <j@w1.fi>
Mon, 27 Mar 2017 14:21:02 +0000 (17:21 +0300)
Without CONFIG_P2P config, the following warning occurs if CONFIG_AP is
enabled for the build:

ap.c: In function ‘wpas_conf_ap_vht’:
ap.c:54:5: warning: unused variable ‘channel’ [-Wunused-variable]
  u8 channel = conf->channel;
     ^
ap.c:53:5: warning: unused variable ‘center_chan’ [-Wunused-variable]
  u8 center_chan = 0;
     ^

Signed-off-by: Masashi Honma <masashi.honma@gmail.com>
wpa_supplicant/ap.c

index 2866c043aaba351858e1a23f7af01f9190d8aa90..3fc8e94145edfa91af1884e9800cd3331c9ab000 100644 (file)
@@ -50,8 +50,10 @@ static void wpas_conf_ap_vht(struct wpa_supplicant *wpa_s,
                             struct hostapd_config *conf,
                             struct hostapd_hw_modes *mode)
 {
+#ifdef CONFIG_P2P
        u8 center_chan = 0;
        u8 channel = conf->channel;
+#endif /* CONFIG_P2P */
 
        if (!conf->secondary_channel)
                goto no_vht;