From: Kulikov Vasiliy Date: Tue, 29 Jun 2010 10:15:56 +0000 (+0400) Subject: Staging: dream: pmem: remove casts from void* X-Git-Tag: firefly_0821_release~9833^2~1255^2~1^2~231 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=37157cc4b72b816d226380fa3635eb6cab10c0da;p=firefly-linux-kernel-4.4.55.git Staging: dream: pmem: remove casts from void* Remove unnesessary casts from void*. Signed-off-by: Kulikov Vasiliy Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/dream/pmem.c b/drivers/staging/dream/pmem.c index 064b59e5b500..7d6bbadd7fc7 100644 --- a/drivers/staging/dream/pmem.c +++ b/drivers/staging/dream/pmem.c @@ -209,7 +209,7 @@ static int has_allocation(struct file *file) if (unlikely(!file->private_data)) return 0; - data = (struct pmem_data *)file->private_data; + data = file->private_data; if (unlikely(data->index < 0)) return 0; return 1; @@ -223,7 +223,7 @@ static int is_master_owner(struct file *file) if (!is_pmem_file(file) || !has_allocation(file)) return 0; - data = (struct pmem_data *)file->private_data; + data = file->private_data; if (PMEM_FLAGS_MASTERMAP & data->flags) return 1; master_file = fget_light(data->master_fd, &put_needed); @@ -268,7 +268,7 @@ static void pmem_revoke(struct file *file, struct pmem_data *data); static int pmem_release(struct inode *inode, struct file *file) { - struct pmem_data *data = (struct pmem_data *)file->private_data; + struct pmem_data *data = file->private_data; struct pmem_region_node *region_node; struct list_head *elt, *elt2; int id = get_id(file), ret = 0; @@ -591,7 +591,7 @@ static int pmem_mmap(struct file *file, struct vm_area_struct *vma) return -EINVAL; } - data = (struct pmem_data *)file->private_data; + data = file->private_data; down_write(&data->sem); /* check this file isn't already mmaped, for submaps check this file * has never been mmaped */ @@ -690,7 +690,7 @@ int get_pmem_user_addr(struct file *file, unsigned long *start, #endif return -1; } - data = (struct pmem_data *)file->private_data; + data = file->private_data; down_read(&data->sem); if (data->vma) { *start = data->vma->vm_start; @@ -712,7 +712,7 @@ int get_pmem_addr(struct file *file, unsigned long *start, if (!is_pmem_file(file) || !has_allocation(file)) return -1; - data = (struct pmem_data *)file->private_data; + data = file->private_data; if (data->index == -1) { #if PMEM_DEBUG printk(KERN_INFO "pmem: requested pmem data from file with no " @@ -766,7 +766,7 @@ void put_pmem_file(struct file *file) if (!is_pmem_file(file)) return; id = get_id(file); - data = (struct pmem_data *)file->private_data; + data = file->private_data; #if PMEM_DEBUG down_write(&data->sem); if (data->ref == 0) { @@ -793,7 +793,7 @@ void flush_pmem_file(struct file *file, unsigned long offset, unsigned long len) return; id = get_id(file); - data = (struct pmem_data *)file->private_data; + data = file->private_data; if (!pmem[id].cached) return; @@ -822,7 +822,7 @@ end: static int pmem_connect(unsigned long connect, struct file *file) { - struct pmem_data *data = (struct pmem_data *)file->private_data; + struct pmem_data *data = file->private_data; struct pmem_data *src_data; struct file *src_file; int ret = 0, put_needed; @@ -842,7 +842,7 @@ static int pmem_connect(unsigned long connect, struct file *file) ret = -EINVAL; goto err_bad_file; } - src_data = (struct pmem_data *)src_file->private_data; + src_data = src_file->private_data; if (has_allocation(file) && (data->index != src_data->index)) { printk(KERN_INFO "pmem: file is already mapped but doesn't " @@ -929,7 +929,7 @@ int pmem_remap(struct pmem_region *region, struct file *file, struct mm_struct *mm = NULL; struct list_head *elt, *elt2; int id = get_id(file); - struct pmem_data *data = (struct pmem_data *)file->private_data; + struct pmem_data *data = file->private_data; /* pmem region must be aligned on a page boundry */ if (unlikely(!PMEM_IS_PAGE_ALIGNED(region->offset) || @@ -1053,7 +1053,7 @@ static void pmem_revoke(struct file *file, struct pmem_data *data) static void pmem_get_size(struct pmem_region *region, struct file *file) { - struct pmem_data *data = (struct pmem_data *)file->private_data; + struct pmem_data *data = file->private_data; int id = get_id(file); if (!has_allocation(file)) { @@ -1082,7 +1082,7 @@ static long pmem_ioctl(struct file *file, unsigned int cmd, unsigned long arg) region.offset = 0; region.len = 0; } else { - data = (struct pmem_data *)file->private_data; + data = file->private_data; region.offset = pmem_start_addr(id, data); region.len = pmem_len(id, data); } @@ -1099,7 +1099,7 @@ static long pmem_ioctl(struct file *file, unsigned int cmd, unsigned long arg) if (copy_from_user(®ion, (void __user *)arg, sizeof(struct pmem_region))) return -EFAULT; - data = (struct pmem_data *)file->private_data; + data = file->private_data; return pmem_remap(®ion, file, PMEM_MAP); } break; @@ -1109,7 +1109,7 @@ static long pmem_ioctl(struct file *file, unsigned int cmd, unsigned long arg) if (copy_from_user(®ion, (void __user *)arg, sizeof(struct pmem_region))) return -EFAULT; - data = (struct pmem_data *)file->private_data; + data = file->private_data; return pmem_remap(®ion, file, PMEM_UNMAP); break; } @@ -1139,7 +1139,7 @@ static long pmem_ioctl(struct file *file, unsigned int cmd, unsigned long arg) { if (has_allocation(file)) return -EINVAL; - data = (struct pmem_data *)file->private_data; + data = file->private_data; data->index = pmem_allocate(id, arg); break; }