[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4B4CB46C.8020502@gmail.com>
Date: Tue, 12 Jan 2010 12:42:04 -0500
From: William Allen Simpson <william.allen.simpson@...il.com>
To: Eric Dumazet <eric.dumazet@...il.com>
CC: Linux Kernel Developers <linux-kernel@...r.kernel.org>,
Linux Kernel Network Developers <netdev@...r.kernel.org>,
Michael Chan <mchan@...adcom.com>
Subject: Re: [PATCH 1/2] net: tcp_header_len_th and tcp_option_len_th
Eric Dumazet wrote:
> Its better to inline your patches so that we can comment them, without copy/paste
>
> When I hit 'reply to', my mailer only quoted the ChangeLog, not the patch.
>
Seeing that we're both using Mozilla, how to you do it?
It took me many attempts to get this to work with Thunderbird on the Mac.
> Anyway ..
>
> +/* Length of standard options only. This could be negative. */
> +static inline int tcp_option_len_th(const struct tcphdr *th)
> +{
> + return (int)(th->doff * 4) - sizeof(*th);
> +}
>
>
> The (int) cast is not necessary, since the function returns a signed int
>
> ->
> return th->doff * 4 - sizeof(*th);
>
Then GCC must be smarter than it was in the past, as doff is an __u16
bit slice -- once upon a time, a cast was required before subtraction.
One of the dis/advantages of C programming for 30+ years is that my
fingers remember some fairly old practices....
(But this still works properly!)
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists