All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] can: fix proc/can/net/rcvlist_* header alignment on 64-bit system
@ 2021-04-25  8:49 Erik Flodin
  2021-04-25  9:07 ` Marc Kleine-Budde
  0 siblings, 1 reply; 11+ messages in thread
From: Erik Flodin @ 2021-04-25  8:49 UTC (permalink / raw)
  Cc: Erik Flodin, Oliver Hartkopp, Marc Kleine-Budde, David S. Miller,
	Jakub Kicinski, linux-can, netdev

Before this fix, the function and userdata columns weren't aligned:
  device   can_id   can_mask  function  userdata   matches  ident
   vcan0  92345678  9fffffff  0000000000000000  0000000000000000         0  raw
   vcan0     123    00000123  0000000000000000  0000000000000000         0  raw

After the fix they are:
  device   can_id   can_mask      function          userdata       matches  ident
   vcan0  92345678  9fffffff  0000000000000000  0000000000000000         0  raw
   vcan0     123    00000123  0000000000000000  0000000000000000         0  raw

Signed-off-by: Erik Flodin <erik@flodin.me>
---
 net/can/proc.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/net/can/proc.c b/net/can/proc.c
index 5ea8695f507e..97901e56c429 100644
--- a/net/can/proc.c
+++ b/net/can/proc.c
@@ -205,8 +205,11 @@ static void can_print_recv_banner(struct seq_file *m)
 	 *                  can1.  00000000  00000000  00000000
 	 *                 .......          0  tp20
 	 */
-	seq_puts(m, "  device   can_id   can_mask  function"
-			"  userdata   matches  ident\n");
+	const char *pad = sizeof(void *) == 8 ? "    " : "";
+
+	seq_printf(m, "  device   can_id   can_mask  %sfunction%s"
+		   "  %suserdata%s   matches  ident\n",
+		   pad, pad, pad, pad);
 }
 
 static int can_stats_proc_show(struct seq_file *m, void *v)
-- 
2.31.0


^ permalink raw reply related	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2021-04-25 14:16 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-25  8:49 [PATCH] can: fix proc/can/net/rcvlist_* header alignment on 64-bit system Erik Flodin
2021-04-25  9:07 ` Marc Kleine-Budde
2021-04-25  9:52   ` [PATCH] can: proc: fix rcvlist_* " Erik Flodin
2021-04-25 11:40     ` Erik Flodin
2021-04-25 12:05       ` Vincent MAILHOL
2021-04-25 12:09         ` Marc Kleine-Budde
2021-04-25 12:22     ` [PATCH v3] " Erik Flodin
2021-04-25 12:27       ` Marc Kleine-Budde
2021-04-25 14:16         ` Erik Flodin
2021-04-25 14:14     ` [PATCH] " Erik Flodin
2021-04-25  9:56   ` [PATCH] can: fix proc/can/net/rcvlist_* " Erik Flodin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.