Skip to contentSkip to conversation

CRIS: Correct usage of __user for copy to and from user space in lib/usercopy and uaccess.h

PATCH New Jesper Nilsson 1 participant 2 messages Feb 27, 2008

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 CRIS: Correct usage of __user for copy to and from user space in lib/usercopy and uaccess.h

Function __copy_user_zeroing in arch/lib/usercopy.c had the wrong parameter set as __user, and in include/asm-cris/uaccess.h, it was not set at all for some of the calling functions.

This will cut the number of warnings quite dramatically when using sparse.

While we're here, remove useless CVS log and correct confusing typo.

---
 arch/cris/arch-v10/lib/usercopy.c |    2 +-
 arch/cris/arch-v32/lib/usercopy.c |    2 +-
 include/asm-cris/uaccess.h        |   53 ++++++------------------------------
 3 files changed, 11 insertions(+), 46 deletions(-)
arch/cris/arch-v10/lib/usercopy.c +1 -1
index b8e6c04..b0a608d 100644
@@ -193,7 +193,7 @@ __copy_user (void __user *pdst, const void *psrc, unsigned long pn)
    inaccessible.  */
 
 unsigned long
-__copy_user_zeroing (void __user *pdst, const void *psrc, unsigned long pn)
+__copy_user_zeroing(void *pdst, const void __user *psrc, unsigned long pn)
 {
   /* We want the parameters put in special registers.
      Make sure the compiler is able to make something useful of this.
arch/cris/arch-v32/lib/usercopy.c +1 -1
index 04d0cf3..0b5b70d 100644
@@ -161,7 +161,7 @@ __copy_user (void __user *pdst, const void *psrc, unsigned long pn)
    inaccessible.  */
 
 unsigned long
-__copy_user_zeroing (void __user *pdst, const void *psrc, unsigned long pn)
+__copy_user_zeroing(void *pdst, const void __user *psrc, unsigned long pn)
 {
   /* We want the parameters put in special registers.
      Make sure the compiler is able to make something useful of this.
include/asm-cris/uaccess.h +9 -44

87 lines not on this page · raw message

Signature · 6 lines
1.5.4.2.133.g3d51e


/^JN - Jesper Nilsson
--
               Jesper Nilsson -- [email protected]
#1 lore raw

PATCH 1/1 CRIS: Correct usage of __user for copy to and from user space in lib/usercopy and uaccess.h try 2

Function __copy_user_zeroing in arch/lib/usercopy.c had the wrong parameter set as __user, and in include/asm-cris/uaccess.h, it was not set at all for some of the calling functions.

This will cut the number of warnings quite dramatically when using sparse.

While we're here, remove useless CVS log and correct confusing typo.

---
Sorry, forgot the -s switch to git format-patch.

 arch/cris/arch-v10/lib/usercopy.c |    2 +-
 arch/cris/arch-v32/lib/usercopy.c |    2 +-
 include/asm-cris/uaccess.h        |   53 ++++++------------------------------
 3 files changed, 11 insertions(+), 46 deletions(-)
arch/cris/arch-v10/lib/usercopy.c +1 -1
index b8e6c04..b0a608d 100644
@@ -193,7 +193,7 @@ __copy_user (void __user *pdst, const void *psrc, unsigned long pn)
    inaccessible.  */
 
 unsigned long
-__copy_user_zeroing (void __user *pdst, const void *psrc, unsigned long pn)
+__copy_user_zeroing(void *pdst, const void __user *psrc, unsigned long pn)
 {
   /* We want the parameters put in special registers.
      Make sure the compiler is able to make something useful of this.
arch/cris/arch-v32/lib/usercopy.c +1 -1
index 04d0cf3..0b5b70d 100644
@@ -161,7 +161,7 @@ __copy_user (void __user *pdst, const void *psrc, unsigned long pn)
    inaccessible.  */
 
 unsigned long
-__copy_user_zeroing (void __user *pdst, const void *psrc, unsigned long pn)
+__copy_user_zeroing(void *pdst, const void __user *psrc, unsigned long pn)
 {
   /* We want the parameters put in special registers.
      Make sure the compiler is able to make something useful of this.
include/asm-cris/uaccess.h +9 -44

87 lines not on this page · raw message

Signature · 6 lines
1.5.4.2.133.g3d51e


/^JN - Jesper Nilsson
--
               Jesper Nilsson -- [email protected]