[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4807377b0703131622w5dde4304v63fd941f74719a27@mail.gmail.com>
Date: Tue, 13 Mar 2007 16:22:37 -0700
From: "Jesse Brandeburg" <jesse.brandeburg@...il.com>
To: "Arnaldo Carvalho de Melo" <acme@...stprotocols.net>
Cc: "David Miller" <davem@...emloft.net>,
"Netdev List" <netdev@...r.kernel.org>
Subject: Re: [PATCH 09/15] [TCP]: Introduce tcp_hdrlen() and tcp_optlen()
On 3/13/07, Arnaldo Carvalho de Melo <acme@...stprotocols.net> wrote:
> Introduce tcp_hdrlen() and tcp_optlen():
> The ip_hdrlen() buddy, created to reduce the number of skb->h.th-> uses and to
> avoid the longer, open coded equivalent.
+static inline unsigned int tcp_hdrlen(const struct sk_buff *skb)
+{
+ return skb->h.th->doff * 4;
+}
+
+static inline unsigned int tcp_optlen(const struct sk_buff *skb)
+{
+ return (skb->h.th->doff - 5) * 4;
+}
acme, good stuff, but does the " * 4" generate equivalent assembly
with gcc 3/4 as " << 2" ?
I could assume that the compiler would be smart enough, but every time
I assume I know what the compiler is doing I get myself in trouble.
-
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