[v4,next,09/11] batman-adv: fix code style
Commit Message
- don't split lines if shorter than 80 chars
- don't use goto if there is no cleanup to perform
Introduced by 90ad6a40c80323805be1e86504385de2bd861f0a
("batman-adv: Modified forwarding behaviour for multicast packets")
Cc: Linux Lüssing <linus.luessing@web.de>
Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
---
multicast.c | 3 +--
multicast.h | 8 ++++----
translation-table.c | 5 ++---
3 files changed, 7 insertions(+), 9 deletions(-)
Comments
On Wednesday 19 March 2014 18:57:33 Antonio Quartulli wrote:
> - don't split lines if shorter than 80 chars
> - don't use goto if there is no cleanup to perform
>
> Introduced by 90ad6a40c80323805be1e86504385de2bd861f0a
> ("batman-adv: Modified forwarding behaviour for multicast packets")
>
> Cc: Linux Lüssing <linus.luessing@web.de>
> Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
> ---
> multicast.c | 3 +--
> multicast.h | 8 ++++----
> translation-table.c | 5 ++---
> 3 files changed, 7 insertions(+), 9 deletions(-)
Applied in revision bc45afd.
Thanks,
Marek
@@ -312,8 +312,7 @@ static int batadv_mcast_forw_mode_check_ipv6(struct batadv_priv *bat_priv,
/* TODO: Implement Multicast Router Discovery (RFC4286),
* then allow scope > link local, too
*/
- if (IPV6_ADDR_MC_SCOPE(&ip6hdr->daddr) !=
- IPV6_ADDR_SCOPE_LINKLOCAL)
+ if (IPV6_ADDR_MC_SCOPE(&ip6hdr->daddr) != IPV6_ADDR_SCOPE_LINKLOCAL)
return -EINVAL;
/* link-local-all-nodes multicast listeners behind a bridge are
@@ -20,10 +20,10 @@
/**
* batadv_forw_mode - the way a packet should be forwarded as
- * @BATADV_FORW_ALL: forward the packet to all nodes
- * (currently via classic flooding)
- * @BATADV_FORW_SINGLE: forward the packet to a single node
- * (currently via the BATMAN unicast routing protocol)
+ * @BATADV_FORW_ALL: forward the packet to all nodes (currently via classic
+ * flooding)
+ * @BATADV_FORW_SINGLE: forward the packet to a single node (currently via the
+ * BATMAN unicast routing protocol)
* @BATADV_FORW_NONE: don't forward, drop it
*/
enum batadv_forw_mode {
@@ -206,16 +206,15 @@ int batadv_tt_global_hash_count(struct batadv_priv *bat_priv,
const uint8_t *addr, unsigned short vid)
{
struct batadv_tt_global_entry *tt_global_entry;
- int count = 0;
+ int count;
tt_global_entry = batadv_tt_global_hash_find(bat_priv, addr, vid);
if (!tt_global_entry)
- goto out;
+ return 0;
count = atomic_read(&tt_global_entry->orig_list_count);
batadv_tt_global_entry_free_ref(tt_global_entry);
-out:
return count;
}