summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTodd Kjos <tkjos@android.com>2019-02-13 14:48:53 -0500
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-02-14 02:13:56 -0500
commit36f30937922ce75390c73f99e650e4f2eb56b0e6 (patch)
tree9472761de1936735f9001bff16496d69a2c14690
parentca5dc2d11787d72dd11f5af77ef07a93a293bea6 (diff)
binder: fix sparse issue in binder_alloc_selftest.c
Fixes sparse issues reported by the kbuild test robot running on https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git char-misc-testing: bde4a19fc04f5 ("binder: use userspace pointer as base of buffer space") Error output (drivers/android/binder_alloc_selftest.c): sparse: warning: incorrect type in assignment (different address spaces) sparse: expected void *page_addr sparse: got void [noderef] <asn:1> *user_data sparse: error: subtraction of different types can't work Fixed by adding necessary "__user" tags. Reported-by: kbuild test robot <lkp@intel.com> Signed-off-by: Todd Kjos <tkjos@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/android/binder_alloc_selftest.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/android/binder_alloc_selftest.c b/drivers/android/binder_alloc_selftest.c
index f0f4d7d02635..b72708918b06 100644
--- a/drivers/android/binder_alloc_selftest.c
+++ b/drivers/android/binder_alloc_selftest.c
@@ -102,10 +102,11 @@ static bool check_buffer_pages_allocated(struct binder_alloc *alloc,
102 struct binder_buffer *buffer, 102 struct binder_buffer *buffer,
103 size_t size) 103 size_t size)
104{ 104{
105 void *page_addr, *end; 105 void __user *page_addr;
106 void __user *end;
106 int page_index; 107 int page_index;
107 108
108 end = (void *)PAGE_ALIGN((uintptr_t)buffer->user_data + size); 109 end = (void __user *)PAGE_ALIGN((uintptr_t)buffer->user_data + size);
109 page_addr = buffer->user_data; 110 page_addr = buffer->user_data;
110 for (; page_addr < end; page_addr += PAGE_SIZE) { 111 for (; page_addr < end; page_addr += PAGE_SIZE) {
111 page_index = (page_addr - alloc->buffer) / PAGE_SIZE; 112 page_index = (page_addr - alloc->buffer) / PAGE_SIZE;