From patchwork Mon Apr 21 04:53:05 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gang ZHAO X-Patchwork-Id: 4022381 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 DB6569F44A for ; Mon, 21 Apr 2014 04:55:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 097032021B for ; Mon, 21 Apr 2014 04:55:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 3A04320218 for ; Mon, 21 Apr 2014 04:55:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751689AbaDUEzX (ORCPT ); Mon, 21 Apr 2014 00:55:23 -0400 Received: from mail-pa0-f43.google.com ([209.85.220.43]:60860 "EHLO mail-pa0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751652AbaDUEzW (ORCPT ); Mon, 21 Apr 2014 00:55:22 -0400 Received: by mail-pa0-f43.google.com with SMTP id bj1so3348359pad.2 for ; Sun, 20 Apr 2014 21:55:22 -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:in-reply-to:references :in-reply-to:references; bh=tDw9Oqd6LpD1FakV2YEh5M9E0tLMrhmilfsEBsocdgc=; b=nYZteZXaJWlRyFAicRPQYSwaidiJPFQ8zzgXTDAW4UkHB9JmCDONsxPfuVnckxMRL1 +Qz6r1vhoJkgZR9DuCmUUUmbWh00jxlAxfjkEBMGTuiiygo8qspE1oUfMT6DZGub57W1 GA3bKvrKPGOtrNiKUxQRehnW+vBBA8ZZbZSwZFU0/f8PsWq7kn9BvfrAn20k8PNJuNXq xx5uj0bd2In6oYKoornGHWi/3H3iKovcyKmW0EcwkBDyMo/bgxEs+BwKllR1bvAvjTvL ePzXa38NMIYJVrQyRUHhJLtzhxNDW1yhfGRRNLWRR0BRyAD/w9v8NQJC44TxXiNkaVAU UF/A== X-Received: by 10.66.142.132 with SMTP id rw4mr36190753pab.6.1398056122039; Sun, 20 Apr 2014 21:55:22 -0700 (PDT) Received: from localhost.localdomain ([61.157.126.13]) by mx.google.com with ESMTPSA id gj9sm75124104pbc.7.2014.04.20.21.55.19 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 20 Apr 2014 21:55:21 -0700 (PDT) From: "Zhao, Gang" To: Cc: Johannes Berg Subject: [PATCH 10/12] mac80211: change return value of notifier function Date: Mon, 21 Apr 2014 12:53:05 +0800 Message-Id: <7336424bc39404833509efc7fc9bf0ba0af450f1.1398055854.git.gamerh2o@gmail.com> X-Mailer: git-send-email 1.9.0 In-Reply-To: References: In-Reply-To: References: 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.4 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 Return NOTIFY_DONE if we don't care this time's notification, return NOTIFY_OK if we successfully handled this time's notification. That's the formal way to do it. Signed-off-by: Zhao, Gang --- net/mac80211/iface.c | 11 +++++------ net/mac80211/main.c | 4 ++-- net/mac80211/mlme.c | 2 +- 3 files changed, 8 insertions(+), 9 deletions(-) diff --git a/net/mac80211/iface.c b/net/mac80211/iface.c index 90b6063..4da6c71 100644 --- a/net/mac80211/iface.c +++ b/net/mac80211/iface.c @@ -1785,20 +1785,19 @@ static int netdev_notify(struct notifier_block *nb, struct ieee80211_sub_if_data *sdata; if (state != NETDEV_CHANGENAME) - return 0; + return NOTIFY_DONE; if (!dev->ieee80211_ptr || !dev->ieee80211_ptr->wiphy) - return 0; + return NOTIFY_DONE; if (dev->ieee80211_ptr->wiphy->privid != mac80211_wiphy_privid) - return 0; + return NOTIFY_DONE; sdata = IEEE80211_DEV_TO_SUB_IF(dev); - memcpy(sdata->name, dev->name, IFNAMSIZ); - ieee80211_debugfs_rename_netdev(sdata); - return 0; + + return NOTIFY_OK; } static struct notifier_block mac80211_netdev_notifier = { diff --git a/net/mac80211/main.c b/net/mac80211/main.c index b83a913..4762711 100644 --- a/net/mac80211/main.c +++ b/net/mac80211/main.c @@ -338,7 +338,7 @@ static int ieee80211_ifa_changed(struct notifier_block *nb, sdata_unlock(sdata); - return NOTIFY_DONE; + return NOTIFY_OK; } #endif @@ -369,7 +369,7 @@ static int ieee80211_ifa6_changed(struct notifier_block *nb, drv_ipv6_addr_change(local, sdata, idev); - return NOTIFY_DONE; + return NOTIFY_OK; } #endif diff --git a/net/mac80211/mlme.c b/net/mac80211/mlme.c index 1e1bdd2..66047cd 100644 --- a/net/mac80211/mlme.c +++ b/net/mac80211/mlme.c @@ -3701,7 +3701,7 @@ int ieee80211_max_network_latency(struct notifier_block *nb, ieee80211_recalc_ps(local, latency_usec); mutex_unlock(&local->iflist_mtx); - return 0; + return NOTIFY_OK; } static u8 ieee80211_ht_vht_rx_chains(struct ieee80211_sub_if_data *sdata,