From: Markus Elfring elfring@users.sourceforge.net Date: Sat, 6 May 2017 18:03:45 +0200
Two update suggestions were taken into account from static source code analysis.
Markus Elfring (2): Replace a seq_puts() call by seq_putc() in two functions Combine two seq_puts() calls into one call in batadv_nc_nodes_seq_print_text()
net/batman-adv/bat_iv_ogm.c | 2 +- net/batman-adv/bat_v.c | 2 +- net/batman-adv/network-coding.c | 4 +--- 3 files changed, 3 insertions(+), 5 deletions(-)
From: Markus Elfring elfring@users.sourceforge.net Date: Sat, 6 May 2017 17:50:13 +0200
Two single characters (line breaks) should be put into a sequence. Thus use the corresponding function "seq_putc".
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring elfring@users.sourceforge.net --- net/batman-adv/bat_iv_ogm.c | 2 +- net/batman-adv/bat_v.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/batman-adv/bat_iv_ogm.c b/net/batman-adv/bat_iv_ogm.c index 495ba7cdcb04..1f80392ab37c 100644 --- a/net/batman-adv/bat_iv_ogm.c +++ b/net/batman-adv/bat_iv_ogm.c @@ -1944,7 +1944,7 @@ static void batadv_iv_ogm_orig_print(struct batadv_priv *bat_priv,
batadv_iv_ogm_orig_print_neigh(orig_node, if_outgoing, seq); - seq_puts(seq, "\n"); + seq_putc(seq, '\n'); batman_count++;
next: diff --git a/net/batman-adv/bat_v.c b/net/batman-adv/bat_v.c index a36c8e7291d6..4e2724c5b33d 100644 --- a/net/batman-adv/bat_v.c +++ b/net/batman-adv/bat_v.c @@ -400,7 +400,7 @@ static void batadv_v_orig_print(struct batadv_priv *bat_priv, neigh_node->if_incoming->net_dev->name);
batadv_v_orig_print_neigh(orig_node, if_outgoing, seq); - seq_puts(seq, "\n"); + seq_putc(seq, '\n'); batman_count++;
next:
From: Markus Elfring elfring@users.sourceforge.net Date: Sat, 6 May 2017 17:57:36 +0200
A bit of text was put into a sequence by two separate function calls. Print the same data by a single function call instead.
This issue was detected by using the Coccinelle software.
Signed-off-by: Markus Elfring elfring@users.sourceforge.net --- net/batman-adv/network-coding.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/net/batman-adv/network-coding.c b/net/batman-adv/network-coding.c index e1f6fc72fe3e..3604d7899e2c 100644 --- a/net/batman-adv/network-coding.c +++ b/net/batman-adv/network-coding.c @@ -1935,9 +1935,7 @@ int batadv_nc_nodes_seq_print_text(struct seq_file *seq, void *offset) list) seq_printf(seq, "%pM ", nc_node->addr); - seq_puts(seq, "\n"); - - seq_puts(seq, " Outgoing: "); + seq_puts(seq, "\n Outgoing: "); /* For out_nc_node to this orig_node */ list_for_each_entry_rcu(nc_node, &orig_node->out_coding_list,
On Samstag, 6. Mai 2017 18:12:46 CEST SF Markus Elfring wrote:
From: Markus Elfring elfring@users.sourceforge.net Date: Sat, 6 May 2017 18:03:45 +0200
Two update suggestions were taken into account from static source code analysis.
Markus Elfring (2): Replace a seq_puts() call by seq_putc() in two functions Combine two seq_puts() calls into one call in batadv_nc_nodes_seq_print_text()
Patches applied as 626caae9f257 [1] and 912eeed9f520 [2]
Thanks, Sven
[1] https://git.open-mesh.org/linux-merge.git/commit/626caae9f25746c39b0a1204f8b... [2] https://git.open-mesh.org/linux-merge.git/commit/912eeed9f5208515b75103e91ff...
b.a.t.m.a.n@lists.open-mesh.org