From: David S. Miller Date: Tue, 19 Feb 2008 00:50:22 +0000 (-0800) Subject: [NET]: Elminate spurious print_mac() calls. X-Git-Tag: v2.6.25-rc3~126^2~7 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8f789c48448aed74fe1c07af76de8f04adacec7d;p=linux-2.6 [NET]: Elminate spurious print_mac() calls. Patrick McHardy notes that print_mac() can get invoked even if the result it unused (f.e. as an argument to pr_debug() when DEBUG is not defined). Mark this function as "__pure" to eliminate this problem. Signed-off-by: David S. Miller --- diff --git a/include/linux/if_ether.h b/include/linux/if_ether.h index 7a1e011b8a..42dc6a3571 100644 --- a/include/linux/if_ether.h +++ b/include/linux/if_ether.h @@ -129,7 +129,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. */ -extern char *print_mac(char *buf, const unsigned char *addr); +extern __pure char *print_mac(char *buf, const unsigned char *addr); #define MAC_BUF_SIZE 18 #define DECLARE_MAC_BUF(var) char var[MAC_BUF_SIZE] __maybe_unused