Skip to content

Commit

Permalink
enic: Fix 64 bit divide on 32bit system
Browse files Browse the repository at this point in the history
Division of a 32 bit number by a 64 bit number causes the following link
error introduced by
7c2ce6e "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: 7c2ce6e ("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>
  • Loading branch information
Govindarajulu Varadarajan authored and David S. Miller committed May 30, 2014
1 parent 484611e commit 958c492
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/ethernet/cisco/enic/enic_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 958c492

Please sign in to comment.