Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e5d89254 authored by Sven Eckelmann's avatar Sven Eckelmann Committed by Antonio Quartulli
Browse files

batman-adv: Prefix hard-interface static inline functions with batadv_



All non-static symbols of batman-adv were prefixed with batadv_ to avoid
collisions with other symbols of the kernel. Other symbols of batman-adv
should use the same prefix to keep the naming scheme consistent.

Signed-off-by: default avatarSven Eckelmann <sven@narfation.org>
parent 9b4a1159
Loading
Loading
Loading
Loading
+7 −7
Original line number Diff line number Diff line
@@ -232,7 +232,7 @@ static void bat_iv_ogm_emit(struct forw_packet *forw_packet)
	if (forw_packet->if_incoming->if_status != IF_ACTIVE)
		goto out;

	primary_if = primary_if_get_selected(bat_priv);
	primary_if = batadv_primary_if_get_selected(bat_priv);
	if (!primary_if)
		goto out;

@@ -273,7 +273,7 @@ static void bat_iv_ogm_emit(struct forw_packet *forw_packet)

out:
	if (primary_if)
		hardif_free_ref(primary_if);
		batadv_hardif_free_ref(primary_if);
}

/* return true if new_packet can be aggregated with forw_packet */
@@ -311,7 +311,7 @@ static bool bat_iv_ogm_can_aggregate(const struct batman_ogm_packet
		 *    a "global" packet as well as the base
		 *    packet
		 */
		primary_if = primary_if_get_selected(bat_priv);
		primary_if = batadv_primary_if_get_selected(bat_priv);
		if (!primary_if)
			goto out;

@@ -352,7 +352,7 @@ static bool bat_iv_ogm_can_aggregate(const struct batman_ogm_packet

out:
	if (primary_if)
		hardif_free_ref(primary_if);
		batadv_hardif_free_ref(primary_if);
	return res;
}

@@ -431,7 +431,7 @@ static void bat_iv_ogm_aggregate_new(const unsigned char *packet_buff,

	return;
out:
	hardif_free_ref(if_incoming);
	batadv_hardif_free_ref(if_incoming);
}

/* aggregate a new packet into the existing ogm packet */
@@ -570,7 +570,7 @@ static void bat_iv_ogm_schedule(struct hard_iface *hard_iface)
	int vis_server, tt_num_changes = 0;

	vis_server = atomic_read(&bat_priv->vis_mode);
	primary_if = primary_if_get_selected(bat_priv);
	primary_if = batadv_primary_if_get_selected(bat_priv);

	if (hard_iface == primary_if)
		tt_num_changes = batadv_tt_append_diff(bat_priv,
@@ -608,7 +608,7 @@ static void bat_iv_ogm_schedule(struct hard_iface *hard_iface)
			     bat_iv_ogm_emit_send_time(bat_priv));

	if (primary_if)
		hardif_free_ref(primary_if);
		batadv_hardif_free_ref(primary_if);
}

static void bat_iv_ogm_orig_update(struct bat_priv *bat_priv,
+8 −8
Original line number Diff line number Diff line
@@ -132,7 +132,7 @@ ssize_t store_##_name(struct kobject *kobj, struct attribute *attr, \
	length = __store_uint_attr(buff, count, _min, _max, _post_func,	\
				   attr, &hard_iface->_name, net_dev);	\
									\
	hardif_free_ref(hard_iface);					\
	batadv_hardif_free_ref(hard_iface);				\
	return length;							\
}

@@ -150,7 +150,7 @@ ssize_t show_##_name(struct kobject *kobj, \
									\
	length = sprintf(buff, "%i\n", atomic_read(&hard_iface->_name));\
									\
	hardif_free_ref(hard_iface);					\
	batadv_hardif_free_ref(hard_iface);				\
	return length;							\
}

@@ -535,7 +535,7 @@ static ssize_t show_mesh_iface(struct kobject *kobj, struct attribute *attr,
	length = sprintf(buff, "%s\n", hard_iface->if_status == IF_NOT_IN_USE ?
			 "none" : hard_iface->soft_iface->name);

	hardif_free_ref(hard_iface);
	batadv_hardif_free_ref(hard_iface);

	return length;
}
@@ -557,7 +557,7 @@ static ssize_t store_mesh_iface(struct kobject *kobj, struct attribute *attr,
	if (strlen(buff) >= IFNAMSIZ) {
		pr_err("Invalid parameter for 'mesh_iface' setting received: interface name too long '%s'\n",
		       buff);
		hardif_free_ref(hard_iface);
		batadv_hardif_free_ref(hard_iface);
		return -EINVAL;
	}

@@ -592,7 +592,7 @@ static ssize_t store_mesh_iface(struct kobject *kobj, struct attribute *attr,
unlock:
	rtnl_unlock();
out:
	hardif_free_ref(hard_iface);
	batadv_hardif_free_ref(hard_iface);
	return ret;
}

@@ -625,7 +625,7 @@ static ssize_t show_iface_status(struct kobject *kobj, struct attribute *attr,
		break;
	}

	hardif_free_ref(hard_iface);
	batadv_hardif_free_ref(hard_iface);

	return length;
}
@@ -688,7 +688,7 @@ int batadv_throw_uevent(struct bat_priv *bat_priv, enum uev_type type,
	struct kobject *bat_kobj;
	char *uevent_env[4] = { NULL, NULL, NULL, NULL };

	primary_if = primary_if_get_selected(bat_priv);
	primary_if = batadv_primary_if_get_selected(bat_priv);
	if (!primary_if)
		goto out;

@@ -727,7 +727,7 @@ int batadv_throw_uevent(struct bat_priv *bat_priv, enum uev_type type,
	kfree(uevent_env[2]);

	if (primary_if)
		hardif_free_ref(primary_if);
		batadv_hardif_free_ref(primary_if);

	if (ret)
		bat_dbg(DBG_BATMAN, bat_priv,
+14 −14
Original line number Diff line number Diff line
@@ -255,7 +255,7 @@ static void bla_send_claim(struct bat_priv *bat_priv, uint8_t *mac,
	struct bla_claim_dst local_claim_dest;
	__be32 zeroip = 0;

	primary_if = primary_if_get_selected(bat_priv);
	primary_if = batadv_primary_if_get_selected(bat_priv);
	if (!primary_if)
		return;

@@ -339,7 +339,7 @@ static void bla_send_claim(struct bat_priv *bat_priv, uint8_t *mac,
	netif_rx(skb);
out:
	if (primary_if)
		hardif_free_ref(primary_if);
		batadv_hardif_free_ref(primary_if);
}

/* @bat_priv: the bat priv with all the soft interface information
@@ -1075,7 +1075,7 @@ static void bla_periodic_work(struct work_struct *work)
	struct hard_iface *primary_if;
	int i;

	primary_if = primary_if_get_selected(bat_priv);
	primary_if = batadv_primary_if_get_selected(bat_priv);
	if (!primary_if)
		goto out;

@@ -1106,7 +1106,7 @@ static void bla_periodic_work(struct work_struct *work)
	}
out:
	if (primary_if)
		hardif_free_ref(primary_if);
		batadv_hardif_free_ref(primary_if);

	bla_start_timer(bat_priv);
}
@@ -1131,12 +1131,12 @@ int batadv_bla_init(struct bat_priv *bat_priv)
	/* setting claim destination address */
	memcpy(&bat_priv->claim_dest.magic, claim_dest, 3);
	bat_priv->claim_dest.type = 0;
	primary_if = primary_if_get_selected(bat_priv);
	primary_if = batadv_primary_if_get_selected(bat_priv);
	if (primary_if) {
		bat_priv->claim_dest.group =
			htons(crc16(0, primary_if->net_dev->dev_addr,
				    ETH_ALEN));
		hardif_free_ref(primary_if);
		batadv_hardif_free_ref(primary_if);
	} else {
		bat_priv->claim_dest.group = 0; /* will be set later */
	}
@@ -1319,7 +1319,7 @@ void batadv_bla_free(struct bat_priv *bat_priv)
	struct hard_iface *primary_if;

	cancel_delayed_work_sync(&bat_priv->bla_work);
	primary_if = primary_if_get_selected(bat_priv);
	primary_if = batadv_primary_if_get_selected(bat_priv);

	if (bat_priv->claim_hash) {
		bla_purge_claims(bat_priv, primary_if, 1);
@@ -1332,7 +1332,7 @@ void batadv_bla_free(struct bat_priv *bat_priv)
		bat_priv->backbone_hash = NULL;
	}
	if (primary_if)
		hardif_free_ref(primary_if);
		batadv_hardif_free_ref(primary_if);
}

/* @bat_priv: the bat priv with all the soft interface information
@@ -1356,7 +1356,7 @@ int batadv_bla_rx(struct bat_priv *bat_priv, struct sk_buff *skb, short vid)

	ethhdr = (struct ethhdr *)skb_mac_header(skb);

	primary_if = primary_if_get_selected(bat_priv);
	primary_if = batadv_primary_if_get_selected(bat_priv);
	if (!primary_if)
		goto handled;

@@ -1416,7 +1416,7 @@ int batadv_bla_rx(struct bat_priv *bat_priv, struct sk_buff *skb, short vid)

out:
	if (primary_if)
		hardif_free_ref(primary_if);
		batadv_hardif_free_ref(primary_if);
	if (claim)
		claim_free_ref(claim);
	return ret;
@@ -1441,7 +1441,7 @@ int batadv_bla_tx(struct bat_priv *bat_priv, struct sk_buff *skb, short vid)
	struct hard_iface *primary_if;
	int ret = 0;

	primary_if = primary_if_get_selected(bat_priv);
	primary_if = batadv_primary_if_get_selected(bat_priv);
	if (!primary_if)
		goto out;

@@ -1502,7 +1502,7 @@ int batadv_bla_tx(struct bat_priv *bat_priv, struct sk_buff *skb, short vid)
	ret = 1;
out:
	if (primary_if)
		hardif_free_ref(primary_if);
		batadv_hardif_free_ref(primary_if);
	if (claim)
		claim_free_ref(claim);
	return ret;
@@ -1521,7 +1521,7 @@ int batadv_bla_claim_table_seq_print_text(struct seq_file *seq, void *offset)
	bool is_own;
	int ret = 0;

	primary_if = primary_if_get_selected(bat_priv);
	primary_if = batadv_primary_if_get_selected(bat_priv);
	if (!primary_if) {
		ret = seq_printf(seq,
				 "BATMAN mesh %s disabled - please specify interfaces to enable it\n",
@@ -1559,6 +1559,6 @@ int batadv_bla_claim_table_seq_print_text(struct seq_file *seq, void *offset)
	}
out:
	if (primary_if)
		hardif_free_ref(primary_if);
		batadv_hardif_free_ref(primary_if);
	return ret;
}
+2 −2
Original line number Diff line number Diff line
@@ -464,7 +464,7 @@ int batadv_gw_client_seq_print_text(struct seq_file *seq, void *offset)
	struct hlist_node *node;
	int gw_count = 0, ret = 0;

	primary_if = primary_if_get_selected(bat_priv);
	primary_if = batadv_primary_if_get_selected(bat_priv);
	if (!primary_if) {
		ret = seq_printf(seq,
				 "BATMAN mesh %s disabled - please specify interfaces to enable it\n",
@@ -503,7 +503,7 @@ int batadv_gw_client_seq_print_text(struct seq_file *seq, void *offset)

out:
	if (primary_if)
		hardif_free_ref(primary_if);
		batadv_hardif_free_ref(primary_if);
	return ret;
}

+14 −14
Original line number Diff line number Diff line
@@ -102,7 +102,7 @@ static void primary_if_update_addr(struct bat_priv *bat_priv,
	struct vis_packet *vis_packet;
	struct hard_iface *primary_if;

	primary_if = primary_if_get_selected(bat_priv);
	primary_if = batadv_primary_if_get_selected(bat_priv);
	if (!primary_if)
		goto out;

@@ -115,7 +115,7 @@ static void primary_if_update_addr(struct bat_priv *bat_priv,
	batadv_bla_update_orig_address(bat_priv, primary_if, oldif);
out:
	if (primary_if)
		hardif_free_ref(primary_if);
		batadv_hardif_free_ref(primary_if);
}

static void primary_if_select(struct bat_priv *bat_priv,
@@ -139,7 +139,7 @@ static void primary_if_select(struct bat_priv *bat_priv,

out:
	if (curr_hard_iface)
		hardif_free_ref(curr_hard_iface);
		batadv_hardif_free_ref(curr_hard_iface);
}

static bool hardif_is_iface_up(const struct hard_iface *hard_iface)
@@ -229,7 +229,7 @@ static void hardif_activate_interface(struct hard_iface *hard_iface)
	/* the first active interface becomes our primary interface or
	 * the next active interface after the old primary interface was removed
	 */
	primary_if = primary_if_get_selected(bat_priv);
	primary_if = batadv_primary_if_get_selected(bat_priv);
	if (!primary_if)
		primary_if_select(bat_priv, hard_iface);

@@ -240,7 +240,7 @@ static void hardif_activate_interface(struct hard_iface *hard_iface)

out:
	if (primary_if)
		hardif_free_ref(primary_if);
		batadv_hardif_free_ref(primary_if);
}

static void hardif_deactivate_interface(struct hard_iface *hard_iface)
@@ -347,7 +347,7 @@ int batadv_hardif_enable_interface(struct hard_iface *hard_iface,
err_dev:
	dev_put(soft_iface);
err:
	hardif_free_ref(hard_iface);
	batadv_hardif_free_ref(hard_iface);
	return ret;
}

@@ -369,7 +369,7 @@ void batadv_hardif_disable_interface(struct hard_iface *hard_iface)
	bat_priv->num_ifaces--;
	batadv_orig_hash_del_if(hard_iface, bat_priv->num_ifaces);

	primary_if = primary_if_get_selected(bat_priv);
	primary_if = batadv_primary_if_get_selected(bat_priv);
	if (hard_iface == primary_if) {
		struct hard_iface *new_if;

@@ -377,7 +377,7 @@ void batadv_hardif_disable_interface(struct hard_iface *hard_iface)
		primary_if_select(bat_priv, new_if);

		if (new_if)
			hardif_free_ref(new_if);
			batadv_hardif_free_ref(new_if);
	}

	bat_priv->bat_algo_ops->bat_iface_disable(hard_iface);
@@ -393,11 +393,11 @@ void batadv_hardif_disable_interface(struct hard_iface *hard_iface)
		batadv_softif_destroy(hard_iface->soft_iface);

	hard_iface->soft_iface = NULL;
	hardif_free_ref(hard_iface);
	batadv_hardif_free_ref(hard_iface);

out:
	if (primary_if)
		hardif_free_ref(primary_if);
		batadv_hardif_free_ref(primary_if);
}

static struct hard_iface *hardif_add_interface(struct net_device *net_dev)
@@ -461,7 +461,7 @@ static void hardif_remove_interface(struct hard_iface *hard_iface)

	hard_iface->if_status = IF_TO_BE_REMOVED;
	batadv_sysfs_del_hardif(&hard_iface->hardif_obj);
	hardif_free_ref(hard_iface);
	batadv_hardif_free_ref(hard_iface);
}

void batadv_hardif_remove_interfaces(void)
@@ -517,7 +517,7 @@ static int hard_if_event(struct notifier_block *this,
		bat_priv = netdev_priv(hard_iface->soft_iface);
		bat_priv->bat_algo_ops->bat_iface_update_mac(hard_iface);

		primary_if = primary_if_get_selected(bat_priv);
		primary_if = batadv_primary_if_get_selected(bat_priv);
		if (!primary_if)
			goto hardif_put;

@@ -529,10 +529,10 @@ static int hard_if_event(struct notifier_block *this,
	}

hardif_put:
	hardif_free_ref(hard_iface);
	batadv_hardif_free_ref(hard_iface);
out:
	if (primary_if)
		hardif_free_ref(primary_if);
		batadv_hardif_free_ref(primary_if);
	return NOTIFY_DONE;
}

Loading