igbvf: fix divide by zero
authorMitch A Williams <mitch.a.williams@intel.com>
Sat, 30 Jun 2012 00:23:19 +0000 (00:23 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 16 Jul 2012 16:04:22 +0000 (09:04 -0700)
commit002aea347be398407f6e4eb7f08d754ce4f8dd71
treec93f63c20ec9289dedc586534554fb99b17ead8a
parent3f616017b684a5faf29b7a6b7b100209357136e4
igbvf: fix divide by zero

commit 0e90b49ca4b891f085b57559a3071a4feefb496c upstream.

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: 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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/intel/igbvf/ethtool.c