Commit 20c1f641bb80fb272dec959a5caabed92e5a422e

Authored by Arnd Bergmann
1 parent c44ba9f668

lib/checksum.c: make do_csum optional

Mike Frysinger suggested that do_csum should be optional
so that an architecture can use the generic checksum code
but still provide an optimized fast-path for the most
critical function.

This can mean an implementation using inline assembly,
or in case of Alpha one using 64-bit arithmetic in C.

Cc: Mike Frysinger <vapier@gentoo.org>
Signed-off-by: Arnd Bergmann <arnd@arndb.de>

Showing 1 changed file with 2 additions and 0 deletions Side-by-side Diff

... ... @@ -37,6 +37,7 @@
37 37  
38 38 #include <asm/byteorder.h>
39 39  
  40 +#ifndef do_csum
40 41 static inline unsigned short from32to16(unsigned int x)
41 42 {
42 43 /* add up 16-bit and 16-bit for 16+c bit */
... ... @@ -102,6 +103,7 @@
102 103 out:
103 104 return result;
104 105 }
  106 +#endif
105 107  
106 108 /*
107 109 * This is a version of ip_compute_csum() optimized for IP headers,