]> Pileus Git - ~andy/linux/commitdiff
ion: Cleanup whitespace issues and other checkpatch problems
authorJohn Stultz <john.stultz@linaro.org>
Sat, 14 Dec 2013 03:26:33 +0000 (19:26 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 14 Dec 2013 16:59:54 +0000 (08:59 -0800)
Just some simple cleanups to address whitespace issues and
other issues found w/ checkpatch.

Signed-off-by: John Stultz <john.stultz@linaro.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/android/ion/compat_ion.c
drivers/staging/android/ion/ion.c
drivers/staging/android/ion/ion.h
drivers/staging/android/ion/ion_chunk_heap.c
drivers/staging/android/ion/ion_heap.c
drivers/staging/android/ion/ion_page_pool.c
drivers/staging/android/ion/ion_priv.h
drivers/staging/android/ion/ion_system_heap.c

index 079a5bbd2951c19c62798e9e1bf06f33c92f11b6..af6cd370b30f3e890e5edc9bdec864efb4f8b9b8 100644 (file)
@@ -91,8 +91,8 @@ static int compat_get_ion_custom_data(
                        struct compat_ion_custom_data __user *data32,
                        struct ion_custom_data __user *data)
 {
-        compat_uint_t cmd;
-        compat_ulong_t arg;
+       compat_uint_t cmd;
+       compat_ulong_t arg;
        int err;
 
        err = get_user(cmd, &data32->cmd);
index 559e4ee6f7e5c0137cfc21e75c9fc25012990a8e..574066ff73f80d48777ba3189e89fb1ac4f8ad0c 100644 (file)
@@ -110,8 +110,8 @@ struct ion_handle {
 
 bool ion_buffer_fault_user_mappings(struct ion_buffer *buffer)
 {
-       return ((buffer->flags & ION_FLAG_CACHED) &&
-               !(buffer->flags & ION_FLAG_CACHED_NEEDS_SYNC));
+       return (buffer->flags & ION_FLAG_CACHED) &&
+               !(buffer->flags & ION_FLAG_CACHED_NEEDS_SYNC);
 }
 
 bool ion_buffer_cached(struct ion_buffer *buffer)
@@ -202,7 +202,8 @@ static struct ion_buffer *ion_buffer_create(struct ion_heap *heap,
        buffer->size = len;
 
        table = heap->ops->map_dma(heap, buffer);
-       if (WARN_ONCE(table == NULL, "heap->ops->map_dma should return ERR_PTR on error"))
+       if (WARN_ONCE(table == NULL,
+                       "heap->ops->map_dma should return ERR_PTR on error"))
                table = ERR_PTR(-EINVAL);
        if (IS_ERR(table)) {
                heap->ops->free(buffer);
@@ -424,7 +425,8 @@ static struct ion_handle *ion_handle_get_by_id(struct ion_client *client,
        return handle ? handle : ERR_PTR(-EINVAL);
 }
 
-static bool ion_handle_validate(struct ion_client *client, struct ion_handle *handle)
+static bool ion_handle_validate(struct ion_client *client,
+                               struct ion_handle *handle)
 {
        WARN_ON(!mutex_is_locked(&client->lock));
        return (idr_find(&client->idr, handle->id) == handle);
@@ -578,7 +580,8 @@ static void *ion_buffer_kmap_get(struct ion_buffer *buffer)
                return buffer->vaddr;
        }
        vaddr = buffer->heap->ops->map_kernel(buffer->heap, buffer);
-       if (WARN_ONCE(vaddr == NULL, "heap->ops->map_kernel should return ERR_PTR on error"))
+       if (WARN_ONCE(vaddr == NULL,
+                       "heap->ops->map_kernel should return ERR_PTR on error"))
                return ERR_PTR(-EINVAL);
        if (IS_ERR(vaddr))
                return vaddr;
@@ -1403,39 +1406,39 @@ static const struct file_operations debug_heap_fops = {
 #ifdef DEBUG_HEAP_SHRINKER
 static int debug_shrink_set(void *data, u64 val)
 {
-        struct ion_heap *heap = data;
-        struct shrink_control sc;
-        int objs;
+       struct ion_heap *heap = data;
+       struct shrink_control sc;
+       int objs;
 
-        sc.gfp_mask = -1;
-        sc.nr_to_scan = 0;
+       sc.gfp_mask = -1;
+       sc.nr_to_scan = 0;
 
-        if (!val)
-                return 0;
+       if (!val)
+               return 0;
 
-        objs = heap->shrinker.shrink(&heap->shrinker, &sc);
-        sc.nr_to_scan = objs;
+       objs = heap->shrinker.shrink(&heap->shrinker, &sc);
+       sc.nr_to_scan = objs;
 
-        heap->shrinker.shrink(&heap->shrinker, &sc);
-        return 0;
+       heap->shrinker.shrink(&heap->shrinker, &sc);
+       return 0;
 }
 
 static int debug_shrink_get(void *data, u64 *val)
 {
-        struct ion_heap *heap = data;
-        struct shrink_control sc;
-        int objs;
+       struct ion_heap *heap = data;
+       struct shrink_control sc;
+       int objs;
 
-        sc.gfp_mask = -1;
-        sc.nr_to_scan = 0;
+       sc.gfp_mask = -1;
+       sc.nr_to_scan = 0;
 
-        objs = heap->shrinker.shrink(&heap->shrinker, &sc);
-        *val = objs;
-        return 0;
+       objs = heap->shrinker.shrink(&heap->shrinker, &sc);
+       *val = objs;
+       return 0;
 }
 
 DEFINE_SIMPLE_ATTRIBUTE(debug_shrink_fops, debug_shrink_get,
-                        debug_shrink_set, "%llu\n");
+                       debug_shrink_set, "%llu\n");
 #endif
 
 void ion_device_add_heap(struct ion_device *dev, struct ion_heap *heap)
index 962e1c58d3622fffca181cce9dc071671399b351..dcd2a0cdb192ed51f63c27da409bd8bfa7a2d026 100644 (file)
@@ -38,7 +38,7 @@ struct ion_buffer;
  * struct ion_platform_heap - defines a heap in the given platform
  * @type:      type of the heap from ion_heap_type enum
  * @id:                unique identifier for heap.  When allocating higher numbers
- *             will be allocated from first.  At allocation these are passed
+ *             will be allocated from first.  At allocation these are passed
  *             as a bit mask and therefore can not exceed ION_NUM_HEAP_IDS.
  * @name:      used for debug purposes
  * @base:      base address of heap in physical memory if applicable
index a0720891fe4e4ca52598da28ce87d8f28a60e276..d40f5f831808aa38b84d64c23954a504e059df32 100644 (file)
@@ -13,7 +13,6 @@
  * GNU General Public License for more details.
  *
  */
-//#include <linux/spinlock.h>
 #include <linux/dma-mapping.h>
 #include <linux/err.h>
 #include <linux/genalloc.h>
index 2d1d5555fc3d7e4697da8390f92caa0ed157760a..9cf562224386ef245be0fc3d3460cbeda667f3a4 100644 (file)
@@ -49,9 +49,8 @@ void *ion_heap_map_kernel(struct ion_heap *heap,
                int npages_this_entry = PAGE_ALIGN(sg->length) / PAGE_SIZE;
                struct page *page = sg_page(sg);
                BUG_ON(i >= npages);
-               for (j = 0; j < npages_this_entry; j++) {
+               for (j = 0; j < npages_this_entry; j++)
                        *(tmp++) = page++;
-               }
        }
        vaddr = vmap(pages, npages, VM_MAP, pgprot);
        vfree(pages);
@@ -159,7 +158,7 @@ int ion_heap_pages_zero(struct page *page, size_t size, pgprot_t pgprot)
        return ion_heap_sglist_zero(&sg, 1, pgprot);
 }
 
-void ion_heap_freelist_add(struct ion_heap *heap, struct ion_buffer * buffer)
+void ion_heap_freelist_add(struct ion_heap *heap, struct ion_buffer *buffer)
 {
        rt_mutex_lock(&heap->lock);
        list_add(&buffer->list, &heap->free_list);
index a1c51a839d665ae84cad1ae8c4eb523d69002737..fa693c23681a7d15f60e2c84155ec22dc23a30c8 100644 (file)
@@ -108,7 +108,7 @@ void *ion_page_pool_alloc(struct ion_page_pool *pool)
        return page;
 }
 
-void ion_page_pool_free(struct ion_page_pool *pool, struct pagepage)
+void ion_page_pool_free(struct ion_page_pool *pool, struct page *page)
 {
        int ret;
 
index fa96175f77315e3964437a1bba8485fba8ce990e..fc8a4c3cee5d53edb56b5702ee31c990e614660b 100644 (file)
@@ -230,7 +230,7 @@ int ion_heap_init_deferred_free(struct ion_heap *heap);
 /**
  * ion_heap_freelist_add - add a buffer to the deferred free list
  * @heap:              the heap
- * @buffer:            the buffer
+ * @buffer:            the buffer
  *
  * Adds an item to the deferred freelist.
  */
index 301d019a32704a61b60795fceeba5fdb95ec55f2..b5acd6c178e6b386eb4435114fc9c755bffbb7d8 100644 (file)
@@ -148,7 +148,8 @@ static int ion_system_heap_allocate(struct ion_heap *heap,
 
        INIT_LIST_HEAD(&pages);
        while (size_remaining > 0) {
-               info = alloc_largest_available(sys_heap, buffer, size_remaining, max_order);
+               info = alloc_largest_available(sys_heap, buffer, size_remaining,
+                                               max_order);
                if (!info)
                        goto err;
                list_add_tail(&info->list, &pages);