[dpdk-dev,v2] enic: silence log message unless debug enabled
Commit Message
This blocks the annoying ENIC driver initialization message unless
debug is enabled. Drivers should speak only when spoken to and not
be chatty.
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
drivers/net/enic/enic_compat.h | 4 ++++
1 file changed, 4 insertions(+)
Comments
2015-07-30 10:03, Stephen Hemminger:
> --- a/drivers/net/enic/enic_compat.h
> +++ b/drivers/net/enic/enic_compat.h
> @@ -82,7 +82,11 @@
> #define dev_err(x, args...) dev_printk(ERR, args)
> #define dev_info(x, args...) dev_printk(INFO, args)
> #define dev_warning(x, args...) dev_printk(WARNING, args)
> +#ifdef RTE_LIBRTE_ENIC_DEBUG
> #define dev_debug(x, args...) dev_printk(DEBUG, args)
> +#else
> +#define dev_debug(x, args...) do { } while(0)
> +#endif
I don't understand why it is needed:
dev_debug won't print anything if the log level is higher than DEBUG.
@@ -82,7 +82,11 @@
#define dev_err(x, args...) dev_printk(ERR, args)
#define dev_info(x, args...) dev_printk(INFO, args)
#define dev_warning(x, args...) dev_printk(WARNING, args)
+#ifdef RTE_LIBRTE_ENIC_DEBUG
#define dev_debug(x, args...) dev_printk(DEBUG, args)
+#else
+#define dev_debug(x, args...) do { } while(0)
+#endif
#define __le16 u16
#define __le32 u32