From patchwork Fri Apr 13 08:38:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Masashi Honma X-Patchwork-Id: 897885 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:e::133; helo=bombadil.infradead.org; envelope-from=hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="J9ie8qnd"; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="f8AaDQ+h"; dkim-atps=neutral Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:e::133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40MrmQ4SBWz9s27 for ; Fri, 13 Apr 2018 18:39:18 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=J7CeCGrE2BXnOTOTsnEx4XIjYsGVAHEFeJMnI4F+n8k=; b=J9ie8qndkfgq6L 13Y09ZS3IBPKBQZSONB3AN5f1qoHHrECnaGJnJow3T1QA10IKrHMzsUYsBuzWFgyFfrc8ryIBs4Ze 7hdY1Hj30hUBU5ZeZYfAD9yqxGdpMM/ppEaf5+PBFSTU1NPrpExS15mFfRM7BKVS2lYBYXtA+TLj+ dpAziHVKvv2NNpo26dX7JiLUCqm7Utvh7TG+L0xdsxFg7ZTYVuKlP7m3vfiy6sHCu8Cx1blX1chcN 76gNvRdsTk7j0Mdm7HADMLQTcLSJOqrZXDPcyl3c0FygfaLRWyg1bpIIeXxXx2JeZqJMEQHJBqqjF +q0TznSe60IWkz5cukWw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1f6uEj-0006iZ-73; Fri, 13 Apr 2018 08:39:13 +0000 Received: from mail-pl0-x244.google.com ([2607:f8b0:400e:c01::244]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1f6uEW-0006Yo-62 for hostap@lists.infradead.org; Fri, 13 Apr 2018 08:39:03 +0000 Received: by mail-pl0-x244.google.com with SMTP id a39-v6so5700861pla.10 for ; Fri, 13 Apr 2018 01:38:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=AB3Zmb6CSuxN3zFiq1c+z0GZ5NwNV0vDCSzBXI6P+D4=; b=f8AaDQ+haylU4tpnestty+Mc5oXiTyGYGortCMjiu++Bab53upllopLxBYrPHOINRg kIHfljGKaiI356Fdk4mijbxjt1ciqGLICFCgVPU8oEHHV1/3tJGvK4ucoO4Gqhr5fvv7 zBc8UIT8XUeb+ZAqGtCMrphCJ5ameAC1StZLRMlFYgQCWdvQM2Lv+w/7n4hjaX4vm/BR jc7TcU4cinWrsR1uZ/UnVeTl6NI0I9e14GK3rK+PwVxdrkDpoVFGvDij9NY5wzI+iHIB mWTcEes1wOVW/2j3fO6/TUKgHiCaY5g01gkzcL5C0bqlcTShPkenoei9Nphvu+tO89YL LNKA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=AB3Zmb6CSuxN3zFiq1c+z0GZ5NwNV0vDCSzBXI6P+D4=; b=gWmuHgbtJTeqW7Qlbk1PVY/mUy2OxFNOZeuZxFrneBVqnf3gZOFzojs2JrBM2SVyLG cWhyzniiSERVcQ23b1/c9zLKhbExKL4IbgV5HmSlUZgH4O3dso1slUj6m2TCZwDfe5J5 9vvLWQbZB02o69qvI809QcwQ+290RkAqHMw8nydFkNKcDigNp95IN+zCekjQCQhyXtEh 7RsTlJDv3t61/XvTSyviLW+EXDn0pt6ib8GwrUTmvP+PX82TVsA3M5E6IQqtph5G0FFa ttFFRafJagkbVGj6mIkymhx3qIuw1wq7Km8lQ7XUAkts3EscMDrVj7sX5a1YQgJ+qKbV dOzA== X-Gm-Message-State: ALQs6tCKVl46T1QRyhNqlSMsdbo4fy7XT+AraoOxWOiy5V82YoRrtZs/ txXXK8+DVVvHHCTgvpSyRtfzGw== X-Google-Smtp-Source: AIpwx4+4OEedQLgn/+4Lx5+4sRxx7pHtDjvJQDMf30lBTFsRoQ2mO8Jp/pc2FAmgeqN07dQAYCKifQ== X-Received: by 2002:a17:902:be15:: with SMTP id r21-v6mr4272808pls.237.1523608728928; Fri, 13 Apr 2018 01:38:48 -0700 (PDT) Received: from iiyama.flets-east.jp ([2409:11:321:2100:89cb:a57b:2e52:d73]) by smtp.gmail.com with ESMTPSA id v63sm14353199pfk.8.2018.04.13.01.38.46 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 13 Apr 2018 01:38:48 -0700 (PDT) From: Masashi Honma To: hostap@lists.infradead.org Subject: [PATCH 1/3] mesh: Fix some compiler warnings Date: Fri, 13 Apr 2018 17:38:34 +0900 Message-Id: <1523608716-5947-1-git-send-email-masashi.honma@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: References: MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180413_013900_280463_F93A7640 X-CRM114-Status: GOOD ( 12.91 ) X-Spam-Score: -0.1 (/) X-Spam-Report: SpamAssassin version 3.4.1 on bombadil.infradead.org summary: Content analysis details: (-0.1 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [2607:f8b0:400e:c01:0:0:0:244 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (masashi.honma[at]gmail.com) -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain X-BeenThere: hostap@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: j@w1.fi, Masashi Honma , peter.oh@bowerswilkins.com Sender: "Hostap" Errors-To: hostap-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org mesh.c: In function ‘wpa_supplicant_mesh_init’: mesh.c:203:9: warning: unused variable ‘len’ [-Wunused-variable] size_t len; ^ mesh.c:202:13: warning: unused variable ‘default_groups’ [-Wunused-variable] static int default_groups[] = { 19, 20, 21, 25, 26, -1 }; ^ ap.c: In function ‘wpas_ap_ch_switch’: ap.c:1333:5: warning: suggest explicit braces to avoid ambiguous ‘else’ [-Wparentheses] if (!wpa_s->ap_iface) ^ ap.c: In function ‘wpas_event_dfs_radar_detected’: ap.c:1541:5: warning: suggest explicit braces to avoid ambiguous ‘else’ [-Wparentheses] if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0]) ^ ap.c: In function ‘wpas_event_dfs_cac_started’: ap.c:1559:5: warning: suggest explicit braces to avoid ambiguous ‘else’ [-Wparentheses] if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0]) ^ ap.c: In function ‘wpas_event_dfs_cac_finished’: ap.c:1576:5: warning: suggest explicit braces to avoid ambiguous ‘else’ [-Wparentheses] if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0]) ^ ap.c: In function ‘wpas_event_dfs_cac_aborted’: ap.c:1594:5: warning: suggest explicit braces to avoid ambiguous ‘else’ [-Wparentheses] if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0]) ^ ap.c: In function ‘wpas_event_dfs_cac_nop_finished’: ap.c:1611:5: warning: suggest explicit braces to avoid ambiguous ‘else’ [-Wparentheses] if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0]) ^ Signed-off-by: Masashi Honma --- wpa_supplicant/ap.c | 19 ++++++++++++------- wpa_supplicant/mesh.c | 2 -- 2 files changed, 12 insertions(+), 9 deletions(-) diff --git a/wpa_supplicant/ap.c b/wpa_supplicant/ap.c index 17b32fb..114848a 100644 --- a/wpa_supplicant/ap.c +++ b/wpa_supplicant/ap.c @@ -1330,11 +1330,12 @@ void wpas_ap_ch_switch(struct wpa_supplicant *wpa_s, int freq, int ht, { struct hostapd_iface *iface = wpa_s->ap_iface; - if (!wpa_s->ap_iface) + if (!wpa_s->ap_iface) { if (!wpa_s->ifmsh) return; else iface = wpa_s->ifmsh; + } wpa_s->assoc_freq = freq; if (wpa_s->current_ssid) @@ -1538,11 +1539,12 @@ void wpas_event_dfs_radar_detected(struct wpa_supplicant *wpa_s, { struct hostapd_iface *iface = wpa_s->ap_iface; - if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0]) + if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0]) { if (!wpa_s->ifmsh || !wpa_s->ifmsh->bss[0]) return; else iface = wpa_s->ifmsh; + } wpa_printf(MSG_DEBUG, "DFS radar detected on %d MHz", radar->freq); hostapd_dfs_radar_detected(iface, radar->freq, radar->ht_enabled, radar->chan_offset, @@ -1556,11 +1558,12 @@ void wpas_event_dfs_cac_started(struct wpa_supplicant *wpa_s, { struct hostapd_iface *iface = wpa_s->ap_iface; - if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0]) + if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0]) { if (!wpa_s->ifmsh || !wpa_s->ifmsh->bss[0]) return; else iface = wpa_s->ifmsh; + } wpa_printf(MSG_DEBUG, "DFS CAC started on %d MHz", radar->freq); hostapd_dfs_start_cac(iface, radar->freq, radar->ht_enabled, radar->chan_offset, @@ -1573,12 +1576,12 @@ void wpas_event_dfs_cac_finished(struct wpa_supplicant *wpa_s, { struct hostapd_iface *iface = wpa_s->ap_iface; - if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0]) + if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0]) { if (!wpa_s->ifmsh || !wpa_s->ifmsh->bss[0]) return; else iface = wpa_s->ifmsh; - + } wpa_printf(MSG_DEBUG, "DFS CAC finished on %d MHz", radar->freq); hostapd_dfs_complete_cac(iface, 1, radar->freq, radar->ht_enabled, radar->chan_offset, @@ -1591,11 +1594,12 @@ void wpas_event_dfs_cac_aborted(struct wpa_supplicant *wpa_s, { struct hostapd_iface *iface = wpa_s->ap_iface; - if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0]) + if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0]) { if (!wpa_s->ifmsh || !wpa_s->ifmsh->bss[0]) return; else iface = wpa_s->ifmsh; + } wpa_printf(MSG_DEBUG, "DFS CAC aborted on %d MHz", radar->freq); hostapd_dfs_complete_cac(iface, 0, radar->freq, radar->ht_enabled, radar->chan_offset, @@ -1608,11 +1612,12 @@ void wpas_event_dfs_cac_nop_finished(struct wpa_supplicant *wpa_s, { struct hostapd_iface *iface = wpa_s->ap_iface; - if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0]) + if (!wpa_s->ap_iface || !wpa_s->ap_iface->bss[0]) { if (!wpa_s->ifmsh || !wpa_s->ifmsh->bss[0]) return; else iface = wpa_s->ifmsh; + } wpa_printf(MSG_DEBUG, "DFS NOP finished on %d MHz", radar->freq); hostapd_dfs_nop_finished(iface, radar->freq, radar->ht_enabled, radar->chan_offset, diff --git a/wpa_supplicant/mesh.c b/wpa_supplicant/mesh.c index 22dec48..9450bc4 100644 --- a/wpa_supplicant/mesh.c +++ b/wpa_supplicant/mesh.c @@ -199,8 +199,6 @@ static int wpa_supplicant_mesh_init(struct wpa_supplicant *wpa_s, struct hostapd_config *conf; struct mesh_conf *mconf; int basic_rates_erp[] = { 10, 20, 55, 60, 110, 120, 240, -1 }; - static int default_groups[] = { 19, 20, 21, 25, 26, -1 }; - size_t len; int rate_len; int frequency;