Thread (4 messages) flat view 4 messages, 3 authors, 2012-05-17

Re: [PATCH net-next] tcp: bool conversions

From: Eric Dumazet <hidden>
Date: 2012-05-17 15:47:01

On Thu, 2012-05-17 at 13:46 +0100, Ben Hutchings wrote:
On Thu, 2012-05-17 at 11:15 +0200, Eric Dumazet wrote:
quoted
From: Eric Dumazet <edumazet@google.com>

bool conversions where possible.
There's a bit more than bool conversions here:

[...]
quoted
--- a/net/ipv4/tcp_hybla.c
+++ b/net/ipv4/tcp_hybla.c
[...]
quoted
@@ -24,8 +24,7 @@ struct hybla {
 	u32   minrtt;	      /* Minimum smoothed round trip time value seen */
 };
 
-/* Hybla reference round trip time (default= 1/40 sec = 25 ms),
-   expressed in jiffies */
+/* Hybla reference round trip time (default= 1/40 sec = 25 ms), in ms */
 static int rtt0 = 25;
 module_param(rtt0, int, 0644);
 MODULE_PARM_DESC(rtt0, "reference rout trip time (ms)");
@@ -39,7 +38,7 @@ static inline void hybla_recalc_param (struct sock *sk)
 	ca->rho_3ls = max_t(u32, tcp_sk(sk)->srtt / msecs_to_jiffies(rtt0), 8);
 	ca->rho = ca->rho_3ls >> 3;
 	ca->rho2_7ls = (ca->rho_3ls * ca->rho_3ls) << 1;
-	ca->rho2 = ca->rho2_7ls >>7;
+	ca->rho2 = ca->rho2_7ls >> 7;
 }
 
 static void hybla_init(struct sock *sk)
[...] 
quoted
@@ -67,6 +66,7 @@ static void hybla_init(struct sock *sk)
 static void hybla_state(struct sock *sk, u8 ca_state)
 {
 	struct hybla *ca = inet_csk_ca(sk);
+
 	ca->hybla_en = (ca_state == TCP_CA_Open);
 }
 
[...]
quoted
--- a/net/ipv4/tcp_minisocks.c
+++ b/net/ipv4/tcp_minisocks.c
[...]
quoted
-static __inline__ int tcp_in_window(u32 seq, u32 end_seq, u32 s_win, u32 e_win)
+static bool tcp_in_window(u32 seq, u32 end_seq, u32 s_win, u32 e_win)
 { 
[...]
quoted
--- a/net/ipv4/tcp_output.c
+++ b/net/ipv4/tcp_output.c
[...]
quoted
 /* Does at least the first segment of SKB fit into the send window? */
-static inline int tcp_snd_wnd_test(const struct tcp_sock *tp, const struct sk_buff *skb,
-				   unsigned int cur_mss)
+static bool tcp_snd_wnd_test(const struct tcp_sock *tp,
+			     const struct sk_buff *skb,
+			     unsigned int cur_mss)
[...]

You got me ;)

99 % of the patch is about bool conversion.

I have no problem removing the spaces/inline parts.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help