Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=84299b3bc4eaedc0734fcc9052b01291e44445fc
Commit:     84299b3bc4eaedc0734fcc9052b01291e44445fc
Parent:     1f9eda7e2b67898fb8e79b3aa3880211b51235e6
Author:     YOSHIFUJI Hideaki <[EMAIL PROTECTED]>
AuthorDate: Tue Apr 24 16:21:38 2007 -0700
Committer:  David S. Miller <[EMAIL PROTECTED]>
CommitDate: Wed Apr 25 22:29:49 2007 -0700

    [TCP]: Fix linkage errors on i386.
    
    To avoid raw division, use ktime_to_timeval() to get usec.
    
    Signed-off-by: YOSHIFUJI Hideaki <[EMAIL PROTECTED]>
    Signed-off-by: David S. Miller <[EMAIL PROTECTED]>
---
 include/linux/ktime.h   |    6 ++++++
 net/ipv4/tcp_illinois.c |    2 +-
 net/ipv4/tcp_lp.c       |    2 +-
 net/ipv4/tcp_vegas.c    |    2 +-
 net/ipv4/tcp_veno.c     |    2 +-
 5 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/include/linux/ktime.h b/include/linux/ktime.h
index 248305b..81bb9c7 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)
 
 #endif
 
+static inline s64 ktime_to_us(const ktime_t kt)
+{
+       struct timeval tv = ktime_to_timeval(kt);
+       return (s64) tv.tv_sec * USEC_PER_SEC + tv.tv_usec;
+}
+
 /*
  * The resolution of the clocks. The resolution value is returned in
  * 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 8e31659..4adc47c 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)
 
        ca->acked = pkts_acked;
 
-       rtt = ktime_to_ns(net_timedelta(last)) / NSEC_PER_USEC;
+       rtt = ktime_to_us(net_timedelta(last));
 
        /* ignore bogus values, this prevents wraparound in alpha math */
        if (rtt > RTT_MAX)
diff --git a/net/ipv4/tcp_lp.c b/net/ipv4/tcp_lp.c
index b4e062a..43294ad 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)
        struct tcp_sock *tp = tcp_sk(sk);
        struct lp *lp = inet_csk_ca(sk);
 
-       tcp_lp_rtt_sample(sk,  ktime_to_ns(net_timedelta(last)) / 
NSEC_PER_USEC);
+       tcp_lp_rtt_sample(sk,  ktime_to_us(net_timedelta(last)));
 
        /* calc inference */
        if (tcp_time_stamp > tp->rx_opt.rcv_tsecr)
diff --git a/net/ipv4/tcp_vegas.c b/net/ipv4/tcp_vegas.c
index 0f0ee7f..73e19cf 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)
        u32 vrtt;
 
        /* Never allow zero rtt or baseRTT */
-       vrtt = (ktime_to_ns(net_timedelta(last)) / NSEC_PER_USEC) + 1;
+       vrtt = ktime_to_us(net_timedelta(last)) + 1;
 
        /* Filter to find propagation delay: */
        if (vrtt < vegas->baseRTT)
diff --git a/net/ipv4/tcp_veno.c b/net/ipv4/tcp_veno.c
index 0b50d06..9edb340 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)
        u32 vrtt;
 
        /* Never allow zero rtt or baseRTT */
-       vrtt = (ktime_to_ns(net_timedelta(last)) / NSEC_PER_USEC) + 1;
+       vrtt = ktime_to_us(net_timedelta(last)) + 1;
 
        /* Filter to find propagation delay: */
        if (vrtt < veno->basertt)
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to