From: Jakub Kicinski <jakub.kicin...@netronome.com> Date: Wed, 25 Nov 2015 15:39:04 +0000
> +config NFP_NET_DEBUG > + bool "Debug support for Netronome(R) NFP3200/NFP6000 NIC drivers" > + depends on NFP_NET || NFP_NETVF > + ---help--- > + Enable extra sanity checks and debugfs support in > + Netronome(R) NFP3200/NFP6000 NIC PF and VF drivers. > + Note: selecting this option may adversely impact > + performance. ... > +#ifdef CONFIG_NFP_NET_DEBUG > +#define nn_assert(cond, fmt, args...) > \ > + do { \ > + if (unlikely(!(cond))) { \ > + pr_err("assertion %s failed\n", #cond); \ > + pr_err(fmt, ## args); \ > + BUG(); \ > + } \ > + } while (0) > +#else > +#define nn_assert(cond, fmt, args...) do { } while (0) > +#endif This is really not appropriate. Use WARN_ON() et al. as appropriate to assert things, and in particular _AVOID_ BUG() in pretty much all cases and attempt to continue running somehow with error handling paths etc. Use of BUG() is discouraged in all except the most extreme cases where the kernel cannot continue to execute at all. Thanks. -- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html