diff mbox

[v2,net-next] ipv4: Fix compilation errors in fib_rebalance

Message ID 1444109087-30676-1-git-send-email-pch@ordbogen.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Peter Christensen Oct. 6, 2015, 5:24 a.m. UTC
This fixes

net/built-in.o: In function `fib_rebalance':
fib_semantics.c:(.text+0x9df14): undefined reference to `__divdi3'

and

net/built-in.o: In function `fib_rebalance':
net/ipv4/fib_semantics.c:572: undefined reference to `__aeabi_ldivmod'

Fixes: 0e884c78ee19 ("ipv4: L3 hash-based multipath")

Signed-off-by: Peter Nørlund <pch@ordbogen.com>
---
 net/ipv4/fib_semantics.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

David Miller Oct. 6, 2015, 6:48 a.m. UTC | #1
From: Peter Nørlund <pch@ordbogen.com>
Date: Tue,  6 Oct 2015 07:24:47 +0200

> This fixes
> 
> net/built-in.o: In function `fib_rebalance':
> fib_semantics.c:(.text+0x9df14): undefined reference to `__divdi3'
> 
> and
> 
> net/built-in.o: In function `fib_rebalance':
> net/ipv4/fib_semantics.c:572: undefined reference to `__aeabi_ldivmod'
> 
> Fixes: 0e884c78ee19 ("ipv4: L3 hash-based multipath")
> 
> Signed-off-by: Peter Nørlund <pch@ordbogen.com>

Applied, thanks.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/net/ipv4/fib_semantics.c b/net/ipv4/fib_semantics.c
index 0c49d2f..7bd698c 100644
--- a/net/ipv4/fib_semantics.c
+++ b/net/ipv4/fib_semantics.c
@@ -569,8 +569,8 @@  static void fib_rebalance(struct fib_info *fi)
 			upper_bound = -1;
 		} else {
 			w += nexthop_nh->nh_weight;
-			upper_bound = DIV_ROUND_CLOSEST(2147483648LL * w,
-							total) - 1;
+			upper_bound = DIV_ROUND_CLOSEST_ULL((u64)w << 31,
+							    total) - 1;
 		}
 
 		atomic_set(&nexthop_nh->nh_upper_bound, upper_bound);