Commit 1fba78b6 authored by Arnaldo Carvalho de Melo's avatar Arnaldo Carvalho de Melo Committed by David S. Miller

[DCCP] ccid3: Fixup some type conversions related to rtts

Spotted by David Miller when compiling on sparc64, I reproduced it here on
parisc64, that are the only platforms to define __kernel_suseconds_t as an
'int', all the others, x86_64 and x86 included typedef it as a 'long', but from
the definition of suseconds_t it should just be an 'int' on platforms where it
is >= 32bits, it would not require all the castings from suseconds_t to (int)
when printking variables of this type, that are not needed on parisc64 and
sparc64.
Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@mandriva.com>
parent 9e8efc82
...@@ -399,7 +399,7 @@ static void ccid3_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb) ...@@ -399,7 +399,7 @@ static void ccid3_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb)
struct timeval now; struct timeval now;
unsigned long t_nfb; unsigned long t_nfb;
u32 pinv; u32 pinv;
long r_sample, t_elapsed; suseconds_t r_sample, t_elapsed;
BUG_ON(hctx == NULL); BUG_ON(hctx == NULL);
...@@ -446,8 +446,8 @@ static void ccid3_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb) ...@@ -446,8 +446,8 @@ static void ccid3_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb)
DCCP_BUG_ON(r_sample < 0); DCCP_BUG_ON(r_sample < 0);
if (unlikely(r_sample <= t_elapsed)) if (unlikely(r_sample <= t_elapsed))
DCCP_WARN("WARNING: r_sample=%ldus <= t_elapsed=%ldus\n", DCCP_WARN("WARNING: r_sample=%dus <= t_elapsed=%dus\n",
r_sample, t_elapsed); (int)r_sample, (int)t_elapsed);
else else
r_sample -= t_elapsed; r_sample -= t_elapsed;
CCID3_RTT_SANITY_CHECK(r_sample); CCID3_RTT_SANITY_CHECK(r_sample);
...@@ -474,8 +474,8 @@ static void ccid3_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb) ...@@ -474,8 +474,8 @@ static void ccid3_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb)
ccid3_update_send_time(hctx); ccid3_update_send_time(hctx);
ccid3_pr_debug("%s(%p), s=%u, w_init=%llu, " ccid3_pr_debug("%s(%p), s=%u, w_init=%llu, "
"R_sample=%ldus, X=%u\n", dccp_role(sk), "R_sample=%dus, X=%u\n", dccp_role(sk),
sk, hctx->ccid3hctx_s, w_init, r_sample, sk, hctx->ccid3hctx_s, w_init, (int)r_sample,
(unsigned)(hctx->ccid3hctx_x >> 6)); (unsigned)(hctx->ccid3hctx_x >> 6));
ccid3_hc_tx_set_state(sk, TFRC_SSTATE_FBACK); ccid3_hc_tx_set_state(sk, TFRC_SSTATE_FBACK);
...@@ -491,9 +491,9 @@ static void ccid3_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb) ...@@ -491,9 +491,9 @@ static void ccid3_hc_tx_packet_recv(struct sock *sk, struct sk_buff *skb)
hctx->ccid3hctx_p); hctx->ccid3hctx_p);
ccid3_hc_tx_update_x(sk, &now); ccid3_hc_tx_update_x(sk, &now);
ccid3_pr_debug("%s(%p), RTT=%uus (sample=%ldus), s=%u, " ccid3_pr_debug("%s(%p), RTT=%uus (sample=%dus), s=%u, "
"p=%u, X_calc=%u, X_recv=%u, X=%u\n", dccp_role(sk), "p=%u, X_calc=%u, X_recv=%u, X=%u\n", dccp_role(sk),
sk, hctx->ccid3hctx_rtt, r_sample, sk, hctx->ccid3hctx_rtt, (int)r_sample,
hctx->ccid3hctx_s, hctx->ccid3hctx_p, hctx->ccid3hctx_s, hctx->ccid3hctx_p,
hctx->ccid3hctx_x_calc, hctx->ccid3hctx_x_calc,
(unsigned)(hctx->ccid3hctx_x_recv >> 6), (unsigned)(hctx->ccid3hctx_x_recv >> 6),
...@@ -821,8 +821,8 @@ static u32 ccid3_hc_rx_calc_first_li(struct sock *sk) ...@@ -821,8 +821,8 @@ static u32 ccid3_hc_rx_calc_first_li(struct sock *sk)
DCCP_BUG_ON(delta < 0); DCCP_BUG_ON(delta < 0);
rtt = delta * 4 / interval; rtt = delta * 4 / interval;
ccid3_pr_debug("%s(%p), approximated RTT to %ldus\n", ccid3_pr_debug("%s(%p), approximated RTT to %dus\n",
dccp_role(sk), sk, rtt); dccp_role(sk), sk, (int)rtt);
/* /*
* Determine the length of the first loss interval via inverse lookup. * Determine the length of the first loss interval via inverse lookup.
......
...@@ -52,12 +52,12 @@ ...@@ -52,12 +52,12 @@
#define TFRC_T_MBI 64 #define TFRC_T_MBI 64
/* What we think is a reasonable upper limit on RTT values */ /* What we think is a reasonable upper limit on RTT values */
#define CCID3_SANE_RTT_MAX (4 * USEC_PER_SEC) #define CCID3_SANE_RTT_MAX ((suseconds_t)(4 * USEC_PER_SEC))
#define CCID3_RTT_SANITY_CHECK(rtt) do { \ #define CCID3_RTT_SANITY_CHECK(rtt) do { \
if (rtt > CCID3_SANE_RTT_MAX) { \ if (rtt > CCID3_SANE_RTT_MAX) { \
DCCP_CRIT("RTT (%ld) too large, substituting %ld", \ DCCP_CRIT("RTT (%d) too large, substituting %d", \
rtt, CCID3_SANE_RTT_MAX); \ (int)rtt, (int)CCID3_SANE_RTT_MAX); \
rtt = CCID3_SANE_RTT_MAX; \ rtt = CCID3_SANE_RTT_MAX; \
} } while (0) } } while (0)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment