[02/17] batman-adv: statically print gateway table header

Message ID 1467378549-9646-3-git-send-email-sw@simonwunderlich.de (mailing list archive)
State Not Applicable, archived
Headers

Commit Message

Simon Wunderlich July 1, 2016, 1:08 p.m. UTC
  From: Antonio Quartulli <a@unstable.cc>

To make it easier to search through the code it is better to print static
strings directly instead of using format strings printing constants.

This was addressed in a previous patch, but the Gateway table header
was not updated accordingly.

Signed-off-by: Antonio Quartulli <a@unstable.cc>
Reviewed-by: Sven Eckelmann <sven@narfation.org>
Signed-off-by: Marek Lindner <mareklindner@neomailbox.ch>
Signed-off-by: Simon Wunderlich <sw@simonwunderlich.de>
---
 net/batman-adv/gateway_client.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
  

Comments

Joe Perches July 1, 2016, 5:19 p.m. UTC | #1
On Fri, 2016-07-01 at 15:08 +0200, Simon Wunderlich wrote:
> To make it easier to search through the code it is better to print static
> strings directly instead of using format strings printing constants.

It's also generally smaller object code and faster at runtime.

$ size net/batman-adv/gateway_client.o*
   text	   data	    bss	    dec	    hex	filename
   4898	      1	      0	   4899	   1323	net/batman-adv/gateway_client.o.new
   4951	      1	      0	   4952	   1358	net/batman-adv/gateway_client.o.old
  

Patch

diff --git a/net/batman-adv/gateway_client.c b/net/batman-adv/gateway_client.c
index 5839c56..b9d72e9 100644
--- a/net/batman-adv/gateway_client.c
+++ b/net/batman-adv/gateway_client.c
@@ -638,8 +638,7 @@  int batadv_gw_client_seq_print_text(struct seq_file *seq, void *offset)
 		goto out;
 
 	seq_printf(seq,
-		   "      %-12s (%s/%i) %17s [%10s]: advertised uplink bandwidth ... [B.A.T.M.A.N. adv %s, MainIF/MAC: %s/%pM (%s)]\n",
-		   "Gateway", "#", BATADV_TQ_MAX_VALUE, "Nexthop", "outgoingIF",
+		   "      Gateway      (#/255)           Nexthop [outgoingIF]: advertised uplink bandwidth ... [B.A.T.M.A.N. adv %s, MainIF/MAC: %s/%pM (%s)]\n",
 		   BATADV_SOURCE_VERSION, primary_if->net_dev->name,
 		   primary_if->net_dev->dev_addr, net_dev->name);