summaryrefslogtreecommitdiff
path: root/drivers/net/ethernet/cisco
diff options
context:
space:
mode:
authorGovindarajulu Varadarajan <_govind@gmx.com>2014-05-26 14:22:43 +0400
committerDavid S. Miller <davem@davemloft.net>2014-05-31 02:54:46 +0400
commit958c492c55bff6fa0b3430e9824dc83597c88aa6 (patch)
tree836e214022fcb670f7350e02284ef407dfcd761f /drivers/net/ethernet/cisco
parent484611e53047b55163822bfe60424a55a31775b3 (diff)
downloadlinux-958c492c55bff6fa0b3430e9824dc83597c88aa6.tar.xz
enic: Fix 64 bit divide on 32bit system
Division of a 32 bit number by a 64 bit number causes the following link error introduced by 7c2ce6e60f703 "enic: Add support for adaptive interrupt coalescing" drivers/built-in.o: In function `enic_poll_msix': enic_main.c:(.text+0x48710a): undefined reference to `__udivdi3' make: *** [vmlinux] Error 1 Since numerator is 32 bit, convert denominator to 32 bit accordingly. Fixes: 7c2ce6e60f703 ("enic: Add support for adaptive interrupt coalescing") Reported-by: Jim Davis <jim.epost@gmail.com> Cc: Christian Benvenuti <benve@cisco.com> Cc: Sujith Sankar <ssujith@cisco.com> Cc: Neel Patel <neepatel@cisco.com> Signed-off-by: Govindarajulu Varadarajan <_govind@gmx.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/cisco')
-rw-r--r--drivers/net/ethernet/cisco/enic/enic_main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/ethernet/cisco/enic/enic_main.c b/drivers/net/ethernet/cisco/enic/enic_main.c
index 0d8995cc92ed..d5a220d5bad1 100644
--- a/drivers/net/ethernet/cisco/enic/enic_main.c
+++ b/drivers/net/ethernet/cisco/enic/enic_main.c
@@ -1217,7 +1217,7 @@ static void enic_calc_int_moderation(struct enic *enic, struct vnic_rq *rq)
*/
traffic <<= 3;
- traffic /= delta;
+ traffic = delta > UINT_MAX ? 0 : traffic / (u32)delta;
for (index = 0; index < ENIC_MAX_COALESCE_TIMERS; index++)
if (traffic < mod_table[index].rx_rate)