* [B.A.T.M.A.N.] [PATCH] batman-adv: use static string for table headers
@ 2013-11-07 7:24 Antonio Quartulli
2016-03-10 17:53 ` Sven Eckelmann
2016-03-11 15:25 ` Sven Eckelmann
0 siblings, 2 replies; 3+ messages in thread
From: Antonio Quartulli @ 2013-11-07 7:24 UTC (permalink / raw)
To: b.a.t.m.a.n; +Cc: Antonio Quartulli
Use a static string when showing table headers rather then
a nonsense parametric one with fixed arguments.
It is easier to grep and it does not need to be recomputed
at runtime each time.
Reported-by: Joe Perches <joe@perches.com>
Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
---
bat_iv_ogm.c | 5 ++---
bridge_loop_avoidance.c | 7 +++----
distributed-arp-table.c | 4 ++--
translation-table.c | 9 ++++-----
4 files changed, 11 insertions(+), 14 deletions(-)
diff --git a/bat_iv_ogm.c b/bat_iv_ogm.c
index 409cb16..553f8e4 100644
--- a/bat_iv_ogm.c
+++ b/bat_iv_ogm.c
@@ -1546,9 +1546,8 @@ static void batadv_iv_ogm_orig_print(struct batadv_priv *bat_priv,
int batman_count = 0;
uint32_t i;
- seq_printf(seq, " %-15s %s (%s/%i) %17s [%10s]: %20s ...\n",
- "Originator", "last-seen", "#", BATADV_TQ_MAX_VALUE,
- "Nexthop", "outgoingIF", "Potential nexthops");
+ seq_puts(seq,
+ " Originator last-seen (#/" __stringify(BATADV_TQ_MAX_VALUE) ") Nexthop [outgoingIF]: Potential nexthops ...\n");
for (i = 0; i < hash->size; i++) {
head = &hash->table[i];
diff --git a/bridge_loop_avoidance.c b/bridge_loop_avoidance.c
index 4382127..0c83809 100644
--- a/bridge_loop_avoidance.c
+++ b/bridge_loop_avoidance.c
@@ -1613,8 +1613,8 @@ int batadv_bla_claim_table_seq_print_text(struct seq_file *seq, void *offset)
"Claims announced for the mesh %s (orig %pM, group id %#.4x)\n",
net_dev->name, primary_addr,
ntohs(bat_priv->bla.claim_dest.group));
- seq_printf(seq, " %-17s %-5s %-17s [o] (%-6s)\n",
- "Client", "VID", "Originator", "CRC");
+ seq_puts(seq,
+ " Client VID Originator [o] (CRC )\n");
for (i = 0; i < hash->size; i++) {
head = &hash->table[i];
@@ -1658,8 +1658,7 @@ int batadv_bla_backbone_table_seq_print_text(struct seq_file *seq, void *offset)
"Backbones announced for the mesh %s (orig %pM, group id %#.4x)\n",
net_dev->name, primary_addr,
ntohs(bat_priv->bla.claim_dest.group));
- seq_printf(seq, " %-17s %-5s %-9s (%-6s)\n",
- "Originator", "VID", "last seen", "CRC");
+ seq_puts(seq, " Originator VID last seen (CRC )\n");
for (i = 0; i < hash->size; i++) {
head = &hash->table[i];
diff --git a/distributed-arp-table.c b/distributed-arp-table.c
index ed4b97a..4ba2d7d 100644
--- a/distributed-arp-table.c
+++ b/distributed-arp-table.c
@@ -756,8 +756,8 @@ int batadv_dat_cache_seq_print_text(struct seq_file *seq, void *offset)
goto out;
seq_printf(seq, "Distributed ARP Table (%s):\n", net_dev->name);
- seq_printf(seq, " %-7s %-9s %4s %11s\n", "IPv4",
- "MAC", "VID", "last-seen");
+ seq_puts(seq,
+ " IPv4 MAC VID last-seen\n");
for (i = 0; i < hash->size; i++) {
head = &hash->table[i];
diff --git a/translation-table.c b/translation-table.c
index 5957bad..6abb240 100644
--- a/translation-table.c
+++ b/translation-table.c
@@ -869,8 +869,8 @@ int batadv_tt_local_seq_print_text(struct seq_file *seq, void *offset)
seq_printf(seq,
"Locally retrieved addresses (from %s) announced via TT (TTVN: %u):\n",
net_dev->name, (uint8_t)atomic_read(&bat_priv->tt.vn));
- seq_printf(seq, " %-13s %s %-7s %-9s (%-10s)\n", "Client", "VID",
- "Flags", "Last seen", "CRC");
+ seq_puts(seq,
+ " Client VID Flags Last seen (CRC )\n");
for (i = 0; i < hash->size; i++) {
head = &hash->table[i];
@@ -1503,9 +1503,8 @@ int batadv_tt_global_seq_print_text(struct seq_file *seq, void *offset)
seq_printf(seq,
"Globally announced TT entries received via the mesh %s\n",
net_dev->name);
- seq_printf(seq, " %-13s %s %s %-15s %s (%-10s) %s\n",
- "Client", "VID", "(TTVN)", "Originator", "(Curr TTVN)",
- "CRC", "Flags");
+ seq_puts(seq,
+ " Client VID (TTVN) Originator (Curr TTVN) (CRC ) Flags\n");
for (i = 0; i < hash->size; i++) {
head = &hash->table[i];
--
1.8.4.2
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [B.A.T.M.A.N.] [PATCH] batman-adv: use static string for table headers
2013-11-07 7:24 [B.A.T.M.A.N.] [PATCH] batman-adv: use static string for table headers Antonio Quartulli
@ 2016-03-10 17:53 ` Sven Eckelmann
2016-03-11 15:25 ` Sven Eckelmann
1 sibling, 0 replies; 3+ messages in thread
From: Sven Eckelmann @ 2016-03-10 17:53 UTC (permalink / raw)
To: b.a.t.m.a.n; +Cc: Antonio Quartulli
[-- Attachment #1: Type: text/plain, Size: 560 bytes --]
On Thursday 07 November 2013 08:24:51 Antonio Quartulli wrote:
> Use a static string when showing table headers rather then
> a nonsense parametric one with fixed arguments.
>
> It is easier to grep and it does not need to be recomputed
> at runtime each time.
>
> Reported-by: Joe Perches <joe@perches.com>
> Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
> ---
It looks like this patch doesn't apply anymore. Can you please resent it or
mark it correctly in patchwork [1].
Thanks,
Sven
[1] https://patchwork.open-mesh.org/patch/3599/
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [B.A.T.M.A.N.] [PATCH] batman-adv: use static string for table headers
2013-11-07 7:24 [B.A.T.M.A.N.] [PATCH] batman-adv: use static string for table headers Antonio Quartulli
2016-03-10 17:53 ` Sven Eckelmann
@ 2016-03-11 15:25 ` Sven Eckelmann
1 sibling, 0 replies; 3+ messages in thread
From: Sven Eckelmann @ 2016-03-11 15:25 UTC (permalink / raw)
To: b.a.t.m.a.n; +Cc: Antonio Quartulli
[-- Attachment #1: Type: text/plain, Size: 1720 bytes --]
On Thursday 07 November 2013 08:24:51 Antonio Quartulli wrote:
> Use a static string when showing table headers rather then
> a nonsense parametric one with fixed arguments.
>
> It is easier to grep and it does not need to be recomputed
> at runtime each time.
>
> Reported-by: Joe Perches <joe@perches.com>
> Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
> ---
> bat_iv_ogm.c | 5 ++---
> bridge_loop_avoidance.c | 7 +++----
> distributed-arp-table.c | 4 ++--
> translation-table.c | 9 ++++-----
> 4 files changed, 11 insertions(+), 14 deletions(-)
>
It looks that there now one more table in net/batman-adv/bat_iv_ogm.c and
two in net/batman-adv/bat_v.c
$ git grep seq_printf|grep '%-'
net/batman-adv/bat_iv_ogm.c: seq_printf(seq, " %-15s %s (%s/%i) %17s [%10s]: %20s ...\n",
net/batman-adv/bat_iv_ogm.c: seq_printf(seq, " %10s %-13s %s\n",
net/batman-adv/bat_v.c: seq_printf(seq, " %-15s %s (%11s) [%10s]\n", "Neighbor",
net/batman-adv/bat_v.c: seq_printf(seq, " %-15s %s (%11s) %17s [%10s]: %20s ...\n",
net/batman-adv/bridge_loop_avoidance.c: seq_printf(seq, " %-17s %-5s %-17s [o] (%-6s)\n",
net/batman-adv/bridge_loop_avoidance.c: seq_printf(seq, " %-17s %-5s %-9s (%-6s)\n",
net/batman-adv/distributed-arp-table.c: seq_printf(seq, " %-7s %-9s %4s %11s\n", "IPv4",
net/batman-adv/translation-table.c: seq_printf(seq, " %-13s %s %-8s %-9s (%-10s)\n", "Client", "VID",
net/batman-adv/translation-table.c: seq_printf(seq, " %-13s %s %s %-15s %s (%-10s) %s\n",
But I can update these parts myself and send a fresh version to the
mailing list.
Kind regards,
Sve
[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-03-11 15:25 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-07 7:24 [B.A.T.M.A.N.] [PATCH] batman-adv: use static string for table headers Antonio Quartulli
2016-03-10 17:53 ` Sven Eckelmann
2016-03-11 15:25 ` Sven Eckelmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox