Skip to contentSkip to conversation

batman-adv: Fine-tuning for three function implementations

PATCH In review SF Markus Elfring 2 participants 4 messages May 6, 2017 – May 23, 2017

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

cover batman-adv: Fine-tuning for three function implementations

From: Markus Elfring <[email protected]>
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(-)
Signature · 1 line
2.12.2
#1 lore raw

PATCH 1/2 batman-adv: Replace a seq_puts() call by seq_putc() in two functions

From: Markus Elfring <[email protected]>
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.

---
 net/batman-adv/bat_iv_ogm.c | 2 +-
 net/batman-adv/bat_v.c      | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
net/batman-adv/bat_iv_ogm.c +1 -1
index 495ba7cdcb04..1f80392ab37c 100644
@@ -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:
net/batman-adv/bat_v.c +1 -1
index a36c8e7291d6..4e2724c5b33d 100644
@@ -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:
Signature · 1 line
2.12.2
#2 lore raw

PATCH 2/2 batman-adv: Combine two seq_puts() calls into one call in batadv_nc_nodes_seq_print_text()

In reply to SF Markus Elfring

From: Markus Elfring <[email protected]>
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.

---
 net/batman-adv/network-coding.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
net/batman-adv/network-coding.c +1 -3
index e1f6fc72fe3e..3604d7899e2c 100644
@@ -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,
Signature · 1 line
2.12.2
maintainer
#3 lore raw
In reply to SF Markus Elfring
Quoted 9 lines · On Samstag, 6. Mai 2017 18:12:46 CEST SF Markus Elfring wrote:

From: Markus Elfring <[email protected]>
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/626caae9f25746c39b0a1204f8b8f532c1746f10
[2] https://git.open-mesh.org/linux-merge.git/commit/912eeed9f5208515b75103e91ff8b64cfdcca7b9