aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org>2007-04-24 19:21:38 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-04-26 01:29:49 -0400
commit84299b3bc4eaedc0734fcc9052b01291e44445fc (patch)
treea66254a9d648ec93334abbb058a376e7482e80d5
parent1f9eda7e2b67898fb8e79b3aa3880211b51235e6 (diff)
[TCP]: Fix linkage errors on i386.
To avoid raw division, use ktime_to_timeval() to get usec. Signed-off-by: YOSHIFUJI Hideaki <yoshfuji@linux-ipv6.org> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--include/linux/ktime.h6
-rw-r--r--net/ipv4/tcp_illinois.c2
-rw-r--r--net/ipv4/tcp_lp.c2
-rw-r--r--net/ipv4/tcp_vegas.c2
-rw-r--r--net/ipv4/tcp_veno.c2
5 files changed, 10 insertions, 4 deletions
diff --git a/include/linux/ktime.h b/include/linux/ktime.h
index 248305bb9a18..81bb9c7a4eb3 100644
--- a/include/linux/ktime.h
+++ b/include/linux/ktime.h
@@ -259,6 +259,12 @@ static inline s64 ktime_to_ns(const ktime_t kt)
259 259
260#endif 260#endif
261 261
262static inline s64 ktime_to_us(const ktime_t kt)
263{
264 struct timeval tv = ktime_to_timeval(kt);
265 return (s64) tv.tv_sec * USEC_PER_SEC + tv.tv_usec;
266}
267
262/* 268/*
263 * The resolution of the clocks. The resolution value is returned in 269 * The resolution of the clocks. The resolution value is returned in
264 * the clock_getres() system call to give application programmers an 270 * the clock_getres() system call to give application programmers an
diff --git a/net/ipv4/tcp_illinois.c b/net/ipv4/tcp_illinois.c
index 8e3165917f72..4adc47c55351 100644
--- a/net/ipv4/tcp_illinois.c
+++ b/net/ipv4/tcp_illinois.c
@@ -90,7 +90,7 @@ static void tcp_illinois_acked(struct sock *sk, u32 pkts_acked, ktime_t last)
90 90
91 ca->acked = pkts_acked; 91 ca->acked = pkts_acked;
92 92
93 rtt = ktime_to_ns(net_timedelta(last)) / NSEC_PER_USEC; 93 rtt = ktime_to_us(net_timedelta(last));
94 94
95 /* ignore bogus values, this prevents wraparound in alpha math */ 95 /* ignore bogus values, this prevents wraparound in alpha math */
96 if (rtt > RTT_MAX) 96 if (rtt > RTT_MAX)
diff --git a/net/ipv4/tcp_lp.c b/net/ipv4/tcp_lp.c
index b4e062ab24a1..43294ad9f63e 100644
--- a/net/ipv4/tcp_lp.c
+++ b/net/ipv4/tcp_lp.c
@@ -266,7 +266,7 @@ static void tcp_lp_pkts_acked(struct sock *sk, u32 num_acked, ktime_t last)
266 struct tcp_sock *tp = tcp_sk(sk); 266 struct tcp_sock *tp = tcp_sk(sk);
267 struct lp *lp = inet_csk_ca(sk); 267 struct lp *lp = inet_csk_ca(sk);
268 268
269 tcp_lp_rtt_sample(sk, ktime_to_ns(net_timedelta(last)) / NSEC_PER_USEC); 269 tcp_lp_rtt_sample(sk, ktime_to_us(net_timedelta(last)));
270 270
271 /* calc inference */ 271 /* calc inference */
272 if (tcp_time_stamp > tp->rx_opt.rcv_tsecr) 272 if (tcp_time_stamp > tp->rx_opt.rcv_tsecr)
diff --git a/net/ipv4/tcp_vegas.c b/net/ipv4/tcp_vegas.c
index 0f0ee7f732c3..73e19cf7df21 100644
--- a/net/ipv4/tcp_vegas.c
+++ b/net/ipv4/tcp_vegas.c
@@ -118,7 +118,7 @@ void tcp_vegas_pkts_acked(struct sock *sk, u32 cnt, ktime_t last)
118 u32 vrtt; 118 u32 vrtt;
119 119
120 /* Never allow zero rtt or baseRTT */ 120 /* Never allow zero rtt or baseRTT */
121 vrtt = (ktime_to_ns(net_timedelta(last)) / NSEC_PER_USEC) + 1; 121 vrtt = ktime_to_us(net_timedelta(last)) + 1;
122 122
123 /* Filter to find propagation delay: */ 123 /* Filter to find propagation delay: */
124 if (vrtt < vegas->baseRTT) 124 if (vrtt < vegas->baseRTT)
diff --git a/net/ipv4/tcp_veno.c b/net/ipv4/tcp_veno.c
index 0b50d0607a0e..9edb340f2f95 100644
--- a/net/ipv4/tcp_veno.c
+++ b/net/ipv4/tcp_veno.c
@@ -75,7 +75,7 @@ static void tcp_veno_pkts_acked(struct sock *sk, u32 cnt, ktime_t last)
75 u32 vrtt; 75 u32 vrtt;
76 76
77 /* Never allow zero rtt or baseRTT */ 77 /* Never allow zero rtt or baseRTT */
78 vrtt = (ktime_to_ns(net_timedelta(last)) / NSEC_PER_USEC) + 1; 78 vrtt = ktime_to_us(net_timedelta(last)) + 1;
79 79
80 /* Filter to find propagation delay: */ 80 /* Filter to find propagation delay: */
81 if (vrtt < veno->basertt) 81 if (vrtt < veno->basertt)