diff options
author | Edward Cree | 2017-01-27 15:02:26 +0000 |
---|---|---|
committer | David S. Miller | 2017-01-27 11:59:31 -0500 |
commit | f617f27653c4d9f5b2aa43d567ac0405df889944 (patch) | |
tree | 981ce5e855792d76ea440657948bef98465ca607 /include | |
parent | 2d3d4ec01641148636f8961ccd64308dbf2072f4 (diff) |
net: implement netif_cond_dbg macro
For reporting things that may or may not be serious, depending on some
condition, netif_cond_dbg will check the condition and print the report
at either dbg (if the condition is true) or the specified level.
Suggested-by: Jon Cooper <jcooper@solarflare.com>
Signed-off-by: Edward Cree <ecree@solarflare.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/netdevice.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index d63cacb67ea6..9511e5a1cfc6 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -4347,6 +4347,15 @@ do { \ }) #endif +/* if @cond then downgrade to debug, else print at @level */ +#define netif_cond_dbg(priv, type, netdev, cond, level, fmt, args...) \ + do { \ + if (cond) \ + netif_dbg(priv, type, netdev, fmt, ##args); \ + else \ + netif_ ## level(priv, type, netdev, fmt, ##args); \ + } while (0) + #if defined(VERBOSE_DEBUG) #define netif_vdbg netif_dbg #else |