linux/drivers/net/ethernet/intel
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
..
e1000 treewide: kmalloc() -> kmalloc_array() 2018-06-12 16:19:22 -07:00
e1000e treewide: kzalloc() -> kcalloc() 2018-06-12 16:19:22 -07:00
fm10k treewide: Use array_size() in vmalloc() 2018-06-12 16:19:22 -07:00
i40e i40e_txrx: mark expected switch fall-through 2018-08-07 17:54:20 -07:00
i40evf i40e: Add AQ command for rearrange NVM structure 2018-08-07 12:20:45 -07:00
ice ice: Use order_base_2 to calculate higher power of 2 2018-08-23 09:56:28 -07:00
igb pci-v4.19-changes 2018-08-16 09:21:54 -07:00
igbvf igbvf: netdev: Mark expected switch fall-through 2018-08-07 17:54:20 -07:00
ixgb treewide: kmalloc() -> kmalloc_array() 2018-06-12 16:19:22 -07:00
ixgbe net_sched: remove list_head from tc_action 2018-08-21 12:45:44 -07:00
ixgbevf xdp: don't make drivers report attachment mode 2018-07-13 20:26:35 +02:00
e100.c net: intel: Cleanup the copyright/license headers 2018-04-27 14:00:04 -04:00
Kconfig docs: Fix more broken references 2018-06-15 18:11:26 -03:00
Makefile ice: Add basic driver framework for Intel(R) E800 Series 2018-03-26 08:28:02 -07:00