Skip to contentSkip to conversation

remove csum_partial_copy

PATCH In review Rob Radez 2 participants 2 messages Oct 14, 2002 – Oct 15, 2002

Subsystems (5)
lore
Share & tools
lore

Rob Radez

author
#0 lore raw

PATCH 1/1 remove csum_partial_copy

Hi,
The attached patch against 2.5.42 removes csum_partial_copy. It's on top of a patch that I just sent to Dave removing csum_partial_copy_fromuser. Does it look alright to people? Arch maintainers? Dave?

Regards,
Rob Radez

arch/alpha/kernel/alpha_ksyms.c +0 -1
diff -ruN linux-2.5.42-fromuser/arch/alpha/kernel/alpha_ksyms.c linux-2.5.42-cpc/arch/alpha/kernel/alpha_ksyms.c
@@ -167,7 +167,6 @@
 EXPORT_SYMBOL(csum_tcpudp_magic);
 EXPORT_SYMBOL(ip_compute_csum);
 EXPORT_SYMBOL(ip_fast_csum);
-EXPORT_SYMBOL(csum_partial_copy);
 EXPORT_SYMBOL(csum_partial_copy_nocheck);
 EXPORT_SYMBOL(csum_partial_copy_from_user);
 EXPORT_SYMBOL(csum_ipv6_magic);
arch/alpha/lib/csum_partial_copy.c +0 -13
diff -ruN linux-2.5.42-fromuser/arch/alpha/lib/csum_partial_copy.c linux-2.5.42-cpc/arch/alpha/lib/csum_partial_copy.c
@@ -385,16 +385,3 @@
 {
 	return do_csum_partial_copy_from_user(src, dst, len, sum, NULL);
 }
-
-unsigned int
-csum_partial_copy (const char *src, char *dst, int len, unsigned int sum)
-{
-	unsigned int ret;
-	int error = 0;
-
-	ret = do_csum_partial_copy_from_user(src, dst, len, sum, &error);
-	if (error)
-		printk("csum_partial_copy_old(): tell mingo to convert me!\n");
-
-	return ret;
-}
arch/cris/lib/old_checksum.c +0 -45

48 lines not on this page · raw message

arch/i386/lib/Makefile +1 -1
diff -ruN linux-2.5.42-fromuser/arch/i386/lib/Makefile linux-2.5.42-cpc/arch/i386/lib/Makefile
@@ -4,7 +4,7 @@
 
 L_TARGET = lib.a
 
-obj-y = checksum.o old-checksum.o delay.o \
+obj-y = checksum.o delay.o \
 	usercopy.o getuser.o \
 	memcpy.o strstr.o
 
arch/i386/lib/old-checksum.c +0 -19
diff -ruN linux-2.5.42-fromuser/arch/i386/lib/old-checksum.c linux-2.5.42-cpc/arch/i386/lib/old-checksum.c
@@ -1,19 +0,0 @@
-/*
- * FIXME: old compatibility stuff, will be removed soon.
- */
-
-#include <net/checksum.h>
-
-unsigned int csum_partial_copy( const char *src, char *dst, int len, int sum)
-{
-	int src_err=0, dst_err=0;
-
-	sum = csum_partial_copy_generic ( src, dst, len, sum, &src_err, &dst_err);
-
-	if (src_err || dst_err)
-		printk("old csum_partial_copy_fromuser(), tell mingo to convert me.\n");
-
-	return sum;
-}
-
-
arch/ia64/lib/csum_partial_copy.c +0 -14
diff -ruN linux-2.5.42-fromuser/arch/ia64/lib/csum_partial_copy.c linux-2.5.42-cpc/arch/ia64/lib/csum_partial_copy.c
@@ -145,17 +145,3 @@
 {
 	return do_csum_partial_copy_from_user(src, dst, len, sum, NULL);
 }
-
-unsigned int
-csum_partial_copy (const char *src, char *dst, int len, unsigned int sum)
-{
-	unsigned int ret;
-	int error = 0;
-
-	ret = do_csum_partial_copy_from_user(src, dst, len, sum, &error);
-	if (error)
-		printk("csum_partial_copy_old(): tell mingo to convert me!\n");
-
-	return ret;
-}
-
arch/m68k/kernel/m68k_ksyms.c +1 -1
diff -ruN linux-2.5.42-fromuser/arch/m68k/kernel/m68k_ksyms.c linux-2.5.42-cpc/arch/m68k/kernel/m68k_ksyms.c
@@ -62,7 +62,7 @@
 #endif
 
 /* Networking helper routines. */
-EXPORT_SYMBOL(csum_partial_copy);
+EXPORT_SYMBOL(csum_partial_copy_nocheck);
 
 /* The following are special because they're not called
    explicitly (the C compiler generates them).  Fortunately,
arch/m68k/lib/checksum.c +1 -1
diff -ruN linux-2.5.42-fromuser/arch/m68k/lib/checksum.c linux-2.5.42-cpc/arch/m68k/lib/checksum.c
@@ -324,7 +324,7 @@
  */
 
 unsigned int
-csum_partial_copy(const char *src, char *dst, int len, int sum)
+csum_partial_copy_nocheck(const char *src, char *dst, int len, int sum)
 {
 	unsigned long tmp1, tmp2;
 	__asm__("movel %2,%4\n\t"
arch/mips/kernel/mips_ksyms.c +1 -1
diff -ruN linux-2.5.42-fromuser/arch/mips/kernel/mips_ksyms.c linux-2.5.42-cpc/arch/mips/kernel/mips_ksyms.c
@@ -80,7 +80,7 @@
 
 
 /* Networking helper routines. */
-EXPORT_SYMBOL(csum_partial_copy);
+EXPORT_SYMBOL(csum_partial_copy_nocheck);
 
 /*
  * Functions to control caches.
arch/mips/lib/csum_partial_copy.c +2 -2
diff -ruN linux-2.5.42-fromuser/arch/mips/lib/csum_partial_copy.c linux-2.5.42-cpc/arch/mips/lib/csum_partial_copy.c
@@ -25,8 +25,8 @@
 /*
  * copy while checksumming, otherwise like csum_partial
  */
-unsigned int csum_partial_copy(const char *src, char *dst, 
-                               int len, unsigned int sum)
+unsigned int csum_partial_copy_nocheck (const char *src, char *dst, 
+                                        int len, unsigned int sum)
 {
 	/*
 	 * It's 2:30 am and I don't feel like doing it real ...
arch/mips64/kernel/mips64_ksyms.c +1 -1
diff -ruN linux-2.5.42-fromuser/arch/mips64/kernel/mips64_ksyms.c linux-2.5.42-cpc/arch/mips64/kernel/mips64_ksyms.c
@@ -76,7 +76,7 @@
 
 
 /* Networking helper routines. */
-EXPORT_SYMBOL(csum_partial_copy);
+EXPORT_SYMBOL(csum_partial_copy_nocheck);
 
 /*
  * Functions to control caches.
arch/mips64/lib/csum_partial_copy.c +1 -1
diff -ruN linux-2.5.42-fromuser/arch/mips64/lib/csum_partial_copy.c linux-2.5.42-cpc/arch/mips64/lib/csum_partial_copy.c
@@ -16,7 +16,7 @@
 /*
  * copy while checksumming, otherwise like csum_partial
  */
-unsigned int csum_partial_copy(const char *src, char *dst, 
+unsigned int csum_partial_copy_nocheck(const char *src, char *dst, 
                                int len, unsigned int sum)
 {
 	/*
arch/parisc/lib/checksum.c +1 -1
diff -ruN linux-2.5.42-fromuser/arch/parisc/lib/checksum.c linux-2.5.42-cpc/arch/parisc/lib/checksum.c
@@ -97,7 +97,7 @@
 /*
  * copy while checksumming, otherwise like csum_partial
  */
-unsigned int csum_partial_copy(const char *src, char *dst, 
+unsigned int csum_partial_copy_nocheck(const char *src, char *dst, 
                                int len, unsigned int sum)
 {
 	/*
arch/sh/kernel/sh_ksyms.c +0 -3
diff -ruN linux-2.5.42-fromuser/arch/sh/kernel/sh_ksyms.c linux-2.5.42-cpc/arch/sh/kernel/sh_ksyms.c
@@ -36,9 +36,6 @@
 EXPORT_SYMBOL(irq_desc);
 EXPORT_SYMBOL(no_irq_type);
 
-/* Networking helper routines. */
-EXPORT_SYMBOL(csum_partial_copy);
-
 EXPORT_SYMBOL(strpbrk);
 EXPORT_SYMBOL(strstr);
 EXPORT_SYMBOL(strlen);
arch/sh/lib/Makefile +2 -2
diff -ruN linux-2.5.42-fromuser/arch/sh/lib/Makefile linux-2.5.42-cpc/arch/sh/lib/Makefile
@@ -3,7 +3,7 @@
 #
 
 L_TARGET = lib.a
-obj-y  = delay.o memcpy.o memset.o memmove.o memchr.o old-checksum.o \
-	 checksum.o strcasecmp.o strlen.o
+obj-y  = delay.o memcpy.o memset.o memmove.o memchr.o checksum.o \
+	 strcasecmp.o strlen.o
 
 include $(TOPDIR)/Rules.make
arch/sh/lib/old-checksum.c +0 -17
diff -ruN linux-2.5.42-fromuser/arch/sh/lib/old-checksum.c linux-2.5.42-cpc/arch/sh/lib/old-checksum.c
@@ -1,17 +0,0 @@
-/*
- * FIXME: old compatibility stuff, will be removed soon.
- */
-
-#include <net/checksum.h>
-
-unsigned int csum_partial_copy( const char *src, char *dst, int len, int sum)
-{
-	int src_err=0, dst_err=0;
-
-	sum = csum_partial_copy_generic ( src, dst, len, sum, &src_err, &dst_err);
-
-	if (src_err || dst_err)
-		printk("old csum_partial_copy_fromuser(), tell mingo to convert me.\n");
-
-	return sum;
-}
include/asm-alpha/checksum.h +3 -13
diff -ruN linux-2.5.42-fromuser/include/asm-alpha/checksum.h linux-2.5.42-cpc/include/asm-alpha/checksum.h
@@ -37,19 +37,9 @@
 extern unsigned int csum_partial(const unsigned char * buff, int len, unsigned int sum);
 
 /*
- * the same as csum_partial, but copies from src while it
- * checksums
- *
- * here even more important to align src and dst on a 32-bit (or even
- * better 64-bit) boundary
- *
- * this will go away soon.
- */
-unsigned int csum_partial_copy(const char *src, char *dst, int len, unsigned int sum);
-
-/*
- * this is a new version of the above that records errors it finds in *errp,
- * but continues and zeros the rest of the buffer.
+ * the same as csum_partial, but copies while it checksums
+ * records errors it finds in *errp, then continues and zeros the rest of the
+ * buffer.
  */
 unsigned int csum_partial_copy_from_user(const char *src, char *dst, int len, unsigned int sum, int *errp);
 
include/asm-arm/checksum.h +0 -8
diff -ruN linux-2.5.42-fromuser/include/asm-arm/checksum.h linux-2.5.42-cpc/include/asm-arm/checksum.h
@@ -38,14 +38,6 @@
 csum_partial_copy_from_user(const char *src, char *dst, int len, int sum, int *err_ptr);
 
 /*
- * This is the old (and unsafe) way of doing checksums, a warning message will
- * be printed if it is used and an exception occurs.
- *
- * this functions should go away after some time.
- */
-#define csum_partial_copy(src,dst,len,sum)	csum_partial_copy_nocheck(src,dst,len,sum)
-
-/*
  *	This is a version of ip_compute_csum() optimized for IP headers,
  *	which always checksum on 4 octet boundaries.
  */
include/asm-i386/checksum.h +0 -8
diff -ruN linux-2.5.42-fromuser/include/asm-i386/checksum.h linux-2.5.42-cpc/include/asm-i386/checksum.h
@@ -50,14 +50,6 @@
 }
 
 /*
- * This is the old (and unsafe) way of doing checksums, a warning message will
- * be printed if it is used and an exeption occurs.
- *
- * this function should go away after some time.
- */
-unsigned int csum_partial_copy( const char *src, char *dst, int len, int sum);
-
-/*
  *	This is a version of ip_compute_csum() optimized for IP headers,
  *	which always checksum on 4 octet boundaries.
  *
include/asm-ia64/checksum.h +2 -12
diff -ruN linux-2.5.42-fromuser/include/asm-ia64/checksum.h linux-2.5.42-cpc/include/asm-ia64/checksum.h
@@ -45,18 +45,8 @@
 
 /*
  * Same as csum_partial, but copies from src while it checksums.
- *
- * Here it is even more important to align src and dst on a 32-bit (or
- * even better 64-bit) boundary.
- *
- * this will go away soon.
- */
-extern unsigned int csum_partial_copy (const char *src, char *dst, int len,
-				       unsigned int sum);
-
-/*
- * This is a new version of the above that records errors it finds in
- * *errp, but continues and zeros the rest of the buffer.
+ * records errors it finds in *errp, but continues and zeros the rest of
+ * the buffer.
  */
 extern unsigned int csum_partial_copy_from_user (const char *src, char *dst,
 						 int len, unsigned int sum,
include/asm-m68k/checksum.h +1 -6
diff -ruN linux-2.5.42-fromuser/include/asm-m68k/checksum.h linux-2.5.42-cpc/include/asm-m68k/checksum.h
@@ -21,11 +21,9 @@
  *
  * here even more important to align src and dst on a 32-bit (or even
  * better 64-bit) boundary
- *
- * this will go away soon.
  */
 
-unsigned int csum_partial_copy(const char *src, char *dst, int len, int sum);
+unsigned int csum_partial_copy_nocheck(const char *src, char *dst, int len, int sum);
 
 
 /*
@@ -38,9 +36,6 @@
 extern unsigned int csum_partial_copy_from_user(const char *src, char *dst,
 						int len, int sum, int *csum_err);
 
-#define csum_partial_copy_nocheck(src, dst, len, sum)	\
-	csum_partial_copy((src), (dst), (len), (sum))
-
 /*
  *	This is a version of ip_compute_csum() optimized for IP headers,
  *	which always checksum on 4 octet boundaries.
include/asm-mips/checksum.h +2 -10
diff -ruN linux-2.5.42-fromuser/include/asm-mips/checksum.h linux-2.5.42-cpc/include/asm-mips/checksum.h
@@ -28,12 +28,6 @@
  * this is a new version of the above that records errors it finds in *errp,
  * but continues and zeros the rest of the buffer.
  */
-#define csum_partial_copy_nocheck csum_partial_copy
-
-/*
- * this is a new version of the above that records errors it finds in *errp,
- * but continues and zeros the rest of the buffer.
- */
 unsigned int csum_partial_copy_from_user(const char *src, char *dst, int len,
                                          unsigned int sum, int *errp);
 
@@ -58,11 +52,9 @@
 /*
  * the same as csum_partial, but copies from user space (but on MIPS
  * we have just one address space, so this is identical to the above)
- *
- * this is obsolete and will go away.
  */
-unsigned int csum_partial_copy(const char *src, char *dst, int len,
-			       unsigned int sum);
+unsigned int csum_partial_copy_nocheck(const char *src, char *dst, int len,
+				       unsigned int sum);
 
 /*
  *	Fold a partial checksum without adding pseudo headers
include/asm-mips64/checksum.h +1 -9
diff -ruN linux-2.5.42-fromuser/include/asm-mips64/checksum.h linux-2.5.42-cpc/include/asm-mips64/checksum.h
@@ -30,12 +30,6 @@
  * this is a new version of the above that records errors it finds in *errp,
  * but continues and zeros the rest of the buffer.
  */
-#define csum_partial_copy_nocheck csum_partial_copy
-
-/*
- * this is a new version of the above that records errors it finds in *errp,
- * but continues and zeros the rest of the buffer.
- */
 unsigned int csum_partial_copy_from_user(const char *src, char *dst, int len,
                                          unsigned int sum, int *errp);
 
@@ -60,10 +54,8 @@
 /*
  * the same as csum_partial, but copies from user space (but on MIPS
  * we have just one address space, so this is identical to the above)
- *
- * this is obsolete and will go away.
  */
-unsigned int csum_partial_copy(const char *src, char *dst, int len,
+unsigned int csum_partial_copy_nocheck(const char *src, char *dst, int len,
 			       unsigned int sum);
 
 /*
include/asm-parisc/checksum.h +6 -16
diff -ruN linux-2.5.42-fromuser/include/asm-parisc/checksum.h linux-2.5.42-cpc/include/asm-parisc/checksum.h
@@ -22,9 +22,13 @@
  * here even more important to align src and dst on a 32-bit (or even
  * better 64-bit) boundary
  *
- * this will go away soon.
+ * Note: when you get a NULL pointer exception here this means someone
+ * passed in an incorrect kernel address to one of these functions. 
+ *
+ * If you use these functions directly please don't forget the 
+ * verify_area().
  */
-extern unsigned int csum_partial_copy(const char *, char *, int, unsigned int);
+extern unsigned int csum_partial_copy_nocheck(const char *, char *, int, unsigned int);
 
 /*
  * this is a new version of the above that records errors it finds in *errp,
@@ -33,20 +37,6 @@
 unsigned int csum_partial_copy_from_user(const char *src, char *dst, int len, unsigned int sum, int *errp);
 
 /*
- *	Note: when you get a NULL pointer exception here this means someone
- *	passed in an incorrect kernel address to one of these functions. 
- *	
- *	If you use these functions directly please don't forget the 
- *	verify_area().
- */
-extern __inline__
-unsigned int csum_partial_copy_nocheck (const char *src, char *dst,
-					int len, int sum)
-{
-	return csum_partial_copy (src, dst, len, sum);
-}
-
-/*
  *	Optimized for IP headers, which always checksum on 4 octet boundaries.
  *
  *	Written by Randolph Chung <[email protected]>
include/asm-ppc/checksum.h +0 -6
diff -ruN linux-2.5.42-fromuser/include/asm-ppc/checksum.h linux-2.5.42-cpc/include/asm-ppc/checksum.h
@@ -38,12 +38,6 @@
 /* FIXME: this needs to be written to really do no check -- Cort */
 #define csum_partial_copy_nocheck(src, dst, len, sum)	\
 	csum_partial_copy_generic((src), (dst), (len), (sum), 0, 0)     
-/*
- * Old version which ignore errors.
- * it will go away soon.
- */
-#define csum_partial_copy(src, dst, len, sum)	\
-	csum_partial_copy_generic((src), (dst), (len), (sum), 0, 0)
 
 
 /*
include/asm-ppc64/checksum.h +0 -5
diff -ruN linux-2.5.42-fromuser/include/asm-ppc64/checksum.h linux-2.5.42-cpc/include/asm-ppc64/checksum.h
@@ -43,12 +43,7 @@
 /*
  * the same as csum_partial, but copies from src to dst while it
  * checksums
- *
- * csum_partial_copy will go away soon.
  */
-unsigned int csum_partial_copy(const char *src, char *dst, 
-			       int len, unsigned int sum);
-
 extern unsigned int csum_partial_copy_generic(const char *src, char *dst,
 					      int len, unsigned int sum,
 					      int *src_err, int *dst_err);
include/asm-s390/checksum.h +1 -18
diff -ruN linux-2.5.42-fromuser/include/asm-s390/checksum.h linux-2.5.42-cpc/include/asm-s390/checksum.h
@@ -62,24 +62,7 @@
 }
 
 /*
- * the same as csum_partial, but copies from src while it
- * checksums
- *
- * here even more important to align src and dst on a 32-bit (or even
- * better 64-bit) boundary
- *
- * this will go away soon.
- */
-
-static inline unsigned int 
-csum_partial_copy(const char *src, char *dst, int len,unsigned int sum)
-{
-	memcpy(dst,src,len);
-        return csum_partial_inline(dst, len, sum);
-}
-
-/*
- * the same as csum_partial_copy, but copies from user space.
+ * the same as csum_partial, but copies from user space while it checksums.
  *
  * here even more important to align src and dst on a 32-bit (or even
  * better 64-bit) boundary
include/asm-s390x/checksum.h +1 -18
diff -ruN linux-2.5.42-fromuser/include/asm-s390x/checksum.h linux-2.5.42-cpc/include/asm-s390x/checksum.h
@@ -64,24 +64,7 @@
 }
 
 /*
- * the same as csum_partial, but copies from src while it
- * checksums
- *
- * here even more important to align src and dst on a 32-bit (or even
- * better 64-bit) boundary
- *
- * this will go away soon.
- */
-
-static inline unsigned int 
-csum_partial_copy(const char *src, char *dst, int len,unsigned int sum)
-{
-	memcpy(dst,src,len);
-        return csum_partial_inline(dst, len, sum);
-}
-
-/*
- * the same as csum_partial_copy, but copies from user space.
+ * the same as csum_partial, but copies from user space while it checksums.
  *
  * here even more important to align src and dst on a 32-bit (or even
  * better 64-bit) boundary
include/asm-sh/checksum.h +0 -8
diff -ruN linux-2.5.42-fromuser/include/asm-sh/checksum.h linux-2.5.42-cpc/include/asm-sh/checksum.h
@@ -58,14 +58,6 @@
 }
 
 /*
- * This is the old (and unsafe) way of doing checksums, a warning message will
- * be printed if it is used and an exeption occurs.
- *
- * this function should go away after some time.
- */
-unsigned int csum_partial_copy( const char *src, char *dst, int len, int sum);
-
-/*
  *	Fold a partial checksum
  */
 
include/asm-sparc/checksum.h +0 -5
diff -ruN linux-2.5.42-fromuser/include/asm-sparc/checksum.h linux-2.5.42-cpc/include/asm-sparc/checksum.h
@@ -39,11 +39,6 @@
  * here even more important to align src and dst on a 32-bit (or even
  * better 64-bit) boundary
  */
-
-/* FIXME: Remove this macro ASAP */
-#define csum_partial_copy(src, dst, len, sum) \
- 		       csum_partial_copy_nocheck(src,dst,len,sum)
-  
 extern unsigned int __csum_partial_copy_sparc_generic (const char *, char *);
 
 extern __inline__ unsigned int 
#1 lore raw

From: Rob Radez <[email protected]>
Date: Mon, 14 Oct 2002 19:19:38 -0400

The attached patch against 2.5.42 removes csum_partial_copy. It's on top of a patch that I just sent to Dave removing csum_partial_copy_fromuser. Does it look alright to people? Arch maintainers? Dave?

Looks perfectly fine, applied.