• Jacob Keller's avatar
    ice: Use order_base_2 to calculate higher power of 2 · 1eb43fc7
    Jacob Keller authored
    Currently, we use a combination of ilog2 and is_power_of_2() to
    calculate the next power of 2 for the qcount. This appears to be causing
    a warning on some combinations of GCC and the Linux kernel:
    
    MODPOST 1 modules
    WARNING: "____ilog2_NaN" [ice.ko] undefined!
    
    This appears to because because GCC realizes that qcount could be zero
    in some circumstances and thus attempts to link against the
    intentionally undefined ___ilog2_NaN function.
    
    The order_base_2 function is intentionally defined to return 0 when
    passed 0 as an argument, and thus will be safe to use here.
    
    This not only fixes the warning but makes the resulting code slightly
    cleaner, and is really what we should have used originally.
    
    Also update the comment to make it more clear that we are rounding up,
    not just incrementing the ilog2 of qcount unconditionally.
    Signed-off-by: default avatarJacob Keller <jacob.e.keller@intel.com>
    Signed-off-by: default avatarAnirudh Venkataramanan <anirudh.venkataramanan@intel.com>
    Tested-by: default avatarTony Brelinski <tonyx.brelinski@intel.com>
    Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
    1eb43fc7
ice_main.c 139 KB