Hi,
it seems that checkpatch in linux-next has new checks. I would like to propose some patches that removes these problems from batman-adv. We have some patches for next and some for master. The master patches can only be applied after merging next (after the next patches are applied). There are still some merge conflicts. Therefore, I would like to send a bundle that can be used to merge my version (for checking purposes or to really apply the patches).
Here is an example how to use it:
$ git pull checkpatch.bundle master:master $ git pull checkpatch.bundle next:next
Regards, Sven
Signed-off-by: Sven Eckelmann sven@narfation.org --- bat_iv_ogm.c | 54 ++++++++++++------------------ bat_sysfs.c | 16 ++++---- gateway_client.c | 31 +++++++---------- gateway_common.c | 8 ++-- hard-interface.c | 36 +++++++-------------- icmp_socket.c | 12 ++---- main.c | 8 ++-- originator.c | 14 +++---- routing.c | 27 +++++++-------- send.c | 4 +- soft-interface.c | 15 ++++---- translation-table.c | 89 ++++++++++++++++++++++++-------------------------- 12 files changed, 137 insertions(+), 177 deletions(-)
diff --git a/bat_iv_ogm.c b/bat_iv_ogm.c index 2b66dae..677997b 100644 --- a/bat_iv_ogm.c +++ b/bat_iv_ogm.c @@ -132,8 +132,7 @@ static void bat_iv_ogm_send_to_if(struct forw_packet *forw_packet, "Sending own" : "Forwarding")); bat_dbg(DBG_BATMAN, bat_priv, - "%s %spacket (originator %pM, seqno %d, TQ %d, TTL %d," - " IDF %s, ttvn %d) on interface %s [%pM]\n", + "%s %spacket (originator %pM, seqno %d, TQ %d, TTL %d, IDF %s, ttvn %d) on interface %s [%pM]\n", fwd_str, (packet_num > 0 ? "aggregated " : ""), batman_ogm_packet->orig, ntohl(batman_ogm_packet->seqno), @@ -171,8 +170,7 @@ static void bat_iv_ogm_emit(struct forw_packet *forw_packet) directlink = (batman_ogm_packet->flags & DIRECTLINK ? 1 : 0);
if (!forw_packet->if_incoming) { - pr_err("Error - can't forward packet: incoming iface not " - "specified\n"); + pr_err("Error - can't forward packet: incoming iface not specified\n"); goto out; }
@@ -193,8 +191,7 @@ static void bat_iv_ogm_emit(struct forw_packet *forw_packet)
/* FIXME: what about aggregated packets ? */ bat_dbg(DBG_BATMAN, bat_priv, - "%s packet (originator %pM, seqno %d, TTL %d) " - "on interface %s [%pM]\n", + "%s packet (originator %pM, seqno %d, TTL %d) on interface %s [%pM]\n", (forw_packet->own ? "Sending own" : "Forwarding"), batman_ogm_packet->orig, ntohl(batman_ogm_packet->seqno), @@ -508,8 +505,7 @@ static void bat_iv_ogm_forward(struct orig_node *orig_node, batman_ogm_packet->tq = hop_penalty(batman_ogm_packet->tq, bat_priv);
bat_dbg(DBG_BATMAN, bat_priv, - "Forwarding packet: tq_orig: %i, tq_avg: %i, " - "tq_forw: %i, ttl_orig: %i, ttl_forw: %i\n", + "Forwarding packet: tq_orig: %i, tq_avg: %i, tq_forw: %i, ttl_orig: %i, ttl_forw: %i\n", in_tq, tq_avg, batman_ogm_packet->tq, in_ttl - 1, batman_ogm_packet->header.ttl);
@@ -589,8 +585,8 @@ static void bat_iv_ogm_orig_update(struct bat_priv *bat_priv, struct hlist_node *node; uint8_t bcast_own_sum_orig, bcast_own_sum_neigh;
- bat_dbg(DBG_BATMAN, bat_priv, "update_originator(): " - "Searching and updating originator entry of received packet\n"); + bat_dbg(DBG_BATMAN, bat_priv, + "update_originator(): Searching and updating originator entry of received packet\n");
rcu_read_lock(); hlist_for_each_entry_rcu(tmp_neigh_node, node, @@ -802,10 +798,7 @@ static int bat_iv_ogm_calc_tq(struct orig_node *orig_node, (TQ_MAX_VALUE * TQ_MAX_VALUE));
bat_dbg(DBG_BATMAN, bat_priv, - "bidirectional: " - "orig = %-15pM neigh = %-15pM => own_bcast = %2i, " - "real recv = %2i, local tq: %3i, asym_penalty: %3i, " - "total tq: %3i\n", + "bidirectional: orig = %-15pM neigh = %-15pM => own_bcast = %2i, real recv = %2i, local tq: %3i, asym_penalty: %3i, total tq: %3i\n", orig_node->orig, orig_neigh_node->orig, total_count, neigh_rq_count, tq_own, tq_asym_penalty, batman_ogm_packet->tq);
@@ -933,9 +926,7 @@ static void bat_iv_ogm_process(const struct ethhdr *ethhdr, batman_ogm_packet->orig) ? 1 : 0);
bat_dbg(DBG_BATMAN, bat_priv, - "Received BATMAN packet via NB: %pM, IF: %s [%pM] " - "(from OG: %pM, via prev OG: %pM, seqno %d, ttvn %u, " - "crc %u, changes %u, td %d, TTL %d, V %d, IDF %d)\n", + "Received BATMAN packet via NB: %pM, IF: %s [%pM] (from OG: %pM, via prev OG: %pM, seqno %d, ttvn %u, crc %u, changes %u, td %d, TTL %d, V %d, IDF %d)\n", ethhdr->h_source, if_incoming->net_dev->name, if_incoming->net_dev->dev_addr, batman_ogm_packet->orig, batman_ogm_packet->prev_sender, batman_ogm_packet->seqno, @@ -978,16 +969,15 @@ static void bat_iv_ogm_process(const struct ethhdr *ethhdr,
if (is_my_addr) { bat_dbg(DBG_BATMAN, bat_priv, - "Drop packet: received my own broadcast (sender: %pM" - ")\n", + "Drop packet: received my own broadcast (sender: %pM)\n", ethhdr->h_source); return; }
if (is_broadcast) { - bat_dbg(DBG_BATMAN, bat_priv, "Drop packet: " - "ignoring all packets with broadcast source addr (sender: %pM" - ")\n", ethhdr->h_source); + bat_dbg(DBG_BATMAN, bat_priv, + "Drop packet: ignoring all packets with broadcast source addr (sender: %pM)\n", + ethhdr->h_source); return; }
@@ -1017,16 +1007,16 @@ static void bat_iv_ogm_process(const struct ethhdr *ethhdr, spin_unlock_bh(&orig_neigh_node->ogm_cnt_lock); }
- bat_dbg(DBG_BATMAN, bat_priv, "Drop packet: " - "originator packet from myself (via neighbor)\n"); + bat_dbg(DBG_BATMAN, bat_priv, + "Drop packet: originator packet from myself (via neighbor)\n"); orig_node_free_ref(orig_neigh_node); return; }
if (is_my_oldorig) { bat_dbg(DBG_BATMAN, bat_priv, - "Drop packet: ignoring all rebroadcast echos (sender: " - "%pM)\n", ethhdr->h_source); + "Drop packet: ignoring all rebroadcast echos (sender: %pM)\n", + ethhdr->h_source); return; }
@@ -1039,8 +1029,8 @@ static void bat_iv_ogm_process(const struct ethhdr *ethhdr,
if (is_duplicate == -1) { bat_dbg(DBG_BATMAN, bat_priv, - "Drop packet: packet within seqno protection time " - "(sender: %pM)\n", ethhdr->h_source); + "Drop packet: packet within seqno protection time (sender: %pM)\n", + ethhdr->h_source); goto out; }
@@ -1061,8 +1051,8 @@ static void bat_iv_ogm_process(const struct ethhdr *ethhdr, batman_ogm_packet->prev_sender)) && (compare_eth(router->addr, router_router->addr))) { bat_dbg(DBG_BATMAN, bat_priv, - "Drop packet: ignoring all rebroadcast packets that " - "may make me loop (sender: %pM)\n", ethhdr->h_source); + "Drop packet: ignoring all rebroadcast packets that may make me loop (sender: %pM)\n", + ethhdr->h_source); goto out; }
@@ -1106,8 +1096,8 @@ static void bat_iv_ogm_process(const struct ethhdr *ethhdr, bat_iv_ogm_forward(orig_node, ethhdr, batman_ogm_packet, 1, if_incoming);
- bat_dbg(DBG_BATMAN, bat_priv, "Forwarding packet: " - "rebroadcast neighbor packet with direct link flag\n"); + bat_dbg(DBG_BATMAN, bat_priv, + "Forwarding packet: rebroadcast neighbor packet with direct link flag\n"); goto out_neigh; }
diff --git a/bat_sysfs.c b/bat_sysfs.c index b00101d..68ff759 100644 --- a/bat_sysfs.c +++ b/bat_sysfs.c @@ -255,8 +255,8 @@ static ssize_t store_vis_mode(struct kobject *kobj, struct attribute *attr, buff[count - 1] = '\0';
bat_info(net_dev, - "Invalid parameter for 'vis mode' setting received: " - "%s\n", buff); + "Invalid parameter for 'vis mode' setting received: %s\n", + buff); return -EINVAL; }
@@ -330,8 +330,8 @@ static ssize_t store_gw_mode(struct kobject *kobj, struct attribute *attr,
if (gw_mode_tmp < 0) { bat_info(net_dev, - "Invalid parameter for 'gw mode' setting received: " - "%s\n", buff); + "Invalid parameter for 'gw mode' setting received: %s\n", + buff); return -EINVAL; }
@@ -502,8 +502,8 @@ static ssize_t store_mesh_iface(struct kobject *kobj, struct attribute *attr, buff[count - 1] = '\0';
if (strlen(buff) >= IFNAMSIZ) { - pr_err("Invalid parameter for 'mesh_iface' setting received: " - "interface name too long '%s'\n", buff); + pr_err("Invalid parameter for 'mesh_iface' setting received: interface name too long '%s'\n", + buff); hardif_free_ref(hard_iface); return -EINVAL; } @@ -677,8 +677,8 @@ out: hardif_free_ref(primary_if);
if (ret) - bat_dbg(DBG_BATMAN, bat_priv, "Impossible to send " - "uevent for (%s,%s,%s) event (err: %d)\n", + bat_dbg(DBG_BATMAN, bat_priv, + "Impossible to send uevent for (%s,%s,%s) event (err: %d)\n", uev_type_str[type], uev_action_str[action], (action == UEV_DEL ? "NULL" : data), ret); return ret; diff --git a/gateway_client.c b/gateway_client.c index 0fa8e2d..6f9b9b7 100644 --- a/gateway_client.c +++ b/gateway_client.c @@ -224,16 +224,13 @@ void gw_election(struct bat_priv *bat_priv) } else if ((!curr_gw) && (next_gw)) { bat_dbg(DBG_BATMAN, bat_priv, "Adding route to gateway %pM (gw_flags: %i, tq: %i)\n", - next_gw->orig_node->orig, - next_gw->orig_node->gw_flags, + next_gw->orig_node->orig, next_gw->orig_node->gw_flags, router->tq_avg); throw_uevent(bat_priv, UEV_GW, UEV_ADD, gw_addr); } else { bat_dbg(DBG_BATMAN, bat_priv, - "Changing route to gateway %pM " - "(gw_flags: %i, tq: %i)\n", - next_gw->orig_node->orig, - next_gw->orig_node->gw_flags, + "Changing route to gateway %pM (gw_flags: %i, tq: %i)\n", + next_gw->orig_node->orig, next_gw->orig_node->gw_flags, router->tq_avg); throw_uevent(bat_priv, UEV_GW, UEV_CHANGE, gw_addr); } @@ -287,8 +284,7 @@ void gw_check_election(struct bat_priv *bat_priv, struct orig_node *orig_node) goto out;
bat_dbg(DBG_BATMAN, bat_priv, - "Restarting gateway selection: better gateway found (tq curr: " - "%i, tq new: %i)\n", + "Restarting gateway selection: better gateway found (tq curr: %i, tq new: %i)\n", gw_tq_avg, orig_tq_avg);
deselect: @@ -352,8 +348,7 @@ void gw_node_update(struct bat_priv *bat_priv, continue;
bat_dbg(DBG_BATMAN, bat_priv, - "Gateway class of originator %pM changed from " - "%i to %i\n", + "Gateway class of originator %pM changed from %i to %i\n", orig_node->orig, gw_node->orig_node->gw_flags, new_gwflags);
@@ -474,23 +469,23 @@ int gw_client_seq_print_text(struct seq_file *seq, void *offset)
primary_if = primary_if_get_selected(bat_priv); if (!primary_if) { - ret = seq_printf(seq, "BATMAN mesh %s disabled - please " - "specify interfaces to enable it\n", + ret = seq_printf(seq, + "BATMAN mesh %s disabled - please specify interfaces to enable it\n", net_dev->name); goto out; }
if (primary_if->if_status != IF_ACTIVE) { - ret = seq_printf(seq, "BATMAN mesh %s disabled - " - "primary interface not active\n", + ret = seq_printf(seq, + "BATMAN mesh %s disabled - primary interface not active\n", net_dev->name); goto out; }
- seq_printf(seq, " %-12s (%s/%i) %17s [%10s]: gw_class ... " - "[B.A.T.M.A.N. adv %s, MainIF/MAC: %s/%pM (%s)]\n", - "Gateway", "#", TQ_MAX_VALUE, "Nexthop", - "outgoingIF", SOURCE_VERSION, primary_if->net_dev->name, + seq_printf(seq, + " %-12s (%s/%i) %17s [%10s]: gw_class ... [B.A.T.M.A.N. adv %s, MainIF/MAC: %s/%pM (%s)]\n", + "Gateway", "#", TQ_MAX_VALUE, "Nexthop", "outgoingIF", + SOURCE_VERSION, primary_if->net_dev->name, primary_if->net_dev->dev_addr, net_dev->name);
rcu_read_lock(); diff --git a/gateway_common.c b/gateway_common.c index 3ccb9c8..ca57ac7 100644 --- a/gateway_common.c +++ b/gateway_common.c @@ -125,8 +125,8 @@ static bool parse_gw_bandwidth(struct net_device *net_dev, char *buff, ret = kstrtol(slash_ptr + 1, 10, &lup); if (ret) { bat_err(net_dev, - "Upload speed of gateway mode invalid: " - "%s\n", slash_ptr + 1); + "Upload speed of gateway mode invalid: %s\n", + slash_ptr + 1); return false; }
@@ -163,8 +163,8 @@ ssize_t gw_bandwidth_set(struct net_device *net_dev, char *buff, size_t count) gw_bandwidth_to_kbit((uint8_t)gw_bandwidth_tmp, &down, &up);
gw_deselect(bat_priv); - bat_info(net_dev, "Changing gateway bandwidth from: '%i' to: '%ld' " - "(propagating: %d%s/%d%s)\n", + bat_info(net_dev, + "Changing gateway bandwidth from: '%i' to: '%ld' (propagating: %d%s/%d%s)\n", atomic_read(&bat_priv->gw_bandwidth), gw_bandwidth_tmp, (down > 2048 ? down / 1024 : down), (down > 2048 ? "MBit" : "KBit"), diff --git a/hard-interface.c b/hard-interface.c index 409d027..3778977 100644 --- a/hard-interface.c +++ b/hard-interface.c @@ -175,11 +175,9 @@ static void check_known_mac_addr(const struct net_device *net_dev) net_dev->dev_addr)) continue;
- pr_warning("The newly added mac address (%pM) already exists " - "on: %s\n", net_dev->dev_addr, - hard_iface->net_dev->name); - pr_warning("It is strongly recommended to keep mac addresses " - "unique to avoid problems!\n"); + pr_warning("The newly added mac address (%pM) already exists on: %s\n", + net_dev->dev_addr, hard_iface->net_dev->name); + pr_warning("It is strongly recommended to keep mac addresses unique to avoid problems!\n"); } rcu_read_unlock(); } @@ -282,10 +280,7 @@ int hardif_enable_interface(struct hard_iface *hard_iface,
/* hard-interface is part of a bridge */ if (hard_iface->net_dev->priv_flags & IFF_BRIDGE_PORT) - pr_err("You are about to enable batman-adv on '%s' which " - "already is part of a bridge. Unless you know exactly " - "what you are doing this is probably wrong and won't " - "work the way you think it would.\n", + pr_err("You are about to enable batman-adv on '%s' which already is part of a bridge. Unless you know exactly what you are doing this is probably wrong and won't work the way you think it would.\n", hard_iface->net_dev->name);
soft_iface = dev_get_by_name(&init_net, iface_name); @@ -303,8 +298,7 @@ int hardif_enable_interface(struct hard_iface *hard_iface, }
if (!softif_is_valid(soft_iface)) { - pr_err("Can't create batman mesh interface %s: " - "already exists as regular interface\n", + pr_err("Can't create batman mesh interface %s: already exists as regular interface\n", soft_iface->name); dev_put(soft_iface); ret = -EINVAL; @@ -317,8 +311,9 @@ int hardif_enable_interface(struct hard_iface *hard_iface, bat_priv->bat_algo_ops->bat_ogm_init(hard_iface);
if (!hard_iface->packet_buff) { - bat_err(hard_iface->soft_iface, "Can't add interface packet " - "(%s): out of memory\n", hard_iface->net_dev->name); + bat_err(hard_iface->soft_iface, + "Can't add interface packet (%s): out of memory\n", + hard_iface->net_dev->name); ret = -ENOMEM; goto err; } @@ -341,29 +336,22 @@ int hardif_enable_interface(struct hard_iface *hard_iface, if (atomic_read(&bat_priv->fragmentation) && hard_iface->net_dev->mtu < ETH_DATA_LEN + BAT_HEADER_LEN) bat_info(hard_iface->soft_iface, - "The MTU of interface %s is too small (%i) to handle " - "the transport of batman-adv packets. Packets going " - "over this interface will be fragmented on layer2 " - "which could impact the performance. Setting the MTU " - "to %zi would solve the problem.\n", + "The MTU of interface %s is too small (%i) to handle the transport of batman-adv packets. Packets going over this interface will be fragmented on layer2 which could impact the performance. Setting the MTU to %zi would solve the problem.\n", hard_iface->net_dev->name, hard_iface->net_dev->mtu, ETH_DATA_LEN + BAT_HEADER_LEN);
if (!atomic_read(&bat_priv->fragmentation) && hard_iface->net_dev->mtu < ETH_DATA_LEN + BAT_HEADER_LEN) bat_info(hard_iface->soft_iface, - "The MTU of interface %s is too small (%i) to handle " - "the transport of batman-adv packets. If you " - "experience problems getting traffic through try " - "increasing the MTU to %zi.\n", + "The MTU of interface %s is too small (%i) to handle the transport of batman-adv packets. If you experience problems getting traffic through try increasing the MTU to %zi.\n", hard_iface->net_dev->name, hard_iface->net_dev->mtu, ETH_DATA_LEN + BAT_HEADER_LEN);
if (hardif_is_iface_up(hard_iface)) hardif_activate_interface(hard_iface); else - bat_err(hard_iface->soft_iface, "Not using interface %s " - "(retrying later): interface not active\n", + bat_err(hard_iface->soft_iface, + "Not using interface %s (retrying later): interface not active\n", hard_iface->net_dev->name);
/* begin scheduling originator messages on that interface */ diff --git a/icmp_socket.c b/icmp_socket.c index 9b755f9..b87518e 100644 --- a/icmp_socket.c +++ b/icmp_socket.c @@ -59,8 +59,7 @@ static int bat_socket_open(struct inode *inode, struct file *file) }
if (i == ARRAY_SIZE(socket_client_hash)) { - pr_err("Error - can't add another packet client: " - "maximum number of clients reached\n"); + pr_err("Error - can't add another packet client: maximum number of clients reached\n"); kfree(socket_client); return -EXFULL; } @@ -162,8 +161,7 @@ static ssize_t bat_socket_write(struct file *file, const char __user *buff,
if (len < sizeof(struct icmp_packet)) { bat_dbg(DBG_BATMAN, bat_priv, - "Error - can't send packet from char device: " - "invalid packet size\n"); + "Error - can't send packet from char device: invalid packet size\n"); return -EINVAL; }
@@ -193,16 +191,14 @@ static ssize_t bat_socket_write(struct file *file, const char __user *buff,
if (icmp_packet->header.packet_type != BAT_ICMP) { bat_dbg(DBG_BATMAN, bat_priv, - "Error - can't send packet from char device: " - "got bogus packet type (expected: BAT_ICMP)\n"); + "Error - can't send packet from char device: got bogus packet type (expected: BAT_ICMP)\n"); len = -EINVAL; goto free_skb; }
if (icmp_packet->msg_type != ECHO_REQUEST) { bat_dbg(DBG_BATMAN, bat_priv, - "Error - can't send packet from char device: " - "got bogus message type (expected: ECHO_REQUEST)\n"); + "Error - can't send packet from char device: got bogus message type (expected: ECHO_REQUEST)\n"); len = -EINVAL; goto free_skb; } diff --git a/main.c b/main.c index 08f3b3a..6d51caa 100644 --- a/main.c +++ b/main.c @@ -64,8 +64,8 @@ static int __init batman_init(void)
register_netdevice_notifier(&hard_if_notifier);
- pr_info("B.A.T.M.A.N. advanced %s (compatibility version %i) " - "loaded\n", SOURCE_VERSION, COMPAT_VERSION); + pr_info("B.A.T.M.A.N. advanced %s (compatibility version %i) loaded\n", + SOURCE_VERSION, COMPAT_VERSION);
return 0; } @@ -201,8 +201,8 @@ int bat_algo_register(struct bat_algo_ops *bat_algo_ops)
bat_algo_ops_tmp = bat_algo_get(bat_algo_ops->name); if (bat_algo_ops_tmp) { - pr_info("Trying to register already registered routing " - "algorithm: %s\n", bat_algo_ops->name); + pr_info("Trying to register already registered routing algorithm: %s\n", + bat_algo_ops->name); goto out; }
diff --git a/originator.c b/originator.c index 371cc93..43c0a4f 100644 --- a/originator.c +++ b/originator.c @@ -294,14 +294,12 @@ static bool purge_orig_neighbors(struct bat_priv *bat_priv, (neigh_node->if_incoming->if_status == IF_TO_BE_REMOVED)) bat_dbg(DBG_BATMAN, bat_priv, - "neighbor purge: originator %pM, " - "neighbor: %pM, iface: %s\n", + "neighbor purge: originator %pM, neighbor: %pM, iface: %s\n", orig_node->orig, neigh_node->addr, neigh_node->if_incoming->net_dev->name); else bat_dbg(DBG_BATMAN, bat_priv, - "neighbor timeout: originator %pM, " - "neighbor: %pM, last_valid: %lu\n", + "neighbor timeout: originator %pM, neighbor: %pM, last_valid: %lu\n", orig_node->orig, neigh_node->addr, (neigh_node->last_valid / HZ));
@@ -416,15 +414,15 @@ int orig_seq_print_text(struct seq_file *seq, void *offset) primary_if = primary_if_get_selected(bat_priv);
if (!primary_if) { - ret = seq_printf(seq, "BATMAN mesh %s disabled - " - "please specify interfaces to enable it\n", + ret = seq_printf(seq, + "BATMAN mesh %s disabled - please specify interfaces to enable it\n", net_dev->name); goto out; }
if (primary_if->if_status != IF_ACTIVE) { - ret = seq_printf(seq, "BATMAN mesh %s " - "disabled - primary interface not active\n", + ret = seq_printf(seq, + "BATMAN mesh %s disabled - primary interface not active\n", net_dev->name); goto out; } diff --git a/routing.c b/routing.c index f535155..01b66d4 100644 --- a/routing.c +++ b/routing.c @@ -83,8 +83,7 @@ static void _update_route(struct bat_priv *bat_priv, /* route changed */ } else if (neigh_node && curr_router) { bat_dbg(DBG_ROUTES, bat_priv, - "Changing route towards: %pM " - "(now via %pM - was via %pM)\n", + "Changing route towards: %pM (now via %pM - was via %pM)\n", orig_node->orig, neigh_node->addr, curr_router->addr); } @@ -345,9 +344,8 @@ static int recv_icmp_ttl_exceeded(struct bat_priv *bat_priv,
/* send TTL exceeded if packet is an echo request (traceroute) */ if (icmp_packet->msg_type != ECHO_REQUEST) { - pr_debug("Warning - can't forward icmp packet from %pM to " - "%pM: ttl exceeded\n", icmp_packet->orig, - icmp_packet->dst); + pr_debug("Warning - can't forward icmp packet from %pM to %pM: ttl exceeded\n", + icmp_packet->orig, icmp_packet->dst); goto out; }
@@ -674,9 +672,9 @@ int recv_roam_adv(struct sk_buff *skb, struct hard_iface *recv_if) if (!orig_node) goto out;
- bat_dbg(DBG_TT, bat_priv, "Received ROAMING_ADV from %pM " - "(client %pM)\n", roam_adv_packet->src, - roam_adv_packet->client); + bat_dbg(DBG_TT, bat_priv, + "Received ROAMING_ADV from %pM (client %pM)\n", + roam_adv_packet->src, roam_adv_packet->client);
tt_global_add(bat_priv, orig_node, roam_adv_packet->client, atomic_read(&orig_node->last_ttvn) + 1, true, false); @@ -813,9 +811,8 @@ int route_unicast_packet(struct sk_buff *skb, struct hard_iface *recv_if)
/* TTL exceeded */ if (unicast_packet->header.ttl < 2) { - pr_debug("Warning - can't forward unicast packet from %pM to " - "%pM: ttl exceeded\n", ethhdr->h_source, - unicast_packet->dest); + pr_debug("Warning - can't forward unicast packet from %pM to %pM: ttl exceeded\n", + ethhdr->h_source, unicast_packet->dest); goto out; }
@@ -934,10 +931,10 @@ static int check_unicast_ttvn(struct bat_priv *bat_priv, orig_node_free_ref(orig_node); }
- bat_dbg(DBG_ROUTES, bat_priv, "TTVN mismatch (old_ttvn %u " - "new_ttvn %u)! Rerouting unicast packet (for %pM) to " - "%pM\n", unicast_packet->ttvn, curr_ttvn, - ethhdr->h_dest, unicast_packet->dest); + bat_dbg(DBG_ROUTES, bat_priv, + "TTVN mismatch (old_ttvn %u new_ttvn %u)! Rerouting unicast packet (for %pM) to %pM\n", + unicast_packet->ttvn, curr_ttvn, ethhdr->h_dest, + unicast_packet->dest);
unicast_packet->ttvn = curr_ttvn; } diff --git a/send.c b/send.c index 4137580..f261ccf 100644 --- a/send.c +++ b/send.c @@ -45,8 +45,8 @@ int send_skb_packet(struct sk_buff *skb, struct hard_iface *hard_iface, goto send_skb_err;
if (!(hard_iface->net_dev->flags & IFF_UP)) { - pr_warning("Interface %s is not up - can't send packet via " - "that interface!\n", hard_iface->net_dev->name); + pr_warning("Interface %s is not up - can't send packet via that interface!\n", + hard_iface->net_dev->name); goto send_skb_err; }
diff --git a/soft-interface.c b/soft-interface.c index 8fb16d2..a5590f4 100644 --- a/soft-interface.c +++ b/soft-interface.c @@ -252,8 +252,8 @@ static void softif_neigh_vid_select(struct bat_priv *bat_priv, vid, curr_neigh->addr); else if ((curr_neigh) && (new_neigh)) bat_dbg(DBG_ROUTES, bat_priv, - "Changing mesh exit point on vid: %d from %pM " - "to %pM.\n", vid, curr_neigh->addr, new_neigh->addr); + "Changing mesh exit point on vid: %d from %pM to %pM.\n", + vid, curr_neigh->addr, new_neigh->addr); else if ((!curr_neigh) && (new_neigh)) bat_dbg(DBG_ROUTES, bat_priv, "Setting mesh exit point on vid: %d to %pM.\n", @@ -327,15 +327,15 @@ int softif_neigh_seq_print_text(struct seq_file *seq, void *offset)
primary_if = primary_if_get_selected(bat_priv); if (!primary_if) { - ret = seq_printf(seq, "BATMAN mesh %s disabled - " - "please specify interfaces to enable it\n", + ret = seq_printf(seq, + "BATMAN mesh %s disabled - please specify interfaces to enable it\n", net_dev->name); goto out; }
if (primary_if->if_status != IF_ACTIVE) { - ret = seq_printf(seq, "BATMAN mesh %s " - "disabled - primary interface not active\n", + ret = seq_printf(seq, + "BATMAN mesh %s disabled - primary interface not active\n", net_dev->name); goto out; } @@ -403,8 +403,7 @@ void softif_neigh_purge(struct bat_priv *bat_priv)
if (curr_softif_neigh == softif_neigh) { bat_dbg(DBG_ROUTES, bat_priv, - "Current mesh exit point on vid: %d " - "'%pM' vanished.\n", + "Current mesh exit point on vid: %d '%pM' vanished.\n", softif_neigh_vid->vid, softif_neigh->addr); do_deselect = 1; diff --git a/translation-table.c b/translation-table.c index c950705..1f86921 100644 --- a/translation-table.c +++ b/translation-table.c @@ -309,21 +309,21 @@ int tt_local_seq_print_text(struct seq_file *seq, void *offset)
primary_if = primary_if_get_selected(bat_priv); if (!primary_if) { - ret = seq_printf(seq, "BATMAN mesh %s disabled - " - "please specify interfaces to enable it\n", + ret = seq_printf(seq, + "BATMAN mesh %s disabled - please specify interfaces to enable it\n", net_dev->name); goto out; }
if (primary_if->if_status != IF_ACTIVE) { - ret = seq_printf(seq, "BATMAN mesh %s disabled - " - "primary interface not active\n", + ret = seq_printf(seq, + "BATMAN mesh %s disabled - primary interface not active\n", net_dev->name); goto out; }
- seq_printf(seq, "Locally retrieved addresses (from %s) " - "announced via TT (TTVN: %u):\n", + seq_printf(seq, + "Locally retrieved addresses (from %s) announced via TT (TTVN: %u):\n", net_dev->name, (uint8_t)atomic_read(&bat_priv->ttvn));
for (i = 0; i < hash->size; i++) { @@ -365,8 +365,9 @@ static void tt_local_set_pending(struct bat_priv *bat_priv, * response issued before the net ttvn increment (consistency check) */ tt_local_entry->common.flags |= TT_CLIENT_PENDING;
- bat_dbg(DBG_TT, bat_priv, "Local tt entry (%pM) pending to be removed: " - "%s\n", tt_local_entry->common.addr, message); + bat_dbg(DBG_TT, bat_priv, + "Local tt entry (%pM) pending to be removed: %s\n", + tt_local_entry->common.addr, message); }
void tt_local_remove(struct bat_priv *bat_priv, const uint8_t *addr, @@ -574,15 +575,15 @@ int tt_global_seq_print_text(struct seq_file *seq, void *offset)
primary_if = primary_if_get_selected(bat_priv); if (!primary_if) { - ret = seq_printf(seq, "BATMAN mesh %s disabled - please " - "specify interfaces to enable it\n", + ret = seq_printf(seq, + "BATMAN mesh %s disabled - please specify interfaces to enable it\n", net_dev->name); goto out; }
if (primary_if->if_status != IF_ACTIVE) { - ret = seq_printf(seq, "BATMAN mesh %s disabled - " - "primary interface not active\n", + ret = seq_printf(seq, + "BATMAN mesh %s disabled - primary interface not active\n", net_dev->name); goto out; } @@ -602,18 +603,18 @@ int tt_global_seq_print_text(struct seq_file *seq, void *offset) tt_global_entry = container_of(tt_common_entry, struct tt_global_entry, common); - seq_printf(seq, " * %pM (%3u) via %pM (%3u) " - "[%c%c]\n", - tt_global_entry->common.addr, - tt_global_entry->ttvn, - tt_global_entry->orig_node->orig, - (uint8_t) atomic_read( + seq_printf(seq, + " * %pM (%3u) via %pM (%3u) [%c%c]\n", + tt_global_entry->common.addr, + tt_global_entry->ttvn, + tt_global_entry->orig_node->orig, + (uint8_t) atomic_read( &tt_global_entry->orig_node-> last_ttvn), - (tt_global_entry->common.flags & - TT_CLIENT_ROAM ? 'R' : '.'), - (tt_global_entry->common.flags & - TT_CLIENT_WIFI ? 'W' : '.')); + (tt_global_entry->common.flags & + TT_CLIENT_ROAM ? 'R' : '.'), + (tt_global_entry->common.flags & + TT_CLIENT_WIFI ? 'W' : '.')); } rcu_read_unlock(); } @@ -710,8 +711,7 @@ void tt_global_del_orig(struct bat_priv *bat_priv, common); if (tt_global_entry->orig_node == orig_node) { bat_dbg(DBG_TT, bat_priv, - "Deleting global tt entry %pM " - "(via %pM): %s\n", + "Deleting global tt entry %pM (via %pM): %s\n", tt_global_entry->common.addr, tt_global_entry->orig_node->orig, message); @@ -751,8 +751,8 @@ static void tt_global_roam_purge(struct bat_priv *bat_priv) TT_CLIENT_ROAM_TIMEOUT)) continue;
- bat_dbg(DBG_TT, bat_priv, "Deleting global " - "tt entry (%pM): Roaming timeout\n", + bat_dbg(DBG_TT, bat_priv, + "Deleting global tt entry (%pM): Roaming timeout\n", tt_global_entry->common.addr); atomic_dec(&tt_global_entry->orig_node->tt_size); hlist_del_rcu(node); @@ -1134,8 +1134,9 @@ static int send_tt_request(struct bat_priv *bat_priv, if (!neigh_node) goto out;
- bat_dbg(DBG_TT, bat_priv, "Sending TT_REQUEST to %pM via %pM " - "[%c]\n", dst_orig_node->orig, neigh_node->addr, + bat_dbg(DBG_TT, bat_priv, + "Sending TT_REQUEST to %pM via %pM [%c]\n", + dst_orig_node->orig, neigh_node->addr, (full_table ? 'F' : '.'));
send_skb_packet(skb, neigh_node->if_incoming, neigh_node->addr); @@ -1172,9 +1173,8 @@ static bool send_other_tt_response(struct bat_priv *bat_priv, struct tt_query_packet *tt_response;
bat_dbg(DBG_TT, bat_priv, - "Received TT_REQUEST from %pM for " - "ttvn: %u (%pM) [%c]\n", tt_request->src, - tt_request->ttvn, tt_request->dst, + "Received TT_REQUEST from %pM for ttvn: %u (%pM) [%c]\n", + tt_request->src, tt_request->ttvn, tt_request->dst, (tt_request->flags & TT_FULL_TABLE ? 'F' : '.'));
/* Let's get the orig node of the REAL destination */ @@ -1299,9 +1299,8 @@ static bool send_my_tt_response(struct bat_priv *bat_priv, struct tt_query_packet *tt_response;
bat_dbg(DBG_TT, bat_priv, - "Received TT_REQUEST from %pM for " - "ttvn: %u (me) [%c]\n", tt_request->src, - tt_request->ttvn, + "Received TT_REQUEST from %pM for ttvn: %u (me) [%c]\n", + tt_request->src, tt_request->ttvn, (tt_request->flags & TT_FULL_TABLE ? 'F' : '.'));
@@ -1504,10 +1503,9 @@ void handle_tt_response(struct bat_priv *bat_priv, struct tt_req_node *node, *safe; struct orig_node *orig_node = NULL;
- bat_dbg(DBG_TT, bat_priv, "Received TT_RESPONSE from %pM for " - "ttvn %d t_size: %d [%c]\n", - tt_response->src, tt_response->ttvn, - tt_response->tt_data, + bat_dbg(DBG_TT, bat_priv, + "Received TT_RESPONSE from %pM for ttvn %d t_size: %d [%c]\n", + tt_response->src, tt_response->ttvn, tt_response->tt_data, (tt_response->flags & TT_FULL_TABLE ? 'F' : '.'));
orig_node = orig_hash_find(bat_priv, tt_response->src); @@ -1771,8 +1769,9 @@ static void tt_local_purge_pending_clients(struct bat_priv *bat_priv) if (!(tt_common_entry->flags & TT_CLIENT_PENDING)) continue;
- bat_dbg(DBG_TT, bat_priv, "Deleting local tt entry " - "(%pM): pending\n", tt_common_entry->addr); + bat_dbg(DBG_TT, bat_priv, + "Deleting local tt entry (%pM): pending\n", + tt_common_entry->addr);
atomic_dec(&bat_priv->num_local_tt); hlist_del_rcu(node); @@ -1877,12 +1876,10 @@ void tt_update_orig(struct bat_priv *bat_priv, struct orig_node *orig_node, if (!orig_node->tt_initialised || ttvn != orig_ttvn || orig_node->tt_crc != tt_crc) { request_table: - bat_dbg(DBG_TT, bat_priv, "TT inconsistency for %pM. " - "Need to retrieve the correct information " - "(ttvn: %u last_ttvn: %u crc: %u last_crc: " - "%u num_changes: %u)\n", orig_node->orig, ttvn, - orig_ttvn, tt_crc, orig_node->tt_crc, - tt_num_changes); + bat_dbg(DBG_TT, bat_priv, + "TT inconsistency for %pM. Need to retrieve the correct information (ttvn: %u last_ttvn: %u crc: %u last_crc: %u num_changes: %u)\n", + orig_node->orig, ttvn, orig_ttvn, tt_crc, + orig_node->tt_crc, tt_num_changes); send_tt_request(bat_priv, orig_node, ttvn, tt_crc, full_table); return;
Signed-off-by: Sven Eckelmann sven@narfation.org --- bat_iv_ogm.c | 3 +-- main.h | 13 ++----------- 2 files changed, 3 insertions(+), 13 deletions(-)
diff --git a/bat_iv_ogm.c b/bat_iv_ogm.c index 677997b..a6d5d63 100644 --- a/bat_iv_ogm.c +++ b/bat_iv_ogm.c @@ -779,8 +779,7 @@ static int bat_iv_ogm_calc_tq(struct orig_node *orig_node, * information */ tq_own = (TQ_MAX_VALUE * total_count) / neigh_rq_count;
- /* - * 1 - ((1-x) ** 3), normalized to TQ_MAX_VALUE this does + /* 1 - ((1-x) ** 3), normalized to TQ_MAX_VALUE this does * affect the nearly-symmetric links only a little, but * punishes asymmetric links more. This will give a value * between 0 and TQ_MAX_VALUE diff --git a/main.h b/main.h index 3b727dd..95cb2af 100644 --- a/main.h +++ b/main.h @@ -107,9 +107,7 @@ enum uev_type {
#define GW_THRESHOLD 50
-/* - * Debug Messages - */ +/* Debug Messages */ #ifdef pr_fmt #undef pr_fmt #endif @@ -124,14 +122,7 @@ enum dbg_level { DBG_ALL = 7 };
- -/* - * Vis - */ - -/* - * Kernel headers - */ +/* Kernel headers */
#include <linux/mutex.h> /* mutex */ #include <linux/module.h> /* needed by all modules */
On Wednesday, March 07, 2012 16:07:46 Sven Eckelmann wrote:
Signed-off-by: Sven Eckelmann sven@narfation.org
bat_iv_ogm.c | 3 +-- main.h | 13 ++----------- 2 files changed, 3 insertions(+), 13 deletions(-)
Applied in revision 03abca2.
Thanks, Marek
Signed-off-by: Sven Eckelmann sven@narfation.org --- routing.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/routing.c b/routing.c index 01b66d4..7f8e158 100644 --- a/routing.c +++ b/routing.c @@ -237,8 +237,9 @@ int window_protected(struct bat_priv *bat_priv, int32_t seq_num_diff, "old packet received, start protection\n");
return 0; - } else + } else { return 1; + } } return 0; }
On Wednesday, March 07, 2012 16:07:47 Sven Eckelmann wrote:
Signed-off-by: Sven Eckelmann sven@narfation.org
routing.c | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-)
Applied in revision 2ae8b3d.
Thanks, Marek
Signed-off-by: Sven Eckelmann sven@narfation.org --- send.c | 2 +- unicast.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/send.c b/send.c index f261ccf..af7a674 100644 --- a/send.c +++ b/send.c @@ -56,7 +56,7 @@ int send_skb_packet(struct sk_buff *skb, struct hard_iface *hard_iface,
skb_reset_mac_header(skb);
- ethhdr = (struct ethhdr *) skb_mac_header(skb); + ethhdr = (struct ethhdr *)skb_mac_header(skb); memcpy(ethhdr->h_source, hard_iface->net_dev->dev_addr, ETH_ALEN); memcpy(ethhdr->h_dest, dst_addr, ETH_ALEN); ethhdr->h_proto = __constant_htons(ETH_P_BATMAN); diff --git a/unicast.c b/unicast.c index 0897dfa..676f6a6 100644 --- a/unicast.c +++ b/unicast.c @@ -66,7 +66,7 @@ static struct sk_buff *frag_merge_packet(struct list_head *head, kfree_skb(tmp_skb);
memmove(skb->data + uni_diff, skb->data, hdr_len); - unicast_packet = (struct unicast_packet *) skb_pull(skb, uni_diff); + unicast_packet = (struct unicast_packet *)skb_pull(skb, uni_diff); unicast_packet->header.packet_type = BAT_UNICAST;
return skb; @@ -238,7 +238,7 @@ int frag_send_skb(struct sk_buff *skb, struct bat_priv *bat_priv, goto dropped; skb_reserve(frag_skb, ucf_hdr_len);
- unicast_packet = (struct unicast_packet *) skb->data; + unicast_packet = (struct unicast_packet *)skb->data; memcpy(&tmp_uc, unicast_packet, uc_hdr_len); skb_split(skb, frag_skb, data_len / 2 + uc_hdr_len);
On Wednesday, March 07, 2012 16:07:48 Sven Eckelmann wrote:
Signed-off-by: Sven Eckelmann sven@narfation.org
send.c | 2 +- unicast.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
Applied in revision f3dcc0d.
Thanks, Marek
Signed-off-by: Sven Eckelmann sven@narfation.org --- bridge_loop_avoidance.c | 49 ++++++++++++++++++++-------------------------- distributed-arp-table.c | 36 ++++++++++++++++++---------------- translation-table.c | 5 +-- 3 files changed, 42 insertions(+), 48 deletions(-)
diff --git a/bridge_loop_avoidance.c b/bridge_loop_avoidance.c index c191c18..274d93a 100644 --- a/bridge_loop_avoidance.c +++ b/bridge_loop_avoidance.c @@ -375,8 +375,8 @@ static struct backbone_gw *bla_get_backbone_gw(struct bat_priv *bat_priv, return entry;
bat_dbg(DBG_BLA, bat_priv, - "bla_get_backbone_gw(): not found (%pM, %d)," - " creating new entry\n", orig, vid); + "bla_get_backbone_gw(): not found (%pM, %d), creating new entry\n", + orig, vid);
entry = kzalloc(sizeof(*entry), GFP_ATOMIC); if (!entry) @@ -449,8 +449,7 @@ static void bla_answer_request(struct bat_priv *bat_priv, int i;
bat_dbg(DBG_BLA, bat_priv, - "bla_answer_request(): received a " - "claim request, send all of our own claims again\n"); + "bla_answer_request(): received a claim request, send all of our own claims again\n");
backbone_gw = backbone_hash_find(bat_priv, primary_if->net_dev->dev_addr, vid); @@ -643,16 +642,14 @@ static int handle_announce(struct bat_priv *bat_priv, crc = ntohs(*((uint16_t *) (&an_addr[4])));
bat_dbg(DBG_BLA, bat_priv, - "handle_announce(): ANNOUNCE vid %d (sent " - "by %pM)... CRC = %04x\n", + "handle_announce(): ANNOUNCE vid %d (sent by %pM)... CRC = %04x\n", vid, backbone_gw->orig, crc);
if (backbone_gw->crc != crc) { bat_dbg(DBG_BLA, backbone_gw->bat_priv, - "handle_announce(): CRC FAILED for %pM/%d" - "(my = %04x, sent = %04x)\n", - backbone_gw->orig, backbone_gw->vid, - backbone_gw->crc, crc); + "handle_announce(): CRC FAILED for %pM/%d (my = %04x, sent = %04x)\n", + backbone_gw->orig, backbone_gw->vid, backbone_gw->crc, + crc);
bla_send_request(backbone_gw); } else { @@ -684,8 +681,7 @@ static int handle_request(struct bat_priv *bat_priv, return 1;
bat_dbg(DBG_BLA, bat_priv, - "handle_request(): REQUEST vid %d (sent " - "by %pM)...\n", + "handle_request(): REQUEST vid %d (sent by %pM)...\n", vid, ethhdr->h_source);
bla_answer_request(bat_priv, primary_if, vid); @@ -711,8 +707,7 @@ static int handle_unclaim(struct bat_priv *bat_priv, return 1;
/* this must be an UNCLAIM frame */ - bat_dbg(DBG_BLA, bat_priv, "handle_unclaim():" - "UNCLAIM %pM on vid %d (sent by %pM)...\n", + bat_dbg(DBG_BLA, bat_priv, "handle_unclaim(): UNCLAIM %pM on vid %d (sent by %pM)...\n", claim_addr, vid, backbone_gw->orig);
bla_del_claim(bat_priv, claim_addr, vid); @@ -890,9 +885,8 @@ static int bla_process_claim(struct bat_priv *bat_priv, /* check if it is a claim frame. */ ret = check_claim_group(bat_priv, primary_if, hw_src, hw_dst, ethhdr); if (ret == 1) - bat_dbg(DBG_BLA, bat_priv, "bla_process_claim(): received " - "a claim frame from another group. From: " - "%pM on vid %d ...(hw_src %pM, hw_dst %pM)\n", + bat_dbg(DBG_BLA, bat_priv, + "bla_process_claim(): received a claim frame from another group. From: %pM on vid %d ...(hw_src %pM, hw_dst %pM)\n", ethhdr->h_source, vid, hw_src, hw_dst);
if (ret < 2) @@ -924,9 +918,8 @@ static int bla_process_claim(struct bat_priv *bat_priv, break; }
- bat_dbg(DBG_BLA, bat_priv, "bla_process_claim(): ERROR - this looks" - "like a claim frame, but is useless. eth src" - "%pM on vid %d ...(hw_src %pM, hw_dst %pM)\n", + bat_dbg(DBG_BLA, bat_priv, + "bla_process_claim(): ERROR - this looks like a claim frame, but is useless. eth src %pM on vid %d ...(hw_src %pM, hw_dst %pM)\n", ethhdr->h_source, vid, hw_src, hw_dst); return 1; } @@ -962,8 +955,8 @@ static void bla_purge_backbone_gw(struct bat_priv *bat_priv, int now) continue;
bat_dbg(DBG_BLA, backbone_gw->bat_priv, - "bla_purge_backbone_gw(): backbone gw %pM" - " timed out\n", backbone_gw->orig); + "bla_purge_backbone_gw(): backbone gw %pM timed out\n", + backbone_gw->orig);
purge_now: /* don't wait for the pending request anymore */ @@ -1551,21 +1544,21 @@ int bla_claim_table_seq_print_text(struct seq_file *seq, void *offset)
primary_if = primary_if_get_selected(bat_priv); if (!primary_if) { - ret = seq_printf(seq, "BATMAN mesh %s disabled - please " - "specify interfaces to enable it\n", + ret = seq_printf(seq, + "BATMAN mesh %s disabled - please specify interfaces to enable it\n", net_dev->name); goto out; }
if (primary_if->if_status != IF_ACTIVE) { - ret = seq_printf(seq, "BATMAN mesh %s disabled - " - "primary interface not active\n", + ret = seq_printf(seq, + "BATMAN mesh %s disabled - primary interface not active\n", net_dev->name); goto out; }
- seq_printf(seq, "Claims announced for the mesh %s " - "(orig %pM, group id %04x)\n", + seq_printf(seq, + "Claims announced for the mesh %s (orig %pM, group id %04x)\n", net_dev->name, primary_if->net_dev->dev_addr, ntohs(bat_priv->claim_dest.group)); seq_printf(seq, " %-17s %-5s %-17s [o] (%-4s)\n", diff --git a/distributed-arp-table.c b/distributed-arp-table.c index 8a20961..114db0a 100644 --- a/distributed-arp-table.c +++ b/distributed-arp-table.c @@ -56,12 +56,12 @@ static void bat_dbg_arp(struct bat_priv *bat_priv, struct sk_buff *skb,
switch (unicast_4addr_packet->u.header.packet_type) { case BAT_UNICAST: - bat_dbg(DBG_DAT, bat_priv, "* encapsulated within a UNICAST " - "packet\n"); + bat_dbg(DBG_DAT, bat_priv, + "* encapsulated within a UNICAST packet\n"); break; case BAT_UNICAST_4ADDR: - bat_dbg(DBG_DAT, bat_priv, "* encapsulated within a " - "UNICAST_4ADDR packet (src: %pM)\n", + bat_dbg(DBG_DAT, bat_priv, + "* encapsulated within a UNICAST_4ADDR packet (src: %pM)\n", unicast_4addr_packet->src); switch (unicast_4addr_packet->subtype) { case BAT_P_DAT_DHT_PUT: @@ -81,13 +81,13 @@ static void bat_dbg_arp(struct bat_priv *bat_priv, struct sk_buff *skb, } break; case BAT_BCAST: - bat_dbg(DBG_DAT, bat_priv, "* encapsulated within a BCAST " - "packet (src: %pM)\n", + bat_dbg(DBG_DAT, bat_priv, + "* encapsulated within a BCAST packet (src: %pM)\n", ((struct bcast_packet *)unicast_4addr_packet)->orig); break; default: - bat_dbg(DBG_DAT, bat_priv, "* encapsulated within an unknown " - "packet type (0x%x)\n", + bat_dbg(DBG_DAT, bat_priv, + "* encapsulated within an unknown packet type (0x%x)\n", unicast_4addr_packet->u.header.packet_type); } } @@ -177,9 +177,10 @@ static void choose_next_candidate(struct bat_priv *bat_priv, if (max_orig_node) { cands[select].type = DHT_CANDIDATE_ORIG; cands[select].orig_node = max_orig_node; - bat_dbg(DBG_DAT, bat_priv, "dht_select_candidates() %d: " - "selected %pM addr=%u dist=%u\n", select, - max_orig_node->orig, max_orig_node->dht_addr, max); + bat_dbg(DBG_DAT, bat_priv, + "dht_select_candidates() %d: selected %pM addr=%u dist=%u\n", + select, max_orig_node->orig, max_orig_node->dht_addr, + max); } *last_max = max; } @@ -206,8 +207,9 @@ static struct dht_candidate *dht_select_candidates(struct bat_priv *bat_priv,
ip_key = (dat_addr_t)hash_ipv4(&ip_dst, DAT_ADDR_MAX);
- bat_dbg(DBG_DAT, bat_priv, "dht_select_candidates(): IP=%pI4 " - "hash(IP)=%u\n", &ip_dst, ip_key); + bat_dbg(DBG_DAT, bat_priv, + "dht_select_candidates(): IP=%pI4 hash(IP)=%u\n", &ip_dst, + ip_key);
for (select = 0; select < DHT_CANDIDATES_NUM; select++) choose_next_candidate(bat_priv, res, select, ip_key, &last_max); @@ -547,8 +549,8 @@ bool dat_drop_broadcast_packet(struct bat_priv *bat_priv, forw_packet->if_incoming->soft_iface); /* check if we already know this neigh */ if (n && (n->nud_state & NUD_CONNECTED)) { - bat_dbg(DBG_DAT, bat_priv, "ARP Request for %pI4: " - "fallback prevented\n", + bat_dbg(DBG_DAT, bat_priv, + "ARP Request for %pI4: fallback prevented\n", &ARP_IP_DST(forw_packet->skb, sizeof(struct bcast_packet))); return true; @@ -565,8 +567,8 @@ void arp_change_timeout(struct net_device *soft_iface, const char *name) { struct in_device *in_dev = in_dev_get(soft_iface); if (!in_dev) { - pr_err("Unable to set ARP parameters for the batman interface " - "'%s'\n", name); + pr_err("Unable to set ARP parameters for the batman interface '%s'\n", + name); return; }
diff --git a/translation-table.c b/translation-table.c index 7dbf127..8e4964b 100644 --- a/translation-table.c +++ b/translation-table.c @@ -657,9 +657,8 @@ static void tt_global_print_entry(struct tt_global_entry *tt_global_entry, hlist_for_each_entry_rcu(orig_entry, node, head, list) { flags = tt_common_entry->flags; last_ttvn = atomic_read(&orig_entry->orig_node->last_ttvn); - seq_printf(seq, " * %pM (%3u) via %pM (%3u) " - "[%c%c]\n", tt_global_entry->common.addr, - orig_entry->ttvn, + seq_printf(seq, " * %pM (%3u) via %pM (%3u) [%c%c]\n", + tt_global_entry->common.addr, orig_entry->ttvn, orig_entry->orig_node->orig, last_ttvn, (flags & TT_CLIENT_ROAM ? 'R' : '.'), (flags & TT_CLIENT_WIFI ? 'W' : '.'));
On Wednesday, March 07, 2012 16:07:49 Sven Eckelmann wrote:
Signed-off-by: Sven Eckelmann sven@narfation.org
bridge_loop_avoidance.c | 49 ++++++++++++++++++++-------------------------- distributed-arp-table.c | 36 ++++++++++++++++++---------------- translation-table.c | 5 +-- 3 files changed, 42 insertions(+), 48 deletions(-)
Applied in revision ca2d4c6.
Thanks, Marek
Signed-off-by: Sven Eckelmann sven@narfation.org --- bridge_loop_avoidance.c | 39 +++++++++++++-------------------------- distributed-arp-table.c | 3 +-- translation-table.c | 12 ++++-------- types.h | 3 +-- 4 files changed, 19 insertions(+), 38 deletions(-)
diff --git a/bridge_loop_avoidance.c b/bridge_loop_avoidance.c index 274d93a..1d6fb77 100644 --- a/bridge_loop_avoidance.c +++ b/bridge_loop_avoidance.c @@ -123,8 +123,7 @@ static void claim_free_ref(struct claim *claim) call_rcu(&claim->rcu, claim_free_rcu); }
-/* - * @bat_priv: the bat priv with all the soft interface information +/* @bat_priv: the bat priv with all the soft interface information * @data: search data (may be local/static data) * * looks for a claim in the hash, and returns it if found @@ -163,8 +162,7 @@ static struct claim *claim_hash_find(struct bat_priv *bat_priv, return claim_tmp; }
-/* - * @bat_priv: the bat priv with all the soft interface information +/* @bat_priv: the bat priv with all the soft interface information * @addr: the address of the originator * @vid: the VLAN ID * @@ -243,8 +241,7 @@ static void bla_del_backbone_claims(struct backbone_gw *backbone_gw) backbone_gw->crc = BLA_CRC_INIT; }
-/* - * @bat_priv: the bat priv with all the soft interface information +/* @bat_priv: the bat priv with all the soft interface information * @orig: the mac address to be announced within the claim * @vid: the VLAN ID * @claimtype: the type of the claim (CLAIM, UNCLAIM, ANNOUNCE, ...) @@ -353,8 +350,7 @@ out: hardif_free_ref(primary_if); }
-/* - * @bat_priv: the bat priv with all the soft interface information +/* @bat_priv: the bat priv with all the soft interface information * @orig: the mac address of the originator * @vid: the VLAN ID * @@ -411,8 +407,7 @@ static struct backbone_gw *bla_get_backbone_gw(struct bat_priv *bat_priv, return entry; }
-/* - * update or add the own backbone gw to make sure we announce +/* update or add the own backbone gw to make sure we announce * where we receive other backbone gws */ static void bla_update_own_backbone_gw(struct bat_priv *bat_priv, @@ -430,8 +425,7 @@ static void bla_update_own_backbone_gw(struct bat_priv *bat_priv, backbone_gw_free_ref(backbone_gw); }
-/* - * @bat_priv: the bat priv with all the soft interface information +/* @bat_priv: the bat priv with all the soft interface information * @vid: the vid where the request came on * * Repeat all of our own claims, and finally send an ANNOUNCE frame @@ -477,8 +471,7 @@ static void bla_answer_request(struct bat_priv *bat_priv, backbone_gw_free_ref(backbone_gw); }
-/* - * @backbone_gw: the backbone gateway from whom we are out of sync +/* @backbone_gw: the backbone gateway from whom we are out of sync * * When the crc is wrong, ask the backbone gateway for a full table update. * After the request, it will repeat all of his own claims and finally @@ -505,8 +498,7 @@ static void bla_send_request(struct backbone_gw *backbone_gw) } }
-/* - * @bat_priv: the bat priv with all the soft interface information +/* @bat_priv: the bat priv with all the soft interface information * @backbone_gw: our backbone gateway which should be announced * * This function sends an announcement. It is called from multiple @@ -526,8 +518,7 @@ static void bla_send_announce(struct bat_priv *bat_priv,
}
-/* - * @bat_priv: the bat priv with all the soft interface information +/* @bat_priv: the bat priv with all the soft interface information * @mac: the mac address of the claim * @vid: the VLAN ID of the frame * @backbone_gw: the backbone gateway which claims it @@ -595,8 +586,7 @@ claim_free_ref: claim_free_ref(claim); }
-/* - * Delete a claim from the claim hash which has the +/* Delete a claim from the claim hash which has the * given mac address and vid. */ static void bla_del_claim(struct bat_priv *bat_priv, const uint8_t *mac, @@ -818,8 +808,7 @@ static int check_claim_group(struct bat_priv *bat_priv, }
-/* - * @bat_priv: the bat priv with all the soft interface information +/* @bat_priv: the bat priv with all the soft interface information * @skb: the frame to be checked * * Check if this is a claim frame, and process it accordingly. @@ -924,8 +913,7 @@ static int bla_process_claim(struct bat_priv *bat_priv, return 1; }
-/* - * Check when we last heard from other nodes, and remove them in case of +/* Check when we last heard from other nodes, and remove them in case of * a time out, or clean all backbone gws if now is set. */ static void bla_purge_backbone_gw(struct bat_priv *bat_priv, int now) @@ -1082,8 +1070,7 @@ static void bla_start_timer(struct bat_priv *bat_priv) msecs_to_jiffies(BLA_PERIOD_LENGTH)); }
-/* - * periodic work to do: +/* periodic work to do: * * purge structures when they are too old * * send announcements */ diff --git a/distributed-arp-table.c b/distributed-arp-table.c index 114db0a..c610108 100644 --- a/distributed-arp-table.c +++ b/distributed-arp-table.c @@ -217,8 +217,7 @@ static struct dht_candidate *dht_select_candidates(struct bat_priv *bat_priv, return res; }
-/* - * Sends the skb payload passed as argument to the candidates selected for +/* Sends the skb payload passed as argument to the candidates selected for * the data represented by 'ip'. The skb is copied by means of pskb_copy() * and is sent as unicast packet to each of the selected candidate. * diff --git a/translation-table.c b/translation-table.c index 8e4964b..cdc7322 100644 --- a/translation-table.c +++ b/translation-table.c @@ -599,8 +599,7 @@ int tt_global_add(struct bat_priv *bat_priv, struct orig_node *orig_node, } else { /* there is already a global entry, use this one. */
- /* - * If there is the TT_CLIENT_ROAM flag set, there is only one + /* If there is the TT_CLIENT_ROAM flag set, there is only one * originator left in the list and we previously received a * delete + roaming change for this originator. * @@ -636,8 +635,7 @@ out: return ret; }
-/* - * print all orig nodes who announce the address for this global entry. +/* print all orig nodes who announce the address for this global entry. * it is assumed that the caller holds rcu_read_lock(); */ static void tt_global_print_entry(struct tt_global_entry *tt_global_entry, @@ -773,8 +771,7 @@ static void tt_global_del_struct(struct bat_priv *bat_priv,
}
-/* - * If the client is to be deleted, we check if it is the last origantor entry +/* If the client is to be deleted, we check if it is the last origantor entry * within tt_global entry. If yes, we set the TT_CLIENT_ROAM flag and the timer, * otherwise we simply remove the originator scheduled for deletion. */ @@ -788,8 +785,7 @@ static void tt_global_del_roaming(struct bat_priv *bat_priv, struct hlist_node *node; struct tt_orig_list_entry *orig_entry;
- /* - * no local entry exists, case 1: + /* no local entry exists, case 1: * Check if this is the last one or if other entries exist. */
diff --git a/types.h b/types.h index 0643271..5ca9b58 100644 --- a/types.h +++ b/types.h @@ -29,8 +29,7 @@
#ifdef CONFIG_BATMAN_ADV_DAT
-/* - * dat_addr_t is the type used for all DHT addresses. If it is changed, +/* dat_addr_t is the type used for all DHT addresses. If it is changed, * DAT_ADDR_MAX is changed as well. * * *Please be careful: dat_addr_t must be UNSIGNED*
On Wednesday, March 07, 2012 16:07:50 Sven Eckelmann wrote:
Signed-off-by: Sven Eckelmann sven@narfation.org
bridge_loop_avoidance.c | 39 +++++++++++++-------------------------- distributed-arp-table.c | 3 +-- translation-table.c | 12 ++++-------- types.h | 3 +-- 4 files changed, 19 insertions(+), 38 deletions(-)
Applied in revision bce3b47.
Thanks, Marek
Signed-off-by: Sven Eckelmann sven@narfation.org --- bridge_loop_avoidance.c | 3 ++- translation-table.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/bridge_loop_avoidance.c b/bridge_loop_avoidance.c index 1d6fb77..da220cf 100644 --- a/bridge_loop_avoidance.c +++ b/bridge_loop_avoidance.c @@ -1142,8 +1142,9 @@ int bla_init(struct bat_priv *bat_priv) htons(crc16(0, primary_if->net_dev->dev_addr, ETH_ALEN)); hardif_free_ref(primary_if); - } else + } else { bat_priv->claim_dest.group = 0; /* will be set later */ + }
/* initialize the duplicate list */ for (i = 0; i < DUPLIST_SIZE; i++) diff --git a/translation-table.c b/translation-table.c index cdc7322..b889806 100644 --- a/translation-table.c +++ b/translation-table.c @@ -1618,8 +1618,9 @@ bool send_tt_response(struct bat_priv *bat_priv, return true;
return send_my_tt_response(bat_priv, tt_request); - } else + } else { return send_other_tt_response(bat_priv, tt_request); + } }
static void _tt_update_changes(struct bat_priv *bat_priv,
On Wednesday, March 07, 2012 16:07:51 Sven Eckelmann wrote:
Signed-off-by: Sven Eckelmann sven@narfation.org
bridge_loop_avoidance.c | 3 ++- translation-table.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-)
Applied in revision 639d1c9.
Thanks, Marek
Signed-off-by: Sven Eckelmann sven@narfation.org --- bridge_loop_avoidance.c | 24 ++++++++++++------------ 1 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/bridge_loop_avoidance.c b/bridge_loop_avoidance.c index da220cf..23bfbed 100644 --- a/bridge_loop_avoidance.c +++ b/bridge_loop_avoidance.c @@ -289,7 +289,7 @@ static void bla_send_claim(struct bat_priv *bat_priv, uint8_t *mac, goto out;
ethhdr = (struct ethhdr *)skb->data; - hw_src = (uint8_t *) ethhdr + ETH_HLEN + sizeof(struct arphdr); + hw_src = (uint8_t *)ethhdr + ETH_HLEN + sizeof(struct arphdr);
/* now we pretend that the client would have sent this ... */ switch (claimtype) { @@ -512,7 +512,7 @@ static void bla_send_announce(struct bat_priv *bat_priv,
memcpy(mac, announce_mac, 4); crc = htons(backbone_gw->crc); - memcpy(&mac[4], (uint8_t *) &crc, 2); + memcpy(&mac[4], (uint8_t *)&crc, 2);
bla_send_claim(bat_priv, mac, backbone_gw->vid, CLAIM_TYPE_ANNOUNCE);
@@ -629,7 +629,7 @@ static int handle_announce(struct bat_priv *bat_priv,
/* handle as ANNOUNCE frame */ backbone_gw->lasttime = jiffies; - crc = ntohs(*((uint16_t *) (&an_addr[4]))); + crc = ntohs(*((uint16_t *)(&an_addr[4])));
bat_dbg(DBG_BLA, bat_priv, "handle_announce(): ANNOUNCE vid %d (sent by %pM)... CRC = %04x\n", @@ -755,7 +755,7 @@ static int check_claim_group(struct bat_priv *bat_priv, struct orig_node *orig_node; struct bla_claim_dst *bla_dst, *bla_dst_own;
- bla_dst = (struct bla_claim_dst *) hw_dst; + bla_dst = (struct bla_claim_dst *)hw_dst; bla_dst_own = &bat_priv->claim_dest;
/* check if it is a claim packet in general */ @@ -834,7 +834,7 @@ static int bla_process_claim(struct bat_priv *bat_priv, ethhdr = (struct ethhdr *)skb_mac_header(skb);
if (ntohs(ethhdr->h_proto) == ETH_P_8021Q) { - vhdr = (struct vlan_ethhdr *) ethhdr; + vhdr = (struct vlan_ethhdr *)ethhdr; vid = ntohs(vhdr->h_vlan_TCI) & VLAN_VID_MASK; proto = ntohs(vhdr->h_vlan_encapsulated_proto); headlen = sizeof(*vhdr); @@ -852,8 +852,8 @@ static int bla_process_claim(struct bat_priv *bat_priv, return 0;
/* pskb_may_pull() may have modified the pointers, get ethhdr again */ - ethhdr = (struct ethhdr *) skb_mac_header(skb); - arphdr = (struct arphdr *) ((uint8_t *) ethhdr + headlen); + ethhdr = (struct ethhdr *)skb_mac_header(skb); + arphdr = (struct arphdr *)((uint8_t *)ethhdr + headlen);
/* Check whether the ARP frame carries a valid * IP information */ @@ -869,7 +869,7 @@ static int bla_process_claim(struct bat_priv *bat_priv,
hw_src = (uint8_t *)arphdr + sizeof(struct arphdr); hw_dst = hw_src + ETH_ALEN + 4; - bla_dst = (struct bla_claim_dst *) hw_dst; + bla_dst = (struct bla_claim_dst *)hw_dst;
/* check if it is a claim frame. */ ret = check_claim_group(bat_priv, primary_if, hw_src, hw_dst, ethhdr); @@ -1193,7 +1193,7 @@ int bla_check_bcast_duplist(struct bat_priv *bat_priv, struct bcast_duplist_entry *entry;
length = hdr_size - sizeof(*bcast_packet); - content = (uint8_t *) bcast_packet; + content = (uint8_t *)bcast_packet; content += sizeof(*bcast_packet);
/* calculate the crc ... */ @@ -1299,14 +1299,14 @@ int bla_is_backbone_gw(struct sk_buff *skb, if (!pskb_may_pull(skb, hdr_size + ETH_HLEN)) return 0;
- ethhdr = (struct ethhdr *) (((uint8_t *)skb->data) + hdr_size); + ethhdr = (struct ethhdr *)(((uint8_t *)skb->data) + hdr_size);
if (ntohs(ethhdr->h_proto) == ETH_P_8021Q) { if (!pskb_may_pull(skb, hdr_size + sizeof(struct vlan_ethhdr))) return 0;
- vhdr = (struct vlan_ethhdr *) (((uint8_t *)skb->data) + - hdr_size); + vhdr = (struct vlan_ethhdr *)(((uint8_t *)skb->data) + + hdr_size); vid = ntohs(vhdr->h_vlan_TCI) & VLAN_VID_MASK; }
On Wednesday, March 07, 2012 16:07:52 Sven Eckelmann wrote:
Signed-off-by: Sven Eckelmann sven@narfation.org
bridge_loop_avoidance.c | 24 ++++++++++++------------ 1 files changed, 12 insertions(+), 12 deletions(-)
Applied in revision 3a206a3.
Thanks, Marek
On Wednesday, March 07, 2012 16:07:45 Sven Eckelmann wrote:
Signed-off-by: Sven Eckelmann sven@narfation.org
bat_iv_ogm.c | 54 ++++++++++++------------------ bat_sysfs.c | 16 ++++---- gateway_client.c | 31 +++++++---------- gateway_common.c | 8 ++-- hard-interface.c | 36 +++++++-------------- icmp_socket.c | 12 ++---- main.c | 8 ++-- originator.c | 14 +++---- routing.c | 27 +++++++-------- send.c | 4 +- soft-interface.c | 15 ++++---- translation-table.c | 89 ++++++++++++++++++++++++-------------------------- 12 files changed, 137 insertions(+), 177 deletions(-)
Applied in revision a112eaa.
Thanks, Marek
b.a.t.m.a.n@lists.open-mesh.org