diff options
| author | Mister Oyster <oysterized@gmail.com> | 2017-04-11 14:54:15 +0200 |
|---|---|---|
| committer | Mister Oyster <oysterized@gmail.com> | 2017-04-16 15:03:40 +0200 |
| commit | a9c2cb1ea20241fe3fa900959f402afbff3a35e6 (patch) | |
| tree | 132c70224bfb3ff5cea749e1f0887bd89c989d75 | |
| parent | 07ffc420b509b97e477da6e9ffc5bf1b60809073 (diff) | |
ashmem: missing braces & indent
| -rw-r--r-- | drivers/staging/android/ashmem.c | 32 |
1 files changed, 15 insertions, 17 deletions
diff --git a/drivers/staging/android/ashmem.c b/drivers/staging/android/ashmem.c index 28f4787cf..23e1f191f 100644 --- a/drivers/staging/android/ashmem.c +++ b/drivers/staging/android/ashmem.c @@ -220,7 +220,7 @@ static ssize_t ashmem_read(struct file *file, char __user *buf, struct ashmem_area *asma = file->private_data; int ret = 0; - mutex_lock(&ashmem_mutex); + mutex_lock(&ashmem_mutex); /* If size is not set, or set to 0, always return EOF. */ if (asma->size == 0) @@ -326,9 +326,9 @@ static int ashmem_mmap(struct file *file, struct vm_area_struct *vma) } get_file(asma->file); - if (vma->vm_flags & VM_SHARED) + if (vma->vm_flags & VM_SHARED) { shmem_set_file(vma, asma->file); - else { + } else { if (vma->vm_file) fput(vma->vm_file); vma->vm_file = asma->file; @@ -373,8 +373,8 @@ static int ashmem_shrink(struct shrinker *s, struct shrink_control *sc) loff_t end = (range->pgend + 1) * PAGE_SIZE; do_fallocate(range->asma->file, - FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE, - start, end - start); + FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE, + start, end - start); range->purged = ASHMEM_WAS_PURGED; lru_del(range); @@ -460,7 +460,6 @@ static int get_name(struct ashmem_area *asma, void __user *name) mutex_lock(&ashmem_mutex); if (asma->name[ASHMEM_NAME_PREFIX_LEN] != '\0') { - /* * Copying only `len', instead of ASHMEM_NAME_LEN, bytes * prevents us from revealing one user's stack to another. @@ -530,7 +529,7 @@ static int ashmem_pin(struct ashmem_area *asma, size_t pgstart, size_t pgend) /* Case #3: We overlap from the rear, so adjust it */ if (range->pgend <= pgend) { - range_shrink(range, range->pgstart, pgstart-1); + range_shrink(range, range->pgstart, pgstart - 1); continue; } @@ -627,7 +626,7 @@ static int ashmem_pin_unpin(struct ashmem_area *asma, unsigned long cmd, if (unlikely((pin.offset | pin.len) & ~PAGE_MASK)) return -EINVAL; - if (unlikely(((__u32) -1) - pin.offset < pin.len)) + if (unlikely(((__u32)-1) - pin.offset < pin.len)) return -EINVAL; if (unlikely(PAGE_ALIGN(asma->size) < pin.offset + pin.len)) @@ -662,16 +661,16 @@ static long ashmem_ioctl(struct file *file, unsigned int cmd, unsigned long arg) switch (cmd) { case ASHMEM_SET_NAME: - ret = set_name(asma, (void __user *) arg); + ret = set_name(asma, (void __user *)arg); break; case ASHMEM_GET_NAME: - ret = get_name(asma, (void __user *) arg); + ret = get_name(asma, (void __user *)arg); break; case ASHMEM_SET_SIZE: ret = -EINVAL; if (!asma->file) { ret = 0; - asma->size = (size_t) arg; + asma->size = (size_t)arg; } break; case ASHMEM_GET_SIZE: @@ -686,7 +685,7 @@ static long ashmem_ioctl(struct file *file, unsigned int cmd, unsigned long arg) case ASHMEM_PIN: case ASHMEM_UNPIN: case ASHMEM_GET_PIN_STATUS: - ret = ashmem_pin_unpin(asma, cmd, (void __user *) arg); + ret = ashmem_pin_unpin(asma, cmd, (void __user *)arg); break; case ASHMEM_PURGE_ALL_CACHES: ret = -EPERM; @@ -709,7 +708,6 @@ static long ashmem_ioctl(struct file *file, unsigned int cmd, unsigned long arg) #ifdef CONFIG_COMPAT static long compat_ashmem_ioctl(struct file *file, unsigned int cmd, unsigned long arg) { - switch (cmd) { case COMPAT_ASHMEM_SET_SIZE: cmd = ASHMEM_SET_SIZE; @@ -746,16 +744,16 @@ static int __init ashmem_init(void) int ret; ashmem_area_cachep = kmem_cache_create("ashmem_area_cache", - sizeof(struct ashmem_area), - 0, 0, NULL); + sizeof(struct ashmem_area), + 0, 0, NULL); if (unlikely(!ashmem_area_cachep)) { pr_err("failed to create slab cache\n"); return -ENOMEM; } ashmem_range_cachep = kmem_cache_create("ashmem_range_cache", - sizeof(struct ashmem_range), - 0, 0, NULL); + sizeof(struct ashmem_range), + 0, 0, NULL); if (unlikely(!ashmem_range_cachep)) { pr_err("failed to create slab cache\n"); return -ENOMEM; |
