]> git.baikalelectronics.ru Git - kernel.git/commit
[IA64] tidy up return value of ip_fast_csum
authorChen, Kenneth W <kenneth.w.chen@intel.com>
Thu, 9 Nov 2006 00:29:25 +0000 (16:29 -0800)
committerTony Luck <tony.luck@intel.com>
Thu, 7 Dec 2006 19:19:59 +0000 (11:19 -0800)
commitcb5cb2ccd2c6044ef45b8cc895d66511ec58fdf7
treeecf26fe7da3e261e81a878942604aca3c9fe7e2d
parent091c13b8e25d7c47253551b6bc62ab0c9bf018a1
[IA64] tidy up return value of ip_fast_csum

While working on implementing csum_ipv6_magic, I noticed that current
version of ip_fast_csum will potentially return bits above "unsigned
short" as 1.  While no harm is done right now because all call sites
will chop off the upper bits when it uses the return value.  However,
this is still dangerous and buggy.  Here is a patch to enforce that the
function really returns unsigned short in the native register format.

The fix is free as there are plenty open slot to add one more asm instruction.

Signed-off-by: Ken Chen <kenneth.w.chen@intel.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>
arch/ia64/lib/ip_fast_csum.S