Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f617f276 authored by Edward Cree's avatar Edward Cree Committed by David S. Miller
Browse files

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: default avatarJon Cooper <jcooper@solarflare.com>
Signed-off-by: default avatarEdward Cree <ecree@solarflare.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 2d3d4ec0
Loading
Loading
Loading
Loading
+9 −0
Original line number Diff line number Diff line
@@ -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