[PATCH] Add const to pointer qualifiers for __chk_user_ptr and __chk_io_ptr.
authorRuss Cox <[email protected]>
Mon, 26 Mar 2007 15:23:56 +0000 (11:23 -0400)
committerLinus Torvalds <[email protected]>
Mon, 26 Mar 2007 21:23:52 +0000 (14:23 -0700)
Change prototypes for __chk_user_ptr and __chk_io_ptr to take const
void* instead of void*, so that code can pass "const void *" to them.

(Right now sparse does not warn about passing const void* to void*
functions, but that is a separate bug that I believe Josh is working on,
and once sparse does check this, the changed prototypes will be
necessary.)

Signed-off-by: Russ Cox <[email protected]>
Signed-off-by: Josh Triplett <[email protected]>
Acked-by: Christopher Li <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
include/linux/compiler.h

index aca66984aafd7635f254f18f8ae4518925a69703..3b6949b417451d16145d9117c3ad72fa8cb654b6 100644 (file)
@@ -15,8 +15,8 @@
 # define __acquire(x)  __context__(x,1)
 # define __release(x)  __context__(x,-1)
 # define __cond_lock(x,c)      ((c) ? ({ __acquire(x); 1; }) : 0)
-extern void __chk_user_ptr(void __user *);
-extern void __chk_io_ptr(void __iomem *);
+extern void __chk_user_ptr(const void __user *);
+extern void __chk_io_ptr(const void __iomem *);
 #else
 # define __user
 # define __kernel