[1/2] P2P: Suppress warning on non-P2P config

Message ID 1489629581-7900-1-git-send-email-masashi.honma@gmail.com
State Accepted
Headers show

Commit Message

Masashi Honma March 16, 2017, 1:59 a.m.
Without CONFIG_P2P config, trailing warning occurs.

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 | 2 ++
 1 file changed, 2 insertions(+)

Comments

Jouni Malinen March 27, 2017, 10:04 p.m. | #1
On Thu, Mar 16, 2017 at 10:59:40AM +0900, Masashi Honma wrote:
> Without CONFIG_P2P config, trailing warning occurs.
> 
> 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;
>      ^

Thanks, applied.

Patch

diff --git a/wpa_supplicant/ap.c b/wpa_supplicant/ap.c
index 2866c04..3fc8e94 100644
--- a/wpa_supplicant/ap.c
+++ b/wpa_supplicant/ap.c
@@ -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;