* [B.A.T.M.A.N.] [PATCH 1/3] batman-adv: Unify include guards style
2018-07-07 20:01 [B.A.T.M.A.N.] [PATCH 0/3] batman-adv: Minor cleanups Sven Eckelmann
@ 2018-07-07 20:01 ` Sven Eckelmann
2018-07-07 20:01 ` [B.A.T.M.A.N.] [PATCH 2/3] batman-adv: Join batadv_purge_orig_ref and _batadv_purge_orig Sven Eckelmann
` (2 subsequent siblings)
3 siblings, 0 replies; 6+ messages in thread
From: Sven Eckelmann @ 2018-07-07 20:01 UTC (permalink / raw)
To: b.a.t.m.a.n
All other include guards in batman-adv use the style:
* _NET_BATMAN_ADV_$(FILENAME)_
* uppercase only
* "." & "-" replaced with "_"
Use this also in the B.A.T.M.A.N. IV/V OGM implementation headers.
Signed-off-by: Sven Eckelmann <sven@narfation.org>
---
net/batman-adv/bat_iv_ogm.h | 6 +++---
net/batman-adv/bat_v_ogm.h | 6 +++---
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/net/batman-adv/bat_iv_ogm.h b/net/batman-adv/bat_iv_ogm.h
index 317cafd3..3dc6a7a4 100644
--- a/net/batman-adv/bat_iv_ogm.h
+++ b/net/batman-adv/bat_iv_ogm.h
@@ -16,11 +16,11 @@
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef _BATMAN_ADV_BATADV_IV_OGM_H_
-#define _BATMAN_ADV_BATADV_IV_OGM_H_
+#ifndef _NET_BATMAN_ADV_BAT_IV_OGM_H_
+#define _NET_BATMAN_ADV_BAT_IV_OGM_H_
#include "main.h"
int batadv_iv_init(void);
-#endif /* _BATMAN_ADV_BATADV_IV_OGM_H_ */
+#endif /* _NET_BATMAN_ADV_BAT_IV_OGM_H_ */
diff --git a/net/batman-adv/bat_v_ogm.h b/net/batman-adv/bat_v_ogm.h
index ed36c5e7..e5be14c9 100644
--- a/net/batman-adv/bat_v_ogm.h
+++ b/net/batman-adv/bat_v_ogm.h
@@ -16,8 +16,8 @@
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
-#ifndef _BATMAN_ADV_BATADV_V_OGM_H_
-#define _BATMAN_ADV_BATADV_V_OGM_H_
+#ifndef _NET_BATMAN_ADV_BAT_V_OGM_H_
+#define _NET_BATMAN_ADV_BAT_V_OGM_H_
#include "main.h"
@@ -34,4 +34,4 @@ void batadv_v_ogm_primary_iface_set(struct batadv_hard_iface *primary_iface);
int batadv_v_ogm_packet_recv(struct sk_buff *skb,
struct batadv_hard_iface *if_incoming);
-#endif /* _BATMAN_ADV_BATADV_V_OGM_H_ */
+#endif /* _NET_BATMAN_ADV_BAT_V_OGM_H_ */
--
2.18.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [B.A.T.M.A.N.] [PATCH 2/3] batman-adv: Join batadv_purge_orig_ref and _batadv_purge_orig
2018-07-07 20:01 [B.A.T.M.A.N.] [PATCH 0/3] batman-adv: Minor cleanups Sven Eckelmann
2018-07-07 20:01 ` [B.A.T.M.A.N.] [PATCH 1/3] batman-adv: Unify include guards style Sven Eckelmann
@ 2018-07-07 20:01 ` Sven Eckelmann
2018-07-07 20:01 ` [B.A.T.M.A.N.] [PATCH 3/3] batman-adv: Convert batadv_dat_addr_t to proper type Sven Eckelmann
2018-07-17 17:59 ` [B.A.T.M.A.N.] [PATCH 0/3] batman-adv: Minor cleanups Sven Eckelmann
3 siblings, 0 replies; 6+ messages in thread
From: Sven Eckelmann @ 2018-07-07 20:01 UTC (permalink / raw)
To: b.a.t.m.a.n
The single line function batadv_purge_orig_ref has no function beside
providing the name used by other source files. This can also be done
simpler by just renaming _batadv_purge_orig to batadv_purge_orig_ref.
Signed-off-by: Sven Eckelmann <sven@narfation.org>
---
net/batman-adv/originator.c | 17 ++++++-----------
1 file changed, 6 insertions(+), 11 deletions(-)
diff --git a/net/batman-adv/originator.c b/net/batman-adv/originator.c
index 716e5b43..1d295da3 100644
--- a/net/batman-adv/originator.c
+++ b/net/batman-adv/originator.c
@@ -1339,7 +1339,11 @@ static bool batadv_purge_orig_node(struct batadv_priv *bat_priv,
return false;
}
-static void _batadv_purge_orig(struct batadv_priv *bat_priv)
+/**
+ * batadv_purge_orig_ref() - Purge all outdated originators
+ * @bat_priv: the bat priv with all the soft interface information
+ */
+void batadv_purge_orig_ref(struct batadv_priv *bat_priv)
{
struct batadv_hashtable *hash = bat_priv->orig_hash;
struct hlist_node *node_tmp;
@@ -1385,21 +1389,12 @@ static void batadv_purge_orig(struct work_struct *work)
delayed_work = to_delayed_work(work);
bat_priv = container_of(delayed_work, struct batadv_priv, orig_work);
- _batadv_purge_orig(bat_priv);
+ batadv_purge_orig_ref(bat_priv);
queue_delayed_work(batadv_event_workqueue,
&bat_priv->orig_work,
msecs_to_jiffies(BATADV_ORIG_WORK_PERIOD));
}
-/**
- * batadv_purge_orig_ref() - Purge all outdated originators
- * @bat_priv: the bat priv with all the soft interface information
- */
-void batadv_purge_orig_ref(struct batadv_priv *bat_priv)
-{
- _batadv_purge_orig(bat_priv);
-}
-
#ifdef CONFIG_BATMAN_ADV_DEBUGFS
/**
--
2.18.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [B.A.T.M.A.N.] [PATCH 3/3] batman-adv: Convert batadv_dat_addr_t to proper type
2018-07-07 20:01 [B.A.T.M.A.N.] [PATCH 0/3] batman-adv: Minor cleanups Sven Eckelmann
2018-07-07 20:01 ` [B.A.T.M.A.N.] [PATCH 1/3] batman-adv: Unify include guards style Sven Eckelmann
2018-07-07 20:01 ` [B.A.T.M.A.N.] [PATCH 2/3] batman-adv: Join batadv_purge_orig_ref and _batadv_purge_orig Sven Eckelmann
@ 2018-07-07 20:01 ` Sven Eckelmann
2018-07-08 10:45 ` Antonio Quartulli
2018-07-17 17:59 ` [B.A.T.M.A.N.] [PATCH 0/3] batman-adv: Minor cleanups Sven Eckelmann
3 siblings, 1 reply; 6+ messages in thread
From: Sven Eckelmann @ 2018-07-07 20:01 UTC (permalink / raw)
To: b.a.t.m.a.n
The #define for batadv_dat_addr_t is doing nothing else than giving u16 a
new typename. But C already has the special keyword "typedef" which is also
better supported by kernel-doc.
Signed-off-by: Sven Eckelmann <sven@narfation.org>
---
net/batman-adv/types.h | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/net/batman-adv/types.h b/net/batman-adv/types.h
index 360357f8..343d3048 100644
--- a/net/batman-adv/types.h
+++ b/net/batman-adv/types.h
@@ -43,12 +43,13 @@ struct seq_file;
#ifdef CONFIG_BATMAN_ADV_DAT
/**
- * batadv_dat_addr_t - it is the type used for all DHT addresses. If it is
- * changed, BATADV_DAT_ADDR_MAX is changed as well.
+ * typedef batadv_dat_addr_t - type used for all DHT addresses
+ *
+ * If it is changed, BATADV_DAT_ADDR_MAX is changed as well.
*
* *Please be careful: batadv_dat_addr_t must be UNSIGNED*
*/
-#define batadv_dat_addr_t u16
+typedef u16 batadv_dat_addr_t;
#endif /* CONFIG_BATMAN_ADV_DAT */
--
2.18.0
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [B.A.T.M.A.N.] [PATCH 0/3] batman-adv: Minor cleanups
2018-07-07 20:01 [B.A.T.M.A.N.] [PATCH 0/3] batman-adv: Minor cleanups Sven Eckelmann
` (2 preceding siblings ...)
2018-07-07 20:01 ` [B.A.T.M.A.N.] [PATCH 3/3] batman-adv: Convert batadv_dat_addr_t to proper type Sven Eckelmann
@ 2018-07-17 17:59 ` Sven Eckelmann
3 siblings, 0 replies; 6+ messages in thread
From: Sven Eckelmann @ 2018-07-17 17:59 UTC (permalink / raw)
To: b.a.t.m.a.n
[-- Attachment #1: Type: text/plain, Size: 646 bytes --]
On Samstag, 7. Juli 2018 22:01:18 CEST Sven Eckelmann wrote:
> Hi,
>
> this mini patchset contains some minor cleanups which are on my HDD
> since a longer time but were never submitted. They still didn't reach a
> critical mass - but they will not get better with age.
Added patches as e59198c15f6a [1], e17162880d63 [2] and faf49a350b0b [3]
Kind regards,
Sven
[1] https://git.open-mesh.org/batman-adv.git/commit/e59198c15f6a092f5064cba4bb7d1642b5015af0
[2] https://git.open-mesh.org/batman-adv.git/commit/e17162880d636e7185bfb14980fb3529f90ae5c6
[3] https://git.open-mesh.org/batman-adv.git/commit/faf49a350b0b6f803840307028e3084d4bf78a51
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread