mac80211: remove local pointer from rate_ctrl_ref
authorJohannes Berg <johannes.berg@intel.com>
Wed, 15 Feb 2017 14:02:07 +0000 (15:02 +0100)
committerJohannes Berg <johannes.berg@intel.com>
Mon, 6 Mar 2017 08:21:43 +0000 (09:21 +0100)
This pointer really isn't needed, so remove it.

Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/rate.c
net/mac80211/rate.h

index 206698bc93f406939bb5d883b6ab2f04bc1a3bed..094c15645228e0777b8d71821591ddeff616b927 100644 (file)
@@ -208,7 +208,6 @@ static struct rate_control_ref *rate_control_alloc(const char *name,
        ref = kmalloc(sizeof(struct rate_control_ref), GFP_KERNEL);
        if (!ref)
                return NULL;
-       ref->local = local;
        ref->ops = ieee80211_rate_control_ops_get(name);
        if (!ref->ops)
                goto free;
@@ -229,13 +228,14 @@ free:
        return NULL;
 }
 
-static void rate_control_free(struct rate_control_ref *ctrl_ref)
+static void rate_control_free(struct ieee80211_local *local,
+                             struct rate_control_ref *ctrl_ref)
 {
        ctrl_ref->ops->free(ctrl_ref->priv);
 
 #ifdef CONFIG_MAC80211_DEBUGFS
-       debugfs_remove_recursive(ctrl_ref->local->debugfs.rcdir);
-       ctrl_ref->local->debugfs.rcdir = NULL;
+       debugfs_remove_recursive(local->debugfs.rcdir);
+       local->debugfs.rcdir = NULL;
 #endif
 
        kfree(ctrl_ref);
@@ -936,6 +936,6 @@ void rate_control_deinitialize(struct ieee80211_local *local)
                return;
 
        local->rate_ctrl = NULL;
-       rate_control_free(ref);
+       rate_control_free(local, ref);
 }
 
index 8d3260785b940d3ea87679f86b98015ce1b4fbbd..d51a1cce4d4a84b0009398895a2557e7dba882d2 100644 (file)
@@ -20,7 +20,6 @@
 #include "driver-ops.h"
 
 struct rate_control_ref {
-       struct ieee80211_local *local;
        const struct rate_control_ops *ops;
        void *priv;
 };