lkml.org 
[lkml]   [2006]   [Nov]   [13]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
DateMon, 13 Nov 2006 09:25:15 +0000
FromAl Viro <>
SubjectRe: [patch] fix up generic csum_ipv6_magic function prototype
On Mon, Nov 13, 2006 at 09:12:22AM +0000, Russell King wrote:
> On Mon, Nov 13, 2006 at 08:52:23AM +0000, Al Viro wrote:
> > After doing the above we have the following:
> > Platform-dependent:
> > __wsum csum_tcpudp_nofold(__be32, __be32, T1, T2, __wsum);
> > On arm/arm26: T1 = unsigned short, T2 = unsigned int.
> > __sum16 csum_tcpudp_magic(__be32, __be32, unsigned short, T, __wsum);
> > On arm/arm26 T is unsigned int, elsewhere it's unsigned short.
> 
> Could both become unsigned short or unsigned int.  Would prefer
> unsigned int on ARM, since otherwise the compiler generate code to
> truncate any variable "int"s to an unsigned short.

Frankly, as for the generated code...  I'd expect s/htons(len)/len * 256/
and the same for proto in there to have much more effect.  And it does give
the same checksum...
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-11-13 10:27    [from the cache]
©2003-2008