There are lots of troubles with atomisp __user annotations. Fix them.
drivers/staging/media/atomisp/pci/atomisp2/atomisp_acc.c:357:49: warning: incorrect type in argument 2 (different address spaces)
drivers/staging/media/atomisp/pci/atomisp2/atomisp_acc.c:357:49: expected void *userptr
drivers/staging/media/atomisp/pci/atomisp2/atomisp_acc.c:357:49: got void [noderef] <asn:1>*user_ptr
drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c:3302:43: warning: incorrect type in argument 2 (different address spaces)
drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c:3302:43: expected void const [noderef] <asn:1>*from
drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c:3302:43: got void const *from
drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c:4070:58: warning: incorrect type in argument 2 (different address spaces)
drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c:4070:58: expected void const *from
drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c:4070:58: got unsigned short [noderef] <asn:1>*<noident>
drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c:4082:58: warning: incorrect type in argument 2 (different address spaces)
drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c:4082:58: expected void const *from
drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c:4082:58: got unsigned short [noderef] <asn:1>*<noident>
drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c:6179:62: warning: incorrect type in argument 2 (different address spaces)
drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c:6179:62: expected void const [noderef] <asn:1>*from
drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c:6179:62: got unsigned short [usertype] *<noident>
Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
}
pgnr = DIV_ROUND_UP(map->length, PAGE_SIZE);
- cssptr = hrt_isp_css_mm_alloc_user_ptr(
- map->length, map->user_ptr,
- pgnr, HRT_USR_PTR,
- (map->flags & ATOMISP_MAP_FLAG_CACHED));
+ cssptr = hrt_isp_css_mm_alloc_user_ptr(map->length,
+ map->user_ptr,
+ pgnr, HRT_USR_PTR,
+ (map->flags & ATOMISP_MAP_FLAG_CACHED));
} else {
/* Allocate private buffer. */
if (map->flags & ATOMISP_MAP_FLAG_CACHED)
unsigned long n, bool from_user)
{
if (from_user)
- return copy_from_user(to, from, n);
+ return copy_from_user(to, (void __user *)from, n);
else
memcpy(to, from, n);
return 0;
for (i = 0; i < CSS_MORPH_TABLE_NUM_PLANES; i++) {
if (copy_from_compatible(morph_table->coordinates_x[i],
- source_morph_table->coordinates_x[i],
+ (__force void *)source_morph_table->coordinates_x[i],
#ifndef ISP2401
source_morph_table->height * source_morph_table->width *
sizeof(*source_morph_table->coordinates_x[i]),
goto error;
if (copy_from_compatible(morph_table->coordinates_y[i],
- source_morph_table->coordinates_y[i],
+ (__force void *)source_morph_table->coordinates_y[i],
#ifndef ISP2401
source_morph_table->height * source_morph_table->width *
sizeof(*source_morph_table->coordinates_y[i]),
ATOMISP_SC_TYPE_SIZE;
for (i = 0; i < ATOMISP_NUM_SC_COLORS; i++) {
ret = copy_from_user(shading_table->data[i],
- user_shading_table->data[i], len_table);
+ (void __user *)user_shading_table->data[i],
+ len_table);
if (ret) {
free_table = shading_table;
ret = -EFAULT;
int atomisp_css_frame_map(struct atomisp_css_frame **frame,
const struct atomisp_css_frame_info *info,
- const void *data, uint16_t attribute,
+ const void __user *data, uint16_t attribute,
void *context);
int atomisp_css_set_black_frame(struct atomisp_sub_device *asd,
int atomisp_css_frame_map(struct atomisp_css_frame **frame,
const struct atomisp_css_frame_info *info,
- const void *data, uint16_t attribute,
+ const void __user *data, uint16_t attribute,
void *context)
{
if (ia_css_frame_map(frame, info, data, attribute, context)
attributes.type = HRT_USR_PTR;
#endif
ret = atomisp_css_frame_map(&handle, &frame_info,
- (void *)buf->m.userptr,
+ (void __user *)buf->m.userptr,
0, &attributes);
if (ret) {
dev_err(isp->dev, "Failed to map user buffer\n");
\return vaddress
*/
extern hrt_vaddress mmgr_mmap(
- const void *ptr,
+ const void __user *ptr,
const size_t size,
uint16_t attribute,
void *context);
enum ia_css_err
ia_css_frame_map(struct ia_css_frame **frame,
const struct ia_css_frame_info *info,
- const void *data,
+ const void __user *data,
uint16_t attribute,
void *context);
}
hrt_vaddress
-mmgr_mmap(const void *ptr, const size_t size,
+mmgr_mmap(const void __user *ptr, const size_t size,
uint16_t attribute, void *context)
{
struct hrt_userbuffer_attr *userbuffer_attr = context;
return hrt_isp_css_mm_alloc_user_ptr(
- size, (void *)ptr, userbuffer_attr->pgnr,
+ size, ptr, userbuffer_attr->pgnr,
userbuffer_attr->type,
attribute & HRT_BUF_FLAG_CACHED);
}
enum ia_css_err ia_css_frame_map(struct ia_css_frame **frame,
const struct ia_css_frame_info *info,
- const void *data,
+ const void __user *data,
uint16_t attribute,
void *context)
{
}
ia_css_ptr hmm_alloc(size_t bytes, enum hmm_bo_type type,
- int from_highmem, void *userptr, bool cached)
+ int from_highmem, const void __user *userptr, bool cached)
{
unsigned int pgnr;
struct hmm_buffer_object *bo;
* Convert user space virtual address into pages list
*/
static int alloc_user_pages(struct hmm_buffer_object *bo,
- void *userptr, bool cached)
+ const void __user *userptr, bool cached)
{
int page_nr;
int i;
*/
int hmm_bo_alloc_pages(struct hmm_buffer_object *bo,
enum hmm_bo_type type, int from_highmem,
- void *userptr, bool cached)
+ const void __user *userptr, bool cached)
{
int ret = -EINVAL;
#define __page_align(size) (((size) + (PAGE_SIZE-1)) & (~(PAGE_SIZE-1)))
-static void *my_userptr;
+static void __user *my_userptr;
static unsigned my_num_pages;
static enum hrt_userptr_type my_usr_type;
-void hrt_isp_css_mm_set_user_ptr(void *userptr,
+void hrt_isp_css_mm_set_user_ptr(void __user *userptr,
unsigned int num_pages,
enum hrt_userptr_type type)
{
my_usr_type = type;
}
-static ia_css_ptr __hrt_isp_css_mm_alloc(size_t bytes, void *userptr,
- unsigned int num_pages,
- enum hrt_userptr_type type,
- bool cached)
+static ia_css_ptr __hrt_isp_css_mm_alloc(size_t bytes,
+ const void __user *userptr,
+ unsigned int num_pages,
+ enum hrt_userptr_type type,
+ bool cached)
{
#ifdef CONFIG_ION
if (type == HRT_USR_ION)
my_num_pages, my_usr_type, false);
}
-ia_css_ptr hrt_isp_css_mm_alloc_user_ptr(size_t bytes, void *userptr,
- unsigned int num_pages,
- enum hrt_userptr_type type,
- bool cached)
+ia_css_ptr hrt_isp_css_mm_alloc_user_ptr(size_t bytes,
+ const void __user *userptr,
+ unsigned int num_pages,
+ enum hrt_userptr_type type,
+ bool cached)
{
return __hrt_isp_css_mm_alloc(bytes, userptr, num_pages,
type, cached);
unsigned int pgnr;
};
-void hrt_isp_css_mm_set_user_ptr(void *userptr,
+void hrt_isp_css_mm_set_user_ptr(void __user *userptr,
unsigned int num_pages, enum hrt_userptr_type);
/* Allocate memory, returns a virtual address */
ia_css_ptr hrt_isp_css_mm_alloc(size_t bytes);
-ia_css_ptr hrt_isp_css_mm_alloc_user_ptr(size_t bytes, void *userptr,
- unsigned int num_pages,
- enum hrt_userptr_type,
- bool cached);
+ia_css_ptr hrt_isp_css_mm_alloc_user_ptr(size_t bytes,
+ const void __user *userptr,
+ unsigned int num_pages,
+ enum hrt_userptr_type,
+ bool cached);
ia_css_ptr hrt_isp_css_mm_alloc_cached(size_t bytes);
/* allocate memory and initialize with zeros,
void hmm_cleanup(void);
ia_css_ptr hmm_alloc(size_t bytes, enum hmm_bo_type type,
- int from_highmem, void *userptr, bool cached);
+ int from_highmem, const void __user *userptr, bool cached);
void hmm_free(ia_css_ptr ptr);
int hmm_load(ia_css_ptr virt, void *data, unsigned int bytes);
int hmm_store(ia_css_ptr virt, const void *data, unsigned int bytes);
*/
int hmm_bo_alloc_pages(struct hmm_buffer_object *bo,
enum hmm_bo_type type, int from_highmem,
- void *userptr, bool cached);
+ const void __user *userptr, bool cached);
void hmm_bo_free_pages(struct hmm_buffer_object *bo);
int hmm_bo_page_allocated(struct hmm_buffer_object *bo);