[B.A.T.M.A.N.] [PATCH 3/4] batman-adv: Fix "line over 80 characters" checkpatch warning

2017-10-06 Thread Simon Wunderlich
From: Sven Eckelmann 

Fixes: 242c1a28eb61 ("net: Remove useless function skb_header_release")
Signed-off-by: Sven Eckelmann 
Signed-off-by: Simon Wunderlich 
---
 net/batman-adv/soft-interface.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/net/batman-adv/soft-interface.c b/net/batman-adv/soft-interface.c
index 7c8288245f80..3af4b0b29b23 100644
--- a/net/batman-adv/soft-interface.c
+++ b/net/batman-adv/soft-interface.c
@@ -69,8 +69,8 @@ int batadv_skb_head_push(struct sk_buff *skb, unsigned int 
len)
int result;
 
/* TODO: We must check if we can release all references to non-payload
-* data using __skb_header_release in our skbs to allow skb_cow_header 
to
-* work optimally. This means that those skbs are not allowed to read
+* data using __skb_header_release in our skbs to allow skb_cow_header
+* to work optimally. This means that those skbs are not allowed to read
 * or write any data which is before the current position of skb->data
 * after that call and thus allow other skbs with the same data buffer
 * to write freely in that area.
-- 
2.11.0



[B.A.T.M.A.N.] [PATCH 2/4] batman-adv: Remove unnecessary parentheses

2017-10-06 Thread Simon Wunderlich
From: Sven Eckelmann 

checkpatch introduced with commit 63b7c73ec86b ("checkpatch: add --strict
check for ifs with unnecessary parentheses") an additional test which
identifies some unnecessary parentheses.

Remove these unnecessary parentheses to avoid the warnings and to unify the
coding style slightly more.

Signed-off-by: Sven Eckelmann 
Signed-off-by: Simon Wunderlich 
---
 net/batman-adv/bat_iv_ogm.c| 24 
 net/batman-adv/bat_v.c |  2 +-
 net/batman-adv/bat_v_elp.c |  6 +++---
 net/batman-adv/bat_v_ogm.c | 12 ++--
 net/batman-adv/distributed-arp-table.c |  4 ++--
 net/batman-adv/gateway_client.c|  8 
 net/batman-adv/gateway_common.c| 18 +-
 net/batman-adv/hard-interface.c| 12 ++--
 net/batman-adv/icmp_socket.c   |  4 ++--
 net/batman-adv/main.c  |  4 ++--
 net/batman-adv/multicast.c |  2 +-
 net/batman-adv/originator.c| 26 +-
 net/batman-adv/routing.c   |  6 +++---
 net/batman-adv/send.c  |  6 +++---
 net/batman-adv/soft-interface.c|  2 +-
 net/batman-adv/sysfs.c |  4 ++--
 net/batman-adv/tp_meter.c  |  2 +-
 17 files changed, 71 insertions(+), 71 deletions(-)

diff --git a/net/batman-adv/bat_iv_ogm.c b/net/batman-adv/bat_iv_ogm.c
index 83ba5483455a..1b659ab652fb 100644
--- a/net/batman-adv/bat_iv_ogm.c
+++ b/net/batman-adv/bat_iv_ogm.c
@@ -916,8 +916,8 @@ static void batadv_iv_ogm_schedule(struct batadv_hard_iface 
*hard_iface)
u16 tvlv_len = 0;
unsigned long send_time;
 
-   if ((hard_iface->if_status == BATADV_IF_NOT_IN_USE) ||
-   (hard_iface->if_status == BATADV_IF_TO_BE_REMOVED))
+   if (hard_iface->if_status == BATADV_IF_NOT_IN_USE ||
+   hard_iface->if_status == BATADV_IF_TO_BE_REMOVED)
return;
 
/* the interface gets activated here to avoid race conditions between
@@ -1264,7 +1264,7 @@ static bool batadv_iv_ogm_calc_tq(struct batadv_orig_node 
*orig_node,
 * drops as they can't send and receive at the same time.
 */
tq_iface_penalty = BATADV_TQ_MAX_VALUE;
-   if (if_outgoing && (if_incoming == if_outgoing) &&
+   if (if_outgoing && if_incoming == if_outgoing &&
batadv_is_wifi_hardif(if_outgoing))
tq_iface_penalty = batadv_hop_penalty(BATADV_TQ_MAX_VALUE,
  bat_priv);
@@ -1369,7 +1369,7 @@ batadv_iv_ogm_update_seqnos(const struct ethhdr *ethhdr,
ret = BATADV_NEIGH_DUP;
} else {
set_mark = 0;
-   if (is_dup && (ret != BATADV_NEIGH_DUP))
+   if (is_dup && ret != BATADV_NEIGH_DUP)
ret = BATADV_ORIG_DUP;
}
 
@@ -1515,7 +1515,7 @@ batadv_iv_ogm_process_per_outif(const struct sk_buff 
*skb, int ogm_offset,
/* drop packet if sender is not a direct neighbor and if we
 * don't route towards it
 */
-   if (!is_single_hop_neigh && (!orig_neigh_router)) {
+   if (!is_single_hop_neigh && !orig_neigh_router) {
batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
   "Drop packet: OGM via unknown neighbor!\n");
goto out_neigh;
@@ -1535,7 +1535,7 @@ batadv_iv_ogm_process_per_outif(const struct sk_buff 
*skb, int ogm_offset,
sameseq = orig_ifinfo->last_real_seqno == ntohl(ogm_packet->seqno);
similar_ttl = (orig_ifinfo->last_ttl - 3) <= ogm_packet->ttl;
 
-   if (is_bidirect && ((dup_status == BATADV_NO_DUP) ||
+   if (is_bidirect && (dup_status == BATADV_NO_DUP ||
(sameseq && similar_ttl))) {
batadv_iv_ogm_orig_update(bat_priv, orig_node,
  orig_ifinfo, ethhdr,
@@ -1553,8 +1553,8 @@ batadv_iv_ogm_process_per_outif(const struct sk_buff 
*skb, int ogm_offset,
/* OGMs from secondary interfaces should only scheduled once
 * per interface where it has been received, not multiple times
 */
-   if ((ogm_packet->ttl <= 2) &&
-   (if_incoming != if_outgoing)) {
+   if (ogm_packet->ttl <= 2 &&
+   if_incoming != if_outgoing) {
batadv_dbg(BATADV_DBG_BATMAN, bat_priv,
   "Drop packet: OGM from secondary interface 
and wrong outgoing interface\n");
goto out_neigh;
@@ -1590,7 +1590,7 @@ batadv_iv_ogm_process_per_outif(const struct sk_buff 
*skb, int ogm_offset,
  if_incoming, if_outgoing);
 
 out_neigh:
-   if ((orig_neigh_node) && (!is_single_hop_neigh))
+   if 

[B.A.T.M.A.N.] [PATCH 0/4] pull request for net-next: batman-adv 2017-10-06

2017-10-06 Thread Simon Wunderlich
Hi David,

here is a small cleanup pull request of batman-adv to go into net-next.

Please pull or let me know of any problem!

Thank you,
  Simon

The following changes since commit 242c1a28eb61cb34974e8aa05235d84355940a8a:

  net: Remove useless function skb_header_release (2017-09-22 20:43:13 -0700)

are available in the git repository at:

  git://git.open-mesh.org/linux-merge.git tags/batadv-next-for-davem-20171006

for you to fetch changes up to 706cc9f51d9a22528af18d4b3ffbd17b30a1d3b0:

  batman-adv: Add argument names for function ptr definitions (2017-09-30 
09:31:34 +0200)


This cleanup patchset includes the following patches:

 - bump version strings, by Simon Wunderlich

 - Cleanup patches to make checkpatch happy, by Sven Eckelmann (3 patches)


Simon Wunderlich (1):
  batman-adv: Start new development cycle

Sven Eckelmann (3):
  batman-adv: Remove unnecessary parentheses
  batman-adv: Fix "line over 80 characters" checkpatch warning
  batman-adv: Add argument names for function ptr definitions

 net/batman-adv/bat_iv_ogm.c| 24 
 net/batman-adv/bat_v.c |  2 +-
 net/batman-adv/bat_v_elp.c |  6 +++---
 net/batman-adv/bat_v_ogm.c | 12 ++--
 net/batman-adv/distributed-arp-table.c |  4 ++--
 net/batman-adv/gateway_client.c|  8 
 net/batman-adv/gateway_common.c| 18 +-
 net/batman-adv/hard-interface.c| 12 ++--
 net/batman-adv/icmp_socket.c   |  4 ++--
 net/batman-adv/main.c  | 12 ++--
 net/batman-adv/main.h  |  2 +-
 net/batman-adv/multicast.c |  2 +-
 net/batman-adv/originator.c| 26 +-
 net/batman-adv/routing.c   |  6 +++---
 net/batman-adv/send.c  |  6 +++---
 net/batman-adv/soft-interface.c|  6 +++---
 net/batman-adv/sysfs.c |  4 ++--
 net/batman-adv/tp_meter.c  |  2 +-
 18 files changed, 78 insertions(+), 78 deletions(-)


[B.A.T.M.A.N.] [PATCH 4/4] batman-adv: Add argument names for function ptr definitions

2017-10-06 Thread Simon Wunderlich
From: Sven Eckelmann 

checkpatch started to report unnamed arguments in function pointer
definitions. Add the corresponding names to these definitions to avoid this
warning.

Signed-off-by: Sven Eckelmann 
Signed-off-by: Simon Wunderlich 
---
 net/batman-adv/main.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/net/batman-adv/main.c b/net/batman-adv/main.c
index 033819aefc39..4daed7ad46f2 100644
--- a/net/batman-adv/main.c
+++ b/net/batman-adv/main.c
@@ -73,8 +73,8 @@
  * list traversals just rcu-locked
  */
 struct list_head batadv_hardif_list;
-static int (*batadv_rx_handler[256])(struct sk_buff *,
-struct batadv_hard_iface *);
+static int (*batadv_rx_handler[256])(struct sk_buff *skb,
+struct batadv_hard_iface *recv_if);
 
 unsigned char batadv_broadcast_addr[] = {0xff, 0xff, 0xff, 0xff, 0xff, 0xff};
 
@@ -540,8 +540,8 @@ batadv_recv_handler_register(u8 packet_type,
 int (*recv_handler)(struct sk_buff *,
 struct batadv_hard_iface *))
 {
-   int (*curr)(struct sk_buff *,
-   struct batadv_hard_iface *);
+   int (*curr)(struct sk_buff *skb,
+   struct batadv_hard_iface *recv_if);
curr = batadv_rx_handler[packet_type];
 
if (curr != batadv_recv_unhandled_packet &&
-- 
2.11.0