mirror of https://gitee.com/openkylin/linux.git
1eb43fc754
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: Jacob Keller <jacob.e.keller@intel.com> Signed-off-by: Anirudh Venkataramanan <anirudh.venkataramanan@intel.com> Tested-by: Tony Brelinski <tonyx.brelinski@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com> |
||
---|---|---|
.. | ||
Makefile | ||
ice.h | ||
ice_adminq_cmd.h | ||
ice_common.c | ||
ice_common.h | ||
ice_controlq.c | ||
ice_controlq.h | ||
ice_devids.h | ||
ice_ethtool.c | ||
ice_hw_autogen.h | ||
ice_lan_tx_rx.h | ||
ice_main.c | ||
ice_nvm.c | ||
ice_osdep.h | ||
ice_sched.c | ||
ice_sched.h | ||
ice_status.h | ||
ice_switch.c | ||
ice_switch.h | ||
ice_txrx.c | ||
ice_txrx.h | ||
ice_type.h |