All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Wunderlich <sw@simonwunderlich.de>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, b.a.t.m.a.n@lists.open-mesh.org
Subject: [B.A.T.M.A.N.] [PATCH 07/17] batman-adv: Move batadv_sum_counter to soft-interface.c
Date: Thu, 27 Oct 2016 21:01:40 +0200	[thread overview]
Message-ID: <20161027190150.7880-8-sw@simonwunderlich.de> (raw)
In-Reply-To: <20161027190150.7880-1-sw@simonwunderlich.de>

From: Sven Eckelmann <sven@narfation.org>

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>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
---
 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 8b0979b..6a2328d 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);
-- 
2.10.1


WARNING: multiple messages have this Message-ID (diff)
From: Simon Wunderlich <sw@simonwunderlich.de>
To: davem@davemloft.net
Cc: netdev@vger.kernel.org, b.a.t.m.a.n@lists.open-mesh.org,
	Sven Eckelmann <sven@narfation.org>,
	Simon Wunderlich <sw@simonwunderlich.de>
Subject: [PATCH 07/17] batman-adv: Move batadv_sum_counter to soft-interface.c
Date: Thu, 27 Oct 2016 21:01:40 +0200	[thread overview]
Message-ID: <20161027190150.7880-8-sw@simonwunderlich.de> (raw)
In-Reply-To: <20161027190150.7880-1-sw@simonwunderlich.de>

From: Sven Eckelmann <sven@narfation.org>

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>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
---
 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 8b0979b..6a2328d 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);
-- 
2.10.1

  parent reply	other threads:[~2016-10-27 19:01 UTC|newest]

Thread overview: 69+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-27 19:01 [B.A.T.M.A.N.] [PATCH 00/17] pull request for net-next: batman-adv 2016-10-27 Simon Wunderlich
2016-10-27 19:01 ` Simon Wunderlich
2016-10-27 19:01 ` [B.A.T.M.A.N.] [PATCH 01/17] batman-adv: Start new development cycle Simon Wunderlich
2016-10-27 19:01   ` Simon Wunderlich
2016-10-27 19:01 ` [B.A.T.M.A.N.] [PATCH 02/17] batman-adv: Add B.A.T.M.A.N. V sysfs files to README Simon Wunderlich
2016-10-27 19:01   ` Simon Wunderlich
2016-10-27 19:01 ` [B.A.T.M.A.N.] [PATCH 03/17] batman-adv: Add network_coding and mcast " Simon Wunderlich
2016-10-27 19:01   ` Simon Wunderlich
2016-10-29 10:33   ` [B.A.T.M.A.N.] " Jiri Pirko
2016-10-29 10:33     ` Jiri Pirko
2016-10-29 10:37     ` [B.A.T.M.A.N.] " Sven Eckelmann
2016-10-29 10:37       ` Sven Eckelmann
2016-10-29 10:56       ` [B.A.T.M.A.N.] " Jiri Pirko
2016-10-29 10:56         ` Jiri Pirko
2016-10-29 11:46         ` [B.A.T.M.A.N.] " Sven Eckelmann
2016-10-29 11:46           ` Sven Eckelmann
2016-10-29 13:51           ` [B.A.T.M.A.N.] " Jiri Pirko
2016-10-29 13:51             ` Jiri Pirko
2018-03-27 15:43         ` [B.A.T.M.A.N.] " Linus Lüssing
2018-05-07  6:34           ` Sven Eckelmann
2018-05-07  6:34             ` Sven Eckelmann
2018-05-20  4:37             ` [B.A.T.M.A.N.] " Sven Eckelmann
2018-05-20  4:37               ` Sven Eckelmann
2018-05-20  6:19           ` [B.A.T.M.A.N.] " Jiri Pirko
2018-05-20  6:19             ` Jiri Pirko
2018-08-04  9:24             ` [B.A.T.M.A.N.] " Antonio Quartulli
2018-08-04  9:36               ` Jiri Pirko
2018-08-04  9:36                 ` Jiri Pirko
2018-08-04 11:19                 ` [B.A.T.M.A.N.] " Antonio Quartulli
2018-08-04 11:52                   ` Jiri Pirko
2018-08-04 11:52                     ` Jiri Pirko
2016-10-27 19:01 ` [B.A.T.M.A.N.] [PATCH 04/17] batman-adv: Add dat, mcast, nc and neighbor debugfs " Simon Wunderlich
2016-10-27 19:01   ` Simon Wunderlich
2016-10-27 19:01 ` [B.A.T.M.A.N.] [PATCH 05/17] batman-adv: Document new nc, mcast and tpmeter log levels Simon Wunderlich
2016-10-27 19:01   ` Simon Wunderlich
2016-10-27 19:01 ` [B.A.T.M.A.N.] [PATCH 06/17] batman-adv: Remove unused function batadv_hash_delete Simon Wunderlich
2016-10-27 19:01   ` Simon Wunderlich
2016-10-27 19:01 ` Simon Wunderlich [this message]
2016-10-27 19:01   ` [PATCH 07/17] batman-adv: Move batadv_sum_counter to soft-interface.c Simon Wunderlich
2016-10-27 19:01 ` [B.A.T.M.A.N.] [PATCH 08/17] batman-adv: Remove unused batadv_icmp_user_cmd_type Simon Wunderlich
2016-10-27 19:01   ` Simon Wunderlich
2016-10-27 19:01 ` [B.A.T.M.A.N.] [PATCH 09/17] batman-adv: fix batadv_forw_packet kerneldoc for list attribute Simon Wunderlich
2016-10-27 19:01   ` Simon Wunderlich
2016-10-27 19:01 ` [B.A.T.M.A.N.] [PATCH 10/17] batman-adv: remove unsed argument from batadv_dbg_arp() function Simon Wunderlich
2016-10-27 19:01   ` Simon Wunderlich
2016-10-27 19:01 ` [B.A.T.M.A.N.] [PATCH 11/17] batman-adv: Allow selecting BATMAN V if CFG80211 is not built Simon Wunderlich
2016-10-27 19:01   ` Simon Wunderlich
2016-10-27 19:01 ` [B.A.T.M.A.N.] [PATCH 12/17] batman-adv: Less function calls in batadv_is_ap_isolated() after error detection Simon Wunderlich
2016-10-27 19:01   ` Simon Wunderlich
2016-10-27 19:01 ` [B.A.T.M.A.N.] [PATCH 13/17] batman-adv: Remove needless init of variables on stack Simon Wunderlich
2016-10-27 19:01   ` Simon Wunderlich
2016-10-27 19:01 ` [B.A.T.M.A.N.] [PATCH 14/17] batman-adv: Use proper name for fragments list head Simon Wunderlich
2016-10-27 19:01   ` Simon Wunderlich
2016-10-27 19:01 ` [B.A.T.M.A.N.] [PATCH 15/17] batman-adv: Use proper name for gateway " Simon Wunderlich
2016-10-27 19:01   ` Simon Wunderlich
2016-10-27 19:01 ` [B.A.T.M.A.N.] [PATCH 16/17] batman-adv: Use octal permissions instead of macros Simon Wunderlich
2016-10-27 19:01   ` Simon Wunderlich
2016-10-27 19:01 ` [B.A.T.M.A.N.] [PATCH 17/17] batman-adv: Avoid precedence issues in macros Simon Wunderlich
2016-10-27 19:01   ` Simon Wunderlich
2016-10-28 21:13   ` [B.A.T.M.A.N.] " Joe Perches
2016-10-28 21:13     ` Joe Perches
2016-10-28 21:27     ` [B.A.T.M.A.N.] " Sven Eckelmann
2016-10-28 21:27       ` Sven Eckelmann
2016-10-29  1:56       ` [B.A.T.M.A.N.] " Joe Perches
2016-10-29  1:56         ` Joe Perches
2016-10-29  6:52         ` [B.A.T.M.A.N.] " Sven Eckelmann
2016-10-29  6:52           ` Sven Eckelmann
2016-10-29 20:28 ` [B.A.T.M.A.N.] [PATCH 00/17] pull request for net-next: batman-adv 2016-10-27 David Miller
2016-10-29 20:28   ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161027190150.7880-8-sw@simonwunderlich.de \
    --to=sw@simonwunderlich.de \
    --cc=b.a.t.m.a.n@lists.open-mesh.org \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.