* [B.A.T.M.A.N.] [PATCH] batman-adv: Remove unused function batadv_hash_delete
@ 2016-07-21 23:30 Sven Eckelmann
2016-07-21 23:30 ` [B.A.T.M.A.N.] [PATCH] batman-adv: Move batadv_sum_counter to soft-interface.c Sven Eckelmann
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Sven Eckelmann @ 2016-07-21 23:30 UTC (permalink / raw)
To: b.a.t.m.a.n
Signed-off-by: Sven Eckelmann <sven@narfation.org>
---
net/batman-adv/hash.h | 30 ------------------------------
1 file changed, 30 deletions(-)
diff --git a/net/batman-adv/hash.h b/net/batman-adv/hash.h
index cbbf870..557a704 100644
--- a/net/batman-adv/hash.h
+++ b/net/batman-adv/hash.h
@@ -61,36 +61,6 @@ void batadv_hash_set_lock_class(struct batadv_hashtable *hash,
/* free only the hashtable and the hash itself. */
void batadv_hash_destroy(struct batadv_hashtable *hash);
-/* remove the hash structure. if hashdata_free_cb != NULL, this function will be
- * called to remove the elements inside of the hash. if you don't remove the
- * elements, memory might be leaked.
- */
-static inline void batadv_hash_delete(struct batadv_hashtable *hash,
- batadv_hashdata_free_cb free_cb,
- void *arg)
-{
- struct hlist_head *head;
- struct hlist_node *node, *node_tmp;
- spinlock_t *list_lock; /* spinlock to protect write access */
- u32 i;
-
- for (i = 0; i < hash->size; i++) {
- head = &hash->table[i];
- list_lock = &hash->list_locks[i];
-
- spin_lock_bh(list_lock);
- hlist_for_each_safe(node, node_tmp, head) {
- hlist_del_rcu(node);
-
- if (free_cb)
- free_cb(node, arg);
- }
- spin_unlock_bh(list_lock);
- }
-
- batadv_hash_destroy(hash);
-}
-
/**
* batadv_hash_add - adds data to the hashtable
* @hash: storage hash table
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [B.A.T.M.A.N.] [PATCH] batman-adv: Move batadv_sum_counter to soft-interface.c
2016-07-21 23:30 [B.A.T.M.A.N.] [PATCH] batman-adv: Remove unused function batadv_hash_delete Sven Eckelmann
@ 2016-07-21 23:30 ` Sven Eckelmann
2016-10-18 11:28 ` [B.A.T.M.A.N.] [2/3] " Sven Eckelmann
2016-07-21 23:30 ` [B.A.T.M.A.N.] [PATCH] batman-adv: Remove unused batadv_icmp_user_cmd_type Sven Eckelmann
2016-10-18 11:27 ` [B.A.T.M.A.N.] [1/3] batman-adv: Remove unused function batadv_hash_delete Sven Eckelmann
2 siblings, 1 reply; 6+ messages in thread
From: Sven Eckelmann @ 2016-07-21 23:30 UTC (permalink / raw)
To: b.a.t.m.a.n
The function batadv_sum_counter is only used in soft-interface.c and has no
special relevance for main.h.
Signed-off-by: Sven Eckelmann <sven@narfation.org>
---
net/batman-adv/main.h | 21 ---------------------
net/batman-adv/soft-interface.c | 21 +++++++++++++++++++++
2 files changed, 21 insertions(+), 21 deletions(-)
diff --git a/net/batman-adv/main.h b/net/batman-adv/main.h
index 06a8608..3633515 100644
--- a/net/batman-adv/main.h
+++ b/net/batman-adv/main.h
@@ -185,7 +185,6 @@ enum batadv_uev_type {
#include <linux/bitops.h> /* for packet.h */
#include <linux/compiler.h>
-#include <linux/cpumask.h>
#include <linux/etherdevice.h>
#include <linux/if_ether.h> /* for packet.h */
#include <linux/if_vlan.h>
@@ -284,26 +283,6 @@ static inline void batadv_add_counter(struct batadv_priv *bat_priv, size_t idx,
#define batadv_inc_counter(b, i) batadv_add_counter(b, i, 1)
-/**
- * batadv_sum_counter - Sum the cpu-local counters for index 'idx'
- * @bat_priv: the bat priv with all the soft interface information
- * @idx: index of counter to sum up
- *
- * Return: sum of all cpu-local counters
- */
-static inline u64 batadv_sum_counter(struct batadv_priv *bat_priv, size_t idx)
-{
- u64 *counters, sum = 0;
- int cpu;
-
- for_each_possible_cpu(cpu) {
- counters = per_cpu_ptr(bat_priv->bat_counters, cpu);
- sum += counters[idx];
- }
-
- return sum;
-}
-
/* Define a macro to reach the control buffer of the skb. The members of the
* control buffer are defined in struct batadv_skb_cb in types.h.
* The macro is inspired by the similar macro TCP_SKB_CB() in tcp.h.
diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c
index 49e16b6..f37c1c7 100644
--- a/net/batman-adv/soft-interface.c
+++ b/net/batman-adv/soft-interface.c
@@ -22,6 +22,7 @@
#include <linux/byteorder/generic.h>
#include <linux/cache.h>
#include <linux/compiler.h>
+#include <linux/cpumask.h>
#include <linux/errno.h>
#include <linux/etherdevice.h>
#include <linux/ethtool.h>
@@ -116,6 +117,26 @@ static int batadv_interface_release(struct net_device *dev)
return 0;
}
+/**
+ * batadv_sum_counter - Sum the cpu-local counters for index 'idx'
+ * @bat_priv: the bat priv with all the soft interface information
+ * @idx: index of counter to sum up
+ *
+ * Return: sum of all cpu-local counters
+ */
+static u64 batadv_sum_counter(struct batadv_priv *bat_priv, size_t idx)
+{
+ u64 *counters, sum = 0;
+ int cpu;
+
+ for_each_possible_cpu(cpu) {
+ counters = per_cpu_ptr(bat_priv->bat_counters, cpu);
+ sum += counters[idx];
+ }
+
+ return sum;
+}
+
static struct net_device_stats *batadv_interface_stats(struct net_device *dev)
{
struct batadv_priv *bat_priv = netdev_priv(dev);
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [B.A.T.M.A.N.] [PATCH] batman-adv: Remove unused batadv_icmp_user_cmd_type
2016-07-21 23:30 [B.A.T.M.A.N.] [PATCH] batman-adv: Remove unused function batadv_hash_delete Sven Eckelmann
2016-07-21 23:30 ` [B.A.T.M.A.N.] [PATCH] batman-adv: Move batadv_sum_counter to soft-interface.c Sven Eckelmann
@ 2016-07-21 23:30 ` Sven Eckelmann
2016-10-18 11:29 ` [B.A.T.M.A.N.] [3/3] " Sven Eckelmann
2016-10-18 11:27 ` [B.A.T.M.A.N.] [1/3] batman-adv: Remove unused function batadv_hash_delete Sven Eckelmann
2 siblings, 1 reply; 6+ messages in thread
From: Sven Eckelmann @ 2016-07-21 23:30 UTC (permalink / raw)
To: b.a.t.m.a.n
Signed-off-by: Sven Eckelmann <sven@narfation.org>
---
net/batman-adv/packet.h | 10 ----------
1 file changed, 10 deletions(-)
diff --git a/net/batman-adv/packet.h b/net/batman-adv/packet.h
index 6afc0b8..d2e9bbd 100644
--- a/net/batman-adv/packet.h
+++ b/net/batman-adv/packet.h
@@ -252,16 +252,6 @@ struct batadv_elp_packet {
#define BATADV_ELP_HLEN sizeof(struct batadv_elp_packet)
/**
- * enum batadv_icmp_user_cmd_type - types for batman-adv icmp cmd modes
- * @BATADV_TP_START: start a throughput meter run
- * @BATADV_TP_STOP: stop a throughput meter run
- */
-enum batadv_icmp_user_cmd_type {
- BATADV_TP_START = 0,
- BATADV_TP_STOP = 2,
-};
-
-/**
* struct batadv_icmp_header - common members among all the ICMP packets
* @packet_type: batman-adv packet type, part of the general header
* @version: batman-adv protocol version, part of the genereal header
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [B.A.T.M.A.N.] [1/3] batman-adv: Remove unused function batadv_hash_delete
2016-07-21 23:30 [B.A.T.M.A.N.] [PATCH] batman-adv: Remove unused function batadv_hash_delete Sven Eckelmann
2016-07-21 23:30 ` [B.A.T.M.A.N.] [PATCH] batman-adv: Move batadv_sum_counter to soft-interface.c Sven Eckelmann
2016-07-21 23:30 ` [B.A.T.M.A.N.] [PATCH] batman-adv: Remove unused batadv_icmp_user_cmd_type Sven Eckelmann
@ 2016-10-18 11:27 ` Sven Eckelmann
2 siblings, 0 replies; 6+ messages in thread
From: Sven Eckelmann @ 2016-10-18 11:27 UTC (permalink / raw)
To: b.a.t.m.a.n
[-- Attachment #1: Type: text/plain, Size: 390 bytes --]
On Freitag, 22. Juli 2016 01:30:09 CEST Sven Eckelmann wrote:
> Signed-off-by: Sven Eckelmann <sven@narfation.org>
> ---
> net/batman-adv/hash.h | 30 ------------------------------
> 1 file changed, 30 deletions(-)
Applied in b9f4f99a926c9de798c6bd49d01632c07ee7c262 [1].
Kind regards,
Sven
[1] https://git.open-mesh.org/batman-adv.git/commit/b9f4f99a926c9de798c6bd49d01632c07ee7c262
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 801 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [B.A.T.M.A.N.] [2/3] batman-adv: Move batadv_sum_counter to soft-interface.c
2016-07-21 23:30 ` [B.A.T.M.A.N.] [PATCH] batman-adv: Move batadv_sum_counter to soft-interface.c Sven Eckelmann
@ 2016-10-18 11:28 ` Sven Eckelmann
0 siblings, 0 replies; 6+ messages in thread
From: Sven Eckelmann @ 2016-10-18 11:28 UTC (permalink / raw)
To: b.a.t.m.a.n
[-- Attachment #1: Type: text/plain, Size: 584 bytes --]
On Freitag, 22. Juli 2016 01:30:10 CEST Sven Eckelmann wrote:
> The function batadv_sum_counter is only used in soft-interface.c and has no
> special relevance for main.h.
>
> Signed-off-by: Sven Eckelmann <sven@narfation.org>
> ---
> net/batman-adv/main.h | 21 ---------------------
> net/batman-adv/soft-interface.c | 21 +++++++++++++++++++++
> 2 files changed, 21 insertions(+), 21 deletions(-)
Applied in 173408336c72f5d1ce049b3adeba8d1ce9a3a2b8 [1].
Kind regards,
Sven
[1] https://git.open-mesh.org/batman-adv.git/commit/173408336c72f5d1ce049b3adeba8d1ce9a3a2b8
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 801 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [B.A.T.M.A.N.] [3/3] batman-adv: Remove unused batadv_icmp_user_cmd_type
2016-07-21 23:30 ` [B.A.T.M.A.N.] [PATCH] batman-adv: Remove unused batadv_icmp_user_cmd_type Sven Eckelmann
@ 2016-10-18 11:29 ` Sven Eckelmann
0 siblings, 0 replies; 6+ messages in thread
From: Sven Eckelmann @ 2016-10-18 11:29 UTC (permalink / raw)
To: b.a.t.m.a.n
[-- Attachment #1: Type: text/plain, Size: 371 bytes --]
On Freitag, 22. Juli 2016 01:30:11 CEST Sven Eckelmann wrote:
> Signed-off-by: Sven Eckelmann <sven@narfation.org>
> ---
> net/batman-adv/packet.h | 10 ----------
> 1 file changed, 10 deletions(-)
Applied in 15a6f33c42878b2333be1568941dba5cec70c53a [1].
Kind regards,
Sven
[1] https://git.open-mesh.org/batman-adv.git/commit/15a6f33c42878b2333be1568941dba5cec70c53a
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 801 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2016-10-18 11:29 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-07-21 23:30 [B.A.T.M.A.N.] [PATCH] batman-adv: Remove unused function batadv_hash_delete Sven Eckelmann
2016-07-21 23:30 ` [B.A.T.M.A.N.] [PATCH] batman-adv: Move batadv_sum_counter to soft-interface.c Sven Eckelmann
2016-10-18 11:28 ` [B.A.T.M.A.N.] [2/3] " Sven Eckelmann
2016-07-21 23:30 ` [B.A.T.M.A.N.] [PATCH] batman-adv: Remove unused batadv_icmp_user_cmd_type Sven Eckelmann
2016-10-18 11:29 ` [B.A.T.M.A.N.] [3/3] " Sven Eckelmann
2016-10-18 11:27 ` [B.A.T.M.A.N.] [1/3] batman-adv: Remove unused function batadv_hash_delete Sven Eckelmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).