igbvf: fix divide by zero
authorMitch A Williams <mitch.a.williams@intel.com>
Sat, 30 Jun 2012 00:23:19 +0000 (00:23 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sun, 1 Jul 2012 00:40:45 +0000 (17:40 -0700)
commit0e90b49ca4b891f085b57559a3071a4feefb496c
treef34c038e177f5ab0779870b6d2a40e0b155bc515
parent0c12d91b7064e16e96939243187b12fbd99caac7
igbvf: fix divide by zero

Using ethtool -C ethX rx-usecs 0 crashes with a divide by zero.
Refactor this function to fix this issue and make it more clear
what the intent of each conditional is. Add comment regarding
using a setting of zero.

CC: stable <stable@vger.kernel.org> [3.3+]
CC: David Ahern <daahern@cisco.com>
Signed-off-by: Mitch Williams <mitch.a.williams@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/intel/igbvf/ethtool.c