batman-adv: Remove uses of return value of seq_printf
Subsystems (3)
PATCH 1/1 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.
--- net/batman-adv/gateway_client.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-)
net/batman-adv/gateway_client.c +10 -9
@@ -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);
Hi Joe,
thank you very much for this patch.
Quoted 6 lines · Joe Perches
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 <[email protected]>
Signature · 1 line
Antonio Quartulli
Hi Joe,
thank you very much for this patch.
Quoted 6 lines · Joe Perches
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 <[email protected]>
Signature · 1 line
Antonio Quartulli
Hi Joe,
thank you very much for this patch.
Quoted 6 lines · Joe Perches
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 <[email protected]>
Signature · 1 line
Antonio Quartulli
From: Joe Perches <[email protected]>
Date: Mon, 16 Feb 2015 17:31:39 -0800
Quoted 6 lines
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 <[email protected]>
Applied to net-next.
PATCH 1/1 batman-adv: Fix use of seq_has_overflowed()
net-next commit 6d91147d183c ("batman-adv: Remove uses of return value of seq_printf") incorrectly changed the overflow occurred return from -1 to 1. Change it back so that the test of batadv_write_buffer_text's return value in batadv_gw_client_seq_print_text works properly.
---
sorry 'bout that.
I believe this won't have any real effect unless there are something like 500+ entries in the gateway list.
net/batman-adv/gateway_client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/batman-adv/gateway_client.c +1 -1
@@ -601,7 +601,7 @@ static int batadv_write_buffer_text(struct batadv_priv *bat_priv, gw_node->bandwidth_down %10 , gw_node->bandwidth_up /10 , gw_node->bandwidth_up % 10); - ret =seq_has_overflowed (seq); + ret =seq_has_overflowed (seq) ?-1 :0 ;if (curr_gw)batadv_gw_node_free_ref (curr_gw);
Re: [PATCH net-next] batman-adv: Fix use of seq_has_overflowed()
From: Joe Perches <[email protected]>
Date: Sun, 22 Feb 2015 13:47:56 -0800
Quoted 6 lines
net-next commit
6d91147d183c("batman-adv: Remove uses of return value ofseq_printf") incorrectly changed the overflow occurred return from -1 to 1. Change it back so that the test of batadv_write_buffer_text's return value inbatadv_gw_client_seq_print_textworks properly.Signed-off-by Joe Perches <[email protected]>
Applied, thanks Joe.