From: Arnd Bergmann Date: Tue, 23 Jun 2009 19:37:26 +0000 (+0200) Subject: lib/checksum.c: make do_csum optional X-Git-Tag: firefly_0821_release~9833^2~3881^2~5 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=20c1f641bb80fb272dec959a5caabed92e5a422e;p=firefly-linux-kernel-4.4.55.git 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 Signed-off-by: Arnd Bergmann --- diff --git a/lib/checksum.c b/lib/checksum.c index 886b48db4f28..b08c2d059024 100644 --- a/lib/checksum.c +++ b/lib/checksum.c @@ -37,6 +37,7 @@ #include +#ifndef do_csum static inline unsigned short from32to16(unsigned int x) { /* add up 16-bit and 16-bit for 16+c bit */ @@ -102,6 +103,7 @@ static unsigned int do_csum(const unsigned char *buff, int len) out: return result; } +#endif /* * This is a version of ip_compute_csum() optimized for IP headers,