From: "Ilpo_Järvinen" <[EMAIL PROTECTED]>
Date: Mon, 31 Dec 2007 12:47:51 +0200

> Signed-off-by: Ilpo Järvinen <[EMAIL PROTECTED]>
 ...
>  
> -     in_flight = tcp_packets_in_flight(tp);
> -     cwnd = tp->snd_cwnd;
> -     if (in_flight < cwnd)
> -             return (cwnd - in_flight);
> +     if (tcp_packets_in_flight(tp) < tp->snd_cwnd)
> +             return tp->snd_cwnd - tcp_packets_in_flight(tp);
>  

I don't know about this one.

Although tcp_packets_in_flight() is inline and the compiler
should CSE the first call into a local register and not
redo the calculation:

1) That isn't something to rely upon.  The compiler might look
   at a function or set of functions in this file and decide
   to not inline tcp_packets_in_flight() or not see the CSE
   opportunity and that the second call is redundant.

2) If we stop inlining tcp_packets_in_flight() then nobody, and I
   mean nobody, is going to remember to come back here and
   add back the code to put the result in a local variable.

So best to keep the local vars here.

I also think the code is clearer that way too.

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to