From patchwork Thu Jan 28 14:24:12 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bob Copeland X-Patchwork-Id: 8150931 X-Patchwork-Delegate: johannes@sipsolutions.net Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id A9083BEEE5 for ; Thu, 28 Jan 2016 14:24:40 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id EE8C32021A for ; Thu, 28 Jan 2016 14:24:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 93B3820219 for ; Thu, 28 Jan 2016 14:24:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755557AbcA1OYd (ORCPT ); Thu, 28 Jan 2016 09:24:33 -0500 Received: from mail-qg0-f46.google.com ([209.85.192.46]:33548 "EHLO mail-qg0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752523AbcA1OY3 (ORCPT ); Thu, 28 Jan 2016 09:24:29 -0500 Received: by mail-qg0-f46.google.com with SMTP id b35so39292565qge.0 for ; Thu, 28 Jan 2016 06:24:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bobcopeland-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=M6uefSMq8b9VuxoKINAAytRp4VDTXUk1TMi/TFKiYk0=; b=XgfC6s2aYAp6Lf78mwNz/fu/+X506uJ22zjzgkJQ6fDBU9AnPVfqSABfRHcFsTTYgO gy6ncZi6t2SgoUaqM8OEkHpA3JZokIELeZW9IVNlFpg5vAszb3mo26iDRYKyyF1kdTTF MTWRy3RL7X/NwCGkUdU+YtTar20u82E8pvWdZ5TkVWelV0ftgmwe7MHtqbZNzDAwf1zj V45cUkYJ+KGgtrn38qGKP7AznNajFRiyl76RkmP1RWCM/6O5F4Y3ExeMduQsWVvtCiSX U1g3oO2vhDfOU63MR0XMj/h6JAKGkyk/74Gl6VwyTQIFUIszubhWc5Gs+nGi+xPeZJKL y3Bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=M6uefSMq8b9VuxoKINAAytRp4VDTXUk1TMi/TFKiYk0=; b=hEQURxdRusTY3OzzMpaMG5Qy0SYS3SMBACNrdk+brdguVY1d+ZJFyL2QjbT2xUxE1x BmhLL29Wr3LiJhlm6/GjD3BLbKhKVG0v6sf5wHBuwIUIK0WD8dQkvcRkIR4G5b01Hs7M acqJssKh2AV7V4lzJsXyx2KD79R9tGAejjcWQKePts4Qhnl4iwlpWUrQkVxtSO3MNFSU 5qGj6hgtsYnzPO3ezK3g1DjwrcP+hwESV9iOzp75/T5dZ87+x5HK04laZ9OOuJiLUagC 4L0wrLcK6eJBliqQpa2u2oiKC7ekVLkguFMUVZqtmktgn2T11mE2pyxrQLzqm9NX2fsQ ZlYQ== X-Gm-Message-State: AG10YOQ5GGr2Ms+1uI8XHg2ZwmXJZvh5J1RKtDTsvjPRxX4YDfykv43oXNeHBu1Ne7N3lg== X-Received: by 10.140.28.69 with SMTP id 63mr3864533qgy.66.1453991068593; Thu, 28 Jan 2016 06:24:28 -0800 (PST) Received: from hash ([2001:470:1d:6db:230:48ff:fe9d:9c89]) by smtp.gmail.com with ESMTPSA id b95sm4872681qge.47.2016.01.28.06.24.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 28 Jan 2016 06:24:28 -0800 (PST) Received: from bob by hash with local (Exim 4.84) (envelope-from ) id 1aOnUi-00036Z-1R; Thu, 28 Jan 2016 09:24:20 -0500 From: Bob Copeland To: Johannes Berg Cc: linux-wireless@vger.kernel.org, Bob Copeland Subject: [PATCH] mac80211: mesh: drop write-only var mean_chain_len Date: Thu, 28 Jan 2016 09:24:12 -0500 Message-Id: <1453991052-11899-1-git-send-email-me@bobcopeland.com> X-Mailer: git-send-email 2.1.4 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, 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 mean_chain_len is copied into mesh path table structures, but only ever has the value 2 and is never read, so just remove it. Signed-off-by: Bob Copeland --- Sending this by itself as it's pretty trivial and doesn't conflict with other outstanding patches. net/mac80211/mesh.h | 3 --- net/mac80211/mesh_pathtbl.c | 9 +++------ 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/net/mac80211/mesh.h b/net/mac80211/mesh.h index 4a8019f..87c017a 100644 --- a/net/mac80211/mesh.h +++ b/net/mac80211/mesh.h @@ -137,8 +137,6 @@ struct mesh_path { * @copy_node: function to copy nodes of the table * @size_order: determines size of the table, there will be 2^size_order hash * buckets - * @mean_chain_len: maximum average length for the hash buckets' list, if it is - * reached, the table will grow * @known_gates: list of known mesh gates and their mpaths by the station. The * gate's mpath may or may not be resolved and active. * @@ -154,7 +152,6 @@ struct mesh_table { void (*free_node) (struct hlist_node *p, bool free_leafs); int (*copy_node) (struct hlist_node *p, struct mesh_table *newtbl); int size_order; - int mean_chain_len; struct hlist_head *known_gates; spinlock_t gates_lock; diff --git a/net/mac80211/mesh_pathtbl.c b/net/mac80211/mesh_pathtbl.c index dadf8dc..c95bdb8 100644 --- a/net/mac80211/mesh_pathtbl.c +++ b/net/mac80211/mesh_pathtbl.c @@ -160,11 +160,10 @@ static int mesh_table_grow(struct mesh_table *oldtbl, int i; if (atomic_read(&oldtbl->entries) - < oldtbl->mean_chain_len * (oldtbl->hash_mask + 1)) + < MEAN_CHAIN_LEN * (oldtbl->hash_mask + 1)) return -EAGAIN; newtbl->free_node = oldtbl->free_node; - newtbl->mean_chain_len = oldtbl->mean_chain_len; newtbl->copy_node = oldtbl->copy_node; newtbl->known_gates = oldtbl->known_gates; atomic_set(&newtbl->entries, atomic_read(&oldtbl->entries)); @@ -585,7 +584,7 @@ struct mesh_path *mesh_path_add(struct ieee80211_sub_if_data *sdata, hlist_add_head_rcu(&new_node->list, bucket); if (atomic_inc_return(&tbl->entries) >= - tbl->mean_chain_len * (tbl->hash_mask + 1)) + MEAN_CHAIN_LEN * (tbl->hash_mask + 1)) grow = 1; mesh_paths_generation++; @@ -714,7 +713,7 @@ int mpp_path_add(struct ieee80211_sub_if_data *sdata, hlist_add_head_rcu(&new_node->list, bucket); if (atomic_inc_return(&tbl->entries) >= - tbl->mean_chain_len * (tbl->hash_mask + 1)) + MEAN_CHAIN_LEN * (tbl->hash_mask + 1)) grow = 1; spin_unlock(&tbl->hashwlock[hash_idx]); @@ -1076,7 +1075,6 @@ int mesh_pathtbl_init(void) return -ENOMEM; tbl_path->free_node = &mesh_path_node_free; tbl_path->copy_node = &mesh_path_node_copy; - tbl_path->mean_chain_len = MEAN_CHAIN_LEN; tbl_path->known_gates = kzalloc(sizeof(struct hlist_head), GFP_ATOMIC); if (!tbl_path->known_gates) { ret = -ENOMEM; @@ -1092,7 +1090,6 @@ int mesh_pathtbl_init(void) } tbl_mpp->free_node = &mesh_path_node_free; tbl_mpp->copy_node = &mesh_path_node_copy; - tbl_mpp->mean_chain_len = MEAN_CHAIN_LEN; tbl_mpp->known_gates = kzalloc(sizeof(struct hlist_head), GFP_ATOMIC); if (!tbl_mpp->known_gates) { ret = -ENOMEM;