Repository : ssh://git@open-mesh.org/batman-adv
On branch : next
commit c7203da7a3aeec3358e60fe970f2aa654e5ca69c Author: Joe Perches joe@perches.com Date: Mon Feb 16 17:31:39 2015 -0800
batman-adv: Remove uses of return value of seq_printf
This function is soon going to return void so remove the return value use.
Convert the return value to test seq_has_overflowed() instead.
Signed-off-by: Joe Perches joe@perches.com Signed-off-by: Marek Lindner mareklindner@neomailbox.ch
c7203da7a3aeec3358e60fe970f2aa654e5ca69c compat.h | 9 +++++++++ gateway_client.c | 19 ++++++++++--------- 2 files changed, 19 insertions(+), 9 deletions(-)
diff --git a/compat.h b/compat.h index c22fe1c..835c6ea 100644 --- a/compat.h +++ b/compat.h @@ -464,4 +464,13 @@ static int __batadv_interface_kill_vid(struct net_device *dev, __be16 proto,\
#endif /* < KERNEL_VERSION(3, 17, 0) */
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 19, 0) + +static inline bool seq_has_overflowed(struct seq_file *m) +{ + return m->count == m->size; +} + +#endif /* < KERNEL_VERSION(3, 19, 0) */ + #endif /* _NET_BATMAN_ADV_COMPAT_H_ */ diff --git a/gateway_client.c b/gateway_client.c index 27649e8..a0876ea 100644 --- a/gateway_client.c +++ b/gateway_client.c @@ -592,15 +592,16 @@ static int batadv_write_buffer_text(struct batadv_priv *bat_priv,
curr_gw = batadv_gw_get_selected_gw_node(bat_priv);
- ret = seq_printf(seq, "%s %pM (%3i) %pM [%10s]: %u.%u/%u.%u MBit\n", - (curr_gw == gw_node ? "=>" : " "), - gw_node->orig_node->orig, - router_ifinfo->bat_iv.tq_avg, router->addr, - router->if_incoming->net_dev->name, - gw_node->bandwidth_down / 10, - gw_node->bandwidth_down % 10, - gw_node->bandwidth_up / 10, - gw_node->bandwidth_up % 10); + seq_printf(seq, "%s %pM (%3i) %pM [%10s]: %u.%u/%u.%u MBit\n", + (curr_gw == gw_node ? "=>" : " "), + gw_node->orig_node->orig, + router_ifinfo->bat_iv.tq_avg, router->addr, + router->if_incoming->net_dev->name, + gw_node->bandwidth_down / 10, + gw_node->bandwidth_down % 10, + gw_node->bandwidth_up / 10, + gw_node->bandwidth_up % 10); + ret = seq_has_overflowed(seq);
if (curr_gw) batadv_gw_node_free_ref(curr_gw);