Skip to content

Commit

Permalink
[NET]: Elminate spurious print_mac() calls.
Browse files Browse the repository at this point in the history
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 <davem@davemloft.net>
  • Loading branch information
David S. Miller committed Feb 19, 2008
1 parent 988d009 commit 8f789c4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/linux/if_ether.h
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 8f789c4

Please sign in to comment.