diff options
author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2013-07-10 10:30:34 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-07-11 20:03:36 -0400 |
commit | d77e41e12744e53ca7f98f920350998b5f00c93a (patch) | |
tree | d2c69e8c5417798ffba6916df6d260984122e200 /net/tipc | |
parent | 7ad031ee468e4ed9196215394d7e18a78a66a7da (diff) |
net/tipc: use %*phC to dump small buffers in hex form
Instead of passing each byte by stack let's use nice specifier for that.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tipc')
-rw-r--r-- | net/tipc/ib_media.c | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/net/tipc/ib_media.c b/net/tipc/ib_media.c index ad2e1ec4117e..9934a32bfa87 100644 --- a/net/tipc/ib_media.c +++ b/net/tipc/ib_media.c | |||
@@ -292,13 +292,7 @@ static int ib_addr2str(struct tipc_media_addr *a, char *str_buf, int str_size) | |||
292 | if (str_size < 60) /* 60 = 19 * strlen("xx:") + strlen("xx\0") */ | 292 | if (str_size < 60) /* 60 = 19 * strlen("xx:") + strlen("xx\0") */ |
293 | return 1; | 293 | return 1; |
294 | 294 | ||
295 | sprintf(str_buf, "%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:" | 295 | sprintf(str_buf, "%20phC", a->value); |
296 | "%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x:%02x", | ||
297 | a->value[0], a->value[1], a->value[2], a->value[3], | ||
298 | a->value[4], a->value[5], a->value[6], a->value[7], | ||
299 | a->value[8], a->value[9], a->value[10], a->value[11], | ||
300 | a->value[12], a->value[13], a->value[14], a->value[15], | ||
301 | a->value[16], a->value[17], a->value[18], a->value[19]); | ||
302 | 296 | ||
303 | return 0; | 297 | return 0; |
304 | } | 298 | } |