Subject: Re: [PATCH 1/2] net: tcp_header_len_th and tcp_option_len_th

From: Eric Dumazet <[email-masked]>
Date: Tue, 12 Jan 2010 11:40:30 +0100

Le 06/01/2010 22:28, William Allen Simpson a écrit :
> Redefine two TCP header functions to accept TCP header pointer.
> When subtracting, return signed int to allow error checking.
> 
> These functions will be used in subsequent patches that implement
> additional features.
> 
> Signed-off-by: [email-masked]
> ---
>  include/linux/tcp.h |   12 ++++++++++++
>  1 files changed, 12 insertions(+), 0 deletions(-)
> 

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.

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);