linux/drivers/net/ethernet/intel/ice
Jacob Keller 1eb43fc754 ice: Use order_base_2 to calculate higher power of 2
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>
2018-08-23 09:56:28 -07:00
..
Makefile ice: Add stats and ethtool support 2018-03-26 12:11:19 -07:00
ice.h ice: Report stats for allocated queues via ethtool stats 2018-08-23 09:49:16 -07:00
ice_adminq_cmd.h ice: Fix multiple static analyser warnings 2018-08-23 09:20:36 -07:00
ice_common.c ice: Fix multiple static analyser warnings 2018-08-23 09:20:36 -07:00
ice_common.h ice: Implement filter sync, NDO operations and bump version 2018-03-26 12:41:38 -07:00
ice_controlq.c ice: Fix bugs in control queue processing 2018-08-23 09:54:24 -07:00
ice_controlq.h ice: Initialize PF and setup miscellaneous interrupt 2018-03-26 10:34:49 -07:00
ice_devids.h
ice_ethtool.c ice: Report stats for allocated queues via ethtool stats 2018-08-23 09:49:16 -07:00
ice_hw_autogen.h ice: Do not check INTEVENT bit for OICR interrupts 2018-04-24 09:03:23 -07:00
ice_lan_tx_rx.h ice: Cleanup magic number 2018-08-23 09:46:17 -07:00
ice_main.c ice: Use order_base_2 to calculate higher power of 2 2018-08-23 09:56:28 -07:00
ice_nvm.c ice: Update NVM AQ command functions 2018-05-17 09:14:09 -07:00
ice_osdep.h ice: Start hardware initialization 2018-03-26 09:59:08 -07:00
ice_sched.c ice: Remove unnecessary node owner check 2018-08-23 09:24:27 -07:00
ice_sched.h ice: Update Tx scheduler tree for VSI multi-Tx queue support 2018-03-26 12:21:42 -07:00
ice_status.h ice: Configure VSIs for Tx/Rx 2018-03-26 11:18:36 -07:00
ice_switch.c ice: Fix multiple static analyser warnings 2018-08-23 09:20:36 -07:00
ice_switch.h ice: Implement filter sync, NDO operations and bump version 2018-03-26 12:41:38 -07:00
ice_txrx.c ice: Add support for VLANs and offloads 2018-03-26 11:54:49 -07:00
ice_txrx.h ice: Add support for VLANs and offloads 2018-03-26 11:54:49 -07:00
ice_type.h ice: Implement filter sync, NDO operations and bump version 2018-03-26 12:41:38 -07:00