提交 958c492c 编写于 作者: G Govindarajulu Varadarajan 提交者: David S. Miller

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
7c2ce6e6 "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: 7c2ce6e6 ("enic: Add support for adaptive interrupt coalescing")
Reported-by: NJim 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: NGovindarajulu Varadarajan <_govind@gmx.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 484611e5
...@@ -1217,7 +1217,7 @@ static void enic_calc_int_moderation(struct enic *enic, struct vnic_rq *rq) ...@@ -1217,7 +1217,7 @@ static void enic_calc_int_moderation(struct enic *enic, struct vnic_rq *rq)
*/ */
traffic <<= 3; traffic <<= 3;
traffic /= delta; traffic = delta > UINT_MAX ? 0 : traffic / (u32)delta;
for (index = 0; index < ENIC_MAX_COALESCE_TIMERS; index++) for (index = 0; index < ENIC_MAX_COALESCE_TIMERS; index++)
if (traffic < mod_table[index].rx_rate) if (traffic < mod_table[index].rx_rate)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册