netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 2.6.7] sparse annotation of csum_and_copy_to_user
@ 2004-06-16 22:29 Stephen Hemminger
  2004-06-17 18:19 ` David S. Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Stephen Hemminger @ 2004-06-16 22:29 UTC (permalink / raw)
  To: David S. Miller; +Cc: netdev

csum_and_copy_to_user acts like copy_to_user so it needs annotations to
get rid of several sparse warnings.

diff -Nru a/include/asm-i386/checksum.h b/include/asm-i386/checksum.h
--- a/include/asm-i386/checksum.h	2004-06-16 15:24:33 -07:00
+++ b/include/asm-i386/checksum.h	2004-06-16 15:24:33 -07:00
@@ -172,8 +172,10 @@
  *	Copy and checksum to user
  */
 #define HAVE_CSUM_COPY_USER
-static __inline__ unsigned int csum_and_copy_to_user(const char *src, char *dst,
-				    int len, int sum, int *err_ptr)
+static __inline__ unsigned int csum_and_copy_to_user(const char *src, 
+						     char __user *dst,
+						     int len, int sum, 
+						     int *err_ptr)
 {
 	if (access_ok(VERIFY_WRITE, dst, len))
 		return csum_partial_copy_generic(src, dst, len, sum, NULL, err_ptr);
diff -Nru a/include/asm-mips/checksum.h b/include/asm-mips/checksum.h
--- a/include/asm-mips/checksum.h	2004-06-16 15:24:33 -07:00
+++ b/include/asm-mips/checksum.h	2004-06-16 15:24:33 -07:00
@@ -41,7 +41,8 @@
  * Copy and checksum to user
  */
 #define HAVE_CSUM_COPY_USER
-static inline unsigned int csum_and_copy_to_user (const char *src, char *dst,
+static inline unsigned int csum_and_copy_to_user (const char *src, 
+						  char __user *dst,
 						  int len, int sum,
 						  int *err_ptr)
 {
diff -Nru a/include/asm-parisc/checksum.h b/include/asm-parisc/checksum.h
--- a/include/asm-parisc/checksum.h	2004-06-16 15:24:33 -07:00
+++ b/include/asm-parisc/checksum.h	2004-06-16 15:24:33 -07:00
@@ -191,8 +191,10 @@
  *	Copy and checksum to user
  */
 #define HAVE_CSUM_COPY_USER
-static __inline__ unsigned int csum_and_copy_to_user (const char *src, char *dst,
-				    int len, int sum, int *err_ptr)
+static __inline__ unsigned int csum_and_copy_to_user (const char *src, 
+						      char __user *dst,
+						      int len, int sum, 
+						      int *err_ptr)
 {
 	/* code stolen from include/asm-mips64 */
 	sum = csum_partial(src, len, sum);
diff -Nru a/include/asm-sh/checksum.h b/include/asm-sh/checksum.h
--- a/include/asm-sh/checksum.h	2004-06-16 15:24:33 -07:00
+++ b/include/asm-sh/checksum.h	2004-06-16 15:24:33 -07:00
@@ -201,8 +201,10 @@
  *	Copy and checksum to user
  */
 #define HAVE_CSUM_COPY_USER
-static __inline__ unsigned int csum_and_copy_to_user (const char *src, char *dst,
-				    int len, int sum, int *err_ptr)
+static __inline__ unsigned int csum_and_copy_to_user (const char *src, 
+						      char __user *dst,
+						      int len, int sum,
+						      int *err_ptr)
 {
 	if (access_ok(VERIFY_WRITE, dst, len))
 		return csum_partial_copy_generic(src, dst, len, sum, NULL, err_ptr);
diff -Nru a/include/asm-sparc/checksum.h b/include/asm-sparc/checksum.h
--- a/include/asm-sparc/checksum.h	2004-06-16 15:24:33 -07:00
+++ b/include/asm-sparc/checksum.h	2004-06-16 15:24:33 -07:00
@@ -91,7 +91,7 @@
   }
   
 static inline unsigned int 
-csum_partial_copy_to_user(const char *src, char *dst, int len, 
+csum_partial_copy_to_user(const char *src, char __user *dst, int len, 
 			  unsigned int sum, int *err)
 {
 	if (!access_ok (VERIFY_WRITE, dst, len)) {
diff -Nru a/include/asm-sparc64/checksum.h b/include/asm-sparc64/checksum.h
--- a/include/asm-sparc64/checksum.h	2004-06-16 15:24:33 -07:00
+++ b/include/asm-sparc64/checksum.h	2004-06-16 15:24:33 -07:00
@@ -66,8 +66,9 @@
  */
 #define HAVE_CSUM_COPY_USER
 extern unsigned int csum_partial_copy_user_sparc64(const char *src, char *dst, int len, unsigned int sum);
+
 static __inline__ unsigned int 
-csum_and_copy_to_user(const char *src, char *dst, int len, 
+csum_and_copy_to_user(const char *src, char __user *dst, int len, 
 		      unsigned int sum, int *err)
 {
 	__asm__ __volatile__ ("stx	%0, [%%sp + 0x7ff + 128]"

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH 2.6.7] sparse annotation of csum_and_copy_to_user
  2004-06-16 22:29 [PATCH 2.6.7] sparse annotation of csum_and_copy_to_user Stephen Hemminger
@ 2004-06-17 18:19 ` David S. Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David S. Miller @ 2004-06-17 18:19 UTC (permalink / raw)
  To: Stephen Hemminger; +Cc: netdev


Applied, thanks Stephen.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2004-06-17 18:19 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-06-16 22:29 [PATCH 2.6.7] sparse annotation of csum_and_copy_to_user Stephen Hemminger
2004-06-17 18:19 ` David S. Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).