]> Pileus Git - ~andy/linux/blobdiff - arch/tile/lib/checksum.c
Merge tag 'writeback-proportions' of git://git.kernel.org/pub/scm/linux/kernel/git...
[~andy/linux] / arch / tile / lib / checksum.c
index e4bab5bd3f316a54d050e56abe14bc31ba31aaff..c3ca3e64d9d906b453a6be36979ef8d5e976447a 100644 (file)
 #include <net/checksum.h>
 #include <linux/module.h>
 
-static inline unsigned int longto16(unsigned long x)
-{
-       unsigned long ret;
-#ifdef __tilegx__
-       ret = __insn_v2sadu(x, 0);
-       ret = __insn_v2sadu(ret, 0);
-#else
-       ret = __insn_sadh_u(x, 0);
-       ret = __insn_sadh_u(ret, 0);
-#endif
-       return ret;
-}
-
 __wsum do_csum(const unsigned char *buff, int len)
 {
        int odd, count;
@@ -94,7 +81,7 @@ __wsum do_csum(const unsigned char *buff, int len)
        }
        if (len & 1)
                result += *buff;
-       result = longto16(result);
+       result = csum_long(result);
        if (odd)
                result = swab16(result);
 out: