[PATCH 1/8] batman-adv: remove redundant gw_node_list_free() function
@@ -315,32 +315,20 @@ void
gw_node_purge_deleted(struct bat_priv *bat_priv)
spin_lock_bh(&bat_priv->gw_list_lock);
hlist_for_each_entry_safe(gw_node, node, node_tmp,
- &bat_priv->gw_list, list) {
- if ((gw_node->deleted) &&
- (time_after(jiffies, gw_node->deleted + timeout))) {
-
- hlist_del_rcu(&gw_node->list);
- call_rcu(&gw_node->rcu, gw_node_free_rcu);
- }
- }
-
- spin_unlock_bh(&bat_priv->gw_list_lock);
-}
-
-void gw_node_list_free(struct bat_priv *bat_priv)
-{
- struct gw_node *gw_node;
- struct hlist_node *node, *node_tmp;
+ &bat_priv->gw_list, list) {
+ if (((!gw_node->deleted) ||
+ (time_after(jiffies, gw_node->deleted + timeout))) &&
+ atomic_read(&bat_priv->mesh_state) == MESH_ACTIVE)
+ continue;
This should be time_before.
[PATCH 4/8] batman-adv: move gateway bandwidth into its own sysfs file
@@ -293,12 +293,38 @@ static ssize_t
show_gw_mode(struct kobject *kobj,
struct attribute *attr, }
static ssize_t store_gw_mode(struct kobject *kobj, struct attribute *attr,
- char *buff, size_t count)
+ char *buff, size_t count)
Why was the space removed?
+ if ((strnicmp(tmp_ptr,
"kbit", 4) == 0) ||
+ (multi > 1))
Why this indentation? And This should be on a single line (or I count wrong).
[PATCH 5/8] batman-adv: cleanup gw mode sysfs file to only accept one value
+ if ((gw_mode_tmp == GW_MODE_CLIENT)
&&
+ (atomic_read(&bat_priv->gw_sel_class) == 0))
+ atomic_set(&bat_priv->gw_sel_class, 20);
+
+ if ((gw_mode_tmp == GW_MODE_SERVER) &&
+ (atomic_read(&bat_priv->gw_bandwidth) == 0))
+ atomic_set(&bat_priv->gw_bandwidth, 41);
Why setting that here? And why do you set gw_sel_class here to 20 (if it is 0
before) and in softif_create to 0? Shouldn't it be set to 20 in softif_create
instead?
I don't see a big problem at the moment.
Best regards,
Sven