[Intel-wired-lan] [next PATCH S92 5/9] i40e: use WARN_ONCE to replace the commented BUG_ON size check

Bowers, AndrewX andrewx.bowers at intel.com
Thu May 17 22:13:23 UTC 2018


> -----Original Message-----
> From: Intel-wired-lan [mailto:intel-wired-lan-bounces at osuosl.org] On
> Behalf Of Alice Michael
> Sent: Thursday, May 17, 2018 1:09 AM
> To: Michael, Alice <alice.michael at intel.com>; intel-wired-
> lan at lists.osuosl.org
> Subject: [Intel-wired-lan] [next PATCH S92 5/9] i40e: use WARN_ONCE to
> replace the commented BUG_ON size check
> 
> From: Jacob Keller <jacob.e.keller at intel.com>
> 
> We don't really want to use BUG_ON here since that would completely crash
> the kernel, thus the reason we commented it out. We *can't* use
> BUILD_BUG_ON because at least now (a) the sizes aren't constant (we are
> fixing this) and (b) not all compilers are smart enough to understand that "p -
> data" is a constant.
> 
> Instead, just use a WARN_ONCE so that the first time we end up with an
> incorrect size we will dump a stack trace and a message, hopefully
> highlighting the issues early in testing.
> 
> Signed-off-by: Jacob Keller <jacob.e.keller at intel.com>
> ---
>  drivers/net/ethernet/intel/i40e/i40e_ethtool.c | 6 ++++--
>  1 file changed, 4 insertions(+), 2 deletions(-)

Tested-by: Andrew Bowers <andrewx.bowers at intel.com>




More information about the Intel-wired-lan mailing list