Skip to content

Commit

Permalink
[PATCH] Add const to pointer qualifiers for __chk_user_ptr and __chk_…
Browse files Browse the repository at this point in the history
…io_ptr.

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 <rsc@swtch.com>
Signed-off-by: Josh Triplett <josh@freedesktop.org>
Acked-by: Christopher Li <sparse@chrisli.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
Russ Cox authored and Linus Torvalds committed Mar 26, 2007
1 parent 00db779 commit 04a3952
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions include/linux/compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 04a3952

Please sign in to comment.