for (i = 0; i < ARRAY_SIZE(ipipe_modules); i++) {
const struct ipipe_module_if *module_if;
struct ipipe_module_params *params;
- void __user *from;
+ void *from, *to;
size_t size;
- void *to;
if (!(cfg->flag & BIT(i)))
continue;
module_if = &ipipe_modules[i];
- from = *(void * __user *)
- ((void *)cfg + module_if->config_offset);
+ from = *(void **)((void *)cfg + module_if->config_offset);
params = kmalloc(sizeof(struct ipipe_module_params),
GFP_KERNEL);
size = module_if->param_size;
if (to && from && size) {
- if (copy_from_user(to, from, size)) {
+ if (copy_from_user(to, (void __user *)from, size)) {
rval = -EFAULT;
break;
}
for (i = 1; i < ARRAY_SIZE(ipipe_modules); i++) {
const struct ipipe_module_if *module_if;
struct ipipe_module_params *params;
- void __user *to;
+ void *from, *to;
size_t size;
- void *from;
if (!(cfg->flag & BIT(i)))
continue;
module_if = &ipipe_modules[i];
- to = *(void * __user *)((void *)cfg + module_if->config_offset);
+ to = *(void **)((void *)cfg + module_if->config_offset);
params = kmalloc(sizeof(struct ipipe_module_params),
GFP_KERNEL);
rval = module_if->get(ipipe, from);
if (rval)
goto error;
- if (copy_to_user(to, from, size)) {
+ if (copy_to_user((void __user *)to, from, size)) {
rval = -EFAULT;
break;
}
resizer_set_default_configuration(resizer);
else
if (copy_from_user(&resizer->config.user_config,
- chan_config->config, sizeof(struct vpfe_rsz_config_params)))
+ (void __user *)chan_config->config,
+ sizeof(struct vpfe_rsz_config_params)))
return -EFAULT;
return 0;
return -EINVAL;
}
- if (copy_to_user((void *)chan_config->config,
- (void *)&resizer->config.user_config,
- sizeof(struct vpfe_rsz_config_params))) {
+ if (copy_to_user((void __user *)chan_config->config,
+ (void *)&resizer->config.user_config,
+ sizeof(struct vpfe_rsz_config_params))) {
dev_err(dev, "resizer_get_configuration: Error in copy to user\n");
return -EFAULT;
}