From patchwork Wed Apr 9 01:28:06 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Gang ZHAO X-Patchwork-Id: 3952011 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0D4269F38C for ; Wed, 9 Apr 2014 01:28:55 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E2D1220497 for ; Wed, 9 Apr 2014 01:28:53 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F29B820495 for ; Wed, 9 Apr 2014 01:28:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757590AbaDIB2t (ORCPT ); Tue, 8 Apr 2014 21:28:49 -0400 Received: from mail-pa0-f51.google.com ([209.85.220.51]:48204 "EHLO mail-pa0-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756235AbaDIB2s (ORCPT ); Tue, 8 Apr 2014 21:28:48 -0400 Received: by mail-pa0-f51.google.com with SMTP id kq14so1810030pab.38 for ; Tue, 08 Apr 2014 18:28:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:mime-version:content-type :content-transfer-encoding; bh=qT9ipnY2sxKcTNLZuPH0UmvymQg7+iCeyF5FohuS2cg=; b=oxlBQfioML+pZmsQgRn7X+iZZM5uVjiaK9ypom8n1qbIz7D7MOnhE9bETizOrAIvV1 n/L8XyU5e7eUtF6/vHtR2MWyHdexXqTJWFgRGCo0QOaP3aN7ISchgxtEMqUJACYouUOD gIXMezeObB/m6qiNb8RdThe3j2SnpbfBiK1epAeNyWxKfs2/QKk8QbZP/CVUvsEG9Pxw S5OrXnq9W/4iYODvTkNolUrpIk1faH2y+beM7f5nHKcwBoF+yS0ikgV6RZD9tcmhcWUY NgE3uS5rAjlmgWFEQrD8dkjeJMSZiKA0yKMAIFo8KVp3B/BAIiv8MctdRVP9VCHuHxL5 6uvw== X-Received: by 10.66.142.233 with SMTP id rz9mr8397602pab.71.1397006928438; Tue, 08 Apr 2014 18:28:48 -0700 (PDT) Received: from localhost.localdomain ([61.157.126.15]) by mx.google.com with ESMTPSA id tu3sm17711799pab.1.2014.04.08.18.28.45 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 08 Apr 2014 18:28:47 -0700 (PDT) From: "Zhao, Gang" To: Cc: Johannes Berg Subject: [PATCH 1/8] cfg80211: fix possible compile warning in wext-compat.h Date: Wed, 9 Apr 2014 09:28:06 +0800 Message-Id: X-Mailer: git-send-email 1.9.0 MIME-Version: 1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Function cfg80211_wext_freq() is declared in wext-compat.h, but its parameter struct wiphy's declaration is not included there. Actually the parameter is not used in this function, so change it to normal net_device. The compile warning doesn't show up due to duplicate including, but it's worth fixing it. net/wireless/wext-compat.h:53:52: warning: ‘struct wiphy’ declared inside parameter list [enabled by default] int cfg80211_wext_freq(struct wiphy *wiphy, struct iw_freq *freq); ^ net/wireless/wext-compat.h:53:52: warning: its scope is only this definition or declaration, which is probably not what you want [enabled by default] Signed-off-by: Zhao, Gang --- net/wireless/ibss.c | 2 +- net/wireless/scan.c | 6 +++++- net/wireless/wext-compat.c | 8 ++++---- net/wireless/wext-compat.h | 2 +- net/wireless/wext-sme.c | 2 +- 5 files changed, 12 insertions(+), 8 deletions(-) diff --git a/net/wireless/ibss.c b/net/wireless/ibss.c index 071e99c..407f413 100644 --- a/net/wireless/ibss.c +++ b/net/wireless/ibss.c @@ -322,7 +322,7 @@ int cfg80211_ibss_wext_siwfreq(struct net_device *dev, if (!rdev->ops->join_ibss) return -EOPNOTSUPP; - freq = cfg80211_wext_freq(wdev->wiphy, wextfreq); + freq = cfg80211_wext_freq(dev, wextfreq); if (freq < 0) return freq; diff --git a/net/wireless/scan.c b/net/wireless/scan.c index 7d09a71..d526d65 100644 --- a/net/wireless/scan.c +++ b/net/wireless/scan.c @@ -1147,7 +1147,11 @@ int cfg80211_wext_siwscan(struct net_device *dev, int k; int wiphy_freq = wiphy->bands[band]->channels[j].center_freq; for (k = 0; k < wreq->num_channels; k++) { - int wext_freq = cfg80211_wext_freq(wiphy, &wreq->channel_list[k]); + struct iw_freq *freq = + &wreq->channel_list[k]; + + int wext_freq = + cfg80211_wext_freq(dev, freq); if (wext_freq == wiphy_freq) goto wext_freq_found; } diff --git a/net/wireless/wext-compat.c b/net/wireless/wext-compat.c index 5661a54..9984d2f 100644 --- a/net/wireless/wext-compat.c +++ b/net/wireless/wext-compat.c @@ -253,12 +253,12 @@ EXPORT_SYMBOL_GPL(cfg80211_wext_giwrange); /** * cfg80211_wext_freq - get wext frequency for non-"auto" - * @wiphy: the wiphy + * @dev: the net device * @freq: the wext freq encoding * * Returns a frequency, or a negative error code, or 0 for auto. */ -int cfg80211_wext_freq(struct wiphy *wiphy, struct iw_freq *freq) +int cfg80211_wext_freq(struct net_device *dev, struct iw_freq *freq) { /* * Parse frequency - return 0 for auto and @@ -787,7 +787,7 @@ static int cfg80211_wext_siwfreq(struct net_device *dev, case NL80211_IFTYPE_ADHOC: return cfg80211_ibss_wext_siwfreq(dev, info, wextfreq, extra); case NL80211_IFTYPE_MONITOR: - freq = cfg80211_wext_freq(wdev->wiphy, wextfreq); + freq = cfg80211_wext_freq(dev, wextfreq); if (freq < 0) return freq; if (freq == 0) @@ -798,7 +798,7 @@ static int cfg80211_wext_siwfreq(struct net_device *dev, return -EINVAL; return cfg80211_set_monitor_channel(rdev, &chandef); case NL80211_IFTYPE_MESH_POINT: - freq = cfg80211_wext_freq(wdev->wiphy, wextfreq); + freq = cfg80211_wext_freq(dev, wextfreq); if (freq < 0) return freq; if (freq == 0) diff --git a/net/wireless/wext-compat.h b/net/wireless/wext-compat.h index 5d766b0..bd6aa81 100644 --- a/net/wireless/wext-compat.h +++ b/net/wireless/wext-compat.h @@ -50,7 +50,7 @@ int cfg80211_wext_siwgenie(struct net_device *dev, struct iw_point *data, char *extra); -int cfg80211_wext_freq(struct wiphy *wiphy, struct iw_freq *freq); +int cfg80211_wext_freq(struct net_device *dev, struct iw_freq *freq); extern const struct iw_handler_def cfg80211_wext_handler; diff --git a/net/wireless/wext-sme.c b/net/wireless/wext-sme.c index 86c331a..765e37b 100644 --- a/net/wireless/wext-sme.c +++ b/net/wireless/wext-sme.c @@ -75,7 +75,7 @@ int cfg80211_mgd_wext_siwfreq(struct net_device *dev, if (WARN_ON(wdev->iftype != NL80211_IFTYPE_STATION)) return -EINVAL; - freq = cfg80211_wext_freq(wdev->wiphy, wextfreq); + freq = cfg80211_wext_freq(dev, wextfreq); if (freq < 0) return freq;