Browse Source

[ETHER]: Bring back MAC_FMT

The print_mac function is not very suitable for debugging printks
in performance critical paths since without ifdefs it will always
get called. MAC_FMT can be used with pr_debug without any overhead
when debugging is disabled.

Signed-off-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
Patrick McHardy 17 years ago
parent
commit
a5250a3695
1 changed files with 1 additions and 0 deletions
  1. 1 0
      include/linux/if_ether.h

+ 1 - 0
include/linux/if_ether.h

@@ -130,6 +130,7 @@ extern ssize_t sysfs_format_mac(char *buf, const unsigned char *addr, int len);
  *	Display a 6 byte device address (MAC) in a readable format.
  *	Display a 6 byte device address (MAC) in a readable format.
  */
  */
 extern char *print_mac(char *buf, const unsigned char *addr);
 extern char *print_mac(char *buf, const unsigned char *addr);
+#define MAC_FMT "%02x:%02x:%02x:%02x:%02x:%02x"
 #define MAC_BUF_SIZE	18
 #define MAC_BUF_SIZE	18
 #define DECLARE_MAC_BUF(var) char var[MAC_BUF_SIZE] __maybe_unused
 #define DECLARE_MAC_BUF(var) char var[MAC_BUF_SIZE] __maybe_unused