summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKen Adams <kadams@nvidia.com>2011-09-26 11:02:09 -0400
committerRohan Somvanshi <rsomvanshi@nvidia.com>2011-09-28 05:17:21 -0700
commitb0ecb9d3b257ca270df89218f159c8ea868ee328 (patch)
tree6e801239ce00ae3e422ea3dd51c9ee0b7bc4b3cd
parentd1fe5e9e010a43da1cb17573f29109444c708948 (diff)
video: tegra: nvmap: fix checkpatch.pl issues
Change-Id: Ic7fab1575312afd27430b46a50aa6f7a7de0ac4e Reviewed-on: http://git-master/r/53843 Reviewed-by: Rohan Somvanshi <rsomvanshi@nvidia.com> Tested-by: Rohan Somvanshi <rsomvanshi@nvidia.com>
-rw-r--r--drivers/video/tegra/nvmap/nvmap.h2
-rw-r--r--drivers/video/tegra/nvmap/nvmap_common.h2
-rw-r--r--drivers/video/tegra/nvmap/nvmap_dev.c14
-rw-r--r--drivers/video/tegra/nvmap/nvmap_handle.c4
-rw-r--r--drivers/video/tegra/nvmap/nvmap_heap.c8
-rw-r--r--drivers/video/tegra/nvmap/nvmap_heap.h3
-rw-r--r--drivers/video/tegra/nvmap/nvmap_ioctl.c19
-rw-r--r--drivers/video/tegra/nvmap/nvmap_mru.c4
-rw-r--r--drivers/video/tegra/nvmap/nvmap_mru.h4
9 files changed, 27 insertions, 33 deletions
diff --git a/drivers/video/tegra/nvmap/nvmap.h b/drivers/video/tegra/nvmap/nvmap.h
index 8798949354d4..d8e66567aa5d 100644
--- a/drivers/video/tegra/nvmap/nvmap.h
+++ b/drivers/video/tegra/nvmap/nvmap.h
@@ -30,7 +30,7 @@
#include <linux/sched.h>
#include <linux/wait.h>
-#include <asm/atomic.h>
+#include <linux/atomic.h>
#include <mach/nvmap.h>
diff --git a/drivers/video/tegra/nvmap/nvmap_common.h b/drivers/video/tegra/nvmap/nvmap_common.h
index 20d27fa955bb..6da010720bb2 100644
--- a/drivers/video/tegra/nvmap/nvmap_common.h
+++ b/drivers/video/tegra/nvmap/nvmap_common.h
@@ -34,3 +34,5 @@ static inline void inner_clean_cache_all(void)
{
on_each_cpu(v7_clean_kern_cache_all, NULL, 1);
}
+
+extern void __flush_dcache_page(struct address_space *, struct page *);
diff --git a/drivers/video/tegra/nvmap/nvmap_dev.c b/drivers/video/tegra/nvmap/nvmap_dev.c
index 256c07fc3f3a..c98c0bb3bea8 100644
--- a/drivers/video/tegra/nvmap/nvmap_dev.c
+++ b/drivers/video/tegra/nvmap/nvmap_dev.c
@@ -61,7 +61,7 @@ struct nvmap_carveout_node {
struct nvmap_heap *carveout;
int index;
struct list_head clients;
- spinlock_t clients_lock;
+ spinlock_t clients_lock;
};
struct nvmap_device {
@@ -287,7 +287,7 @@ int nvmap_flush_heap_block(struct nvmap_client *client,
if (prot == NVMAP_HANDLE_UNCACHEABLE || prot == NVMAP_HANDLE_WRITE_COMBINE)
goto out;
- if ( len >= FLUSH_CLEAN_BY_SET_WAY_THRESHOLD ) {
+ if (len >= FLUSH_CLEAN_BY_SET_WAY_THRESHOLD) {
inner_flush_cache_all();
if (prot != NVMAP_HANDLE_INNER_CACHEABLE)
outer_flush_range(block->base, block->base + len);
@@ -315,7 +315,7 @@ int nvmap_flush_heap_block(struct nvmap_client *client,
if (prot != NVMAP_HANDLE_INNER_CACHEABLE)
outer_flush_range(block->base, block->base + len);
- nvmap_free_pte((client ? client->dev: nvmap_dev), pte);
+ nvmap_free_pte((client ? client->dev : nvmap_dev), pte);
out:
wmb();
return 0;
@@ -361,7 +361,7 @@ void nvmap_carveout_commit_subtract(struct nvmap_client *client,
spin_unlock_irqrestore(&node->clients_lock, flags);
}
-static struct nvmap_client* get_client_from_carveout_commit(
+static struct nvmap_client *get_client_from_carveout_commit(
struct nvmap_carveout_node *node, struct nvmap_carveout_commit *commit)
{
struct nvmap_carveout_commit *first_commit = commit - node->index;
@@ -680,7 +680,7 @@ static void destroy_client(struct nvmap_client *client)
pins = atomic_read(&ref->pin);
if (ref->handle->owner == client)
- ref->handle->owner = NULL;
+ ref->handle->owner = NULL;
while (pins--)
nvmap_unpin_handles(client, &ref->handle, 1);
@@ -1026,7 +1026,7 @@ static int nvmap_debug_allocations_open(struct inode *inode, struct file *file)
inode->i_private);
}
-static struct file_operations debug_allocations_fops = {
+static const struct file_operations debug_allocations_fops = {
.open = nvmap_debug_allocations_open,
.read = seq_read,
.llseek = seq_lseek,
@@ -1061,7 +1061,7 @@ static int nvmap_debug_clients_open(struct inode *inode, struct file *file)
return single_open(file, nvmap_debug_clients_show, inode->i_private);
}
-static struct file_operations debug_clients_fops = {
+static const struct file_operations debug_clients_fops = {
.open = nvmap_debug_clients_open,
.read = seq_read,
.llseek = seq_lseek,
diff --git a/drivers/video/tegra/nvmap/nvmap_handle.c b/drivers/video/tegra/nvmap/nvmap_handle.c
index c2085051ba1c..e028292f98ea 100644
--- a/drivers/video/tegra/nvmap/nvmap_handle.c
+++ b/drivers/video/tegra/nvmap/nvmap_handle.c
@@ -117,8 +117,6 @@ out:
kfree(h);
}
-extern void __flush_dcache_page(struct address_space *, struct page *);
-
static struct page *nvmap_alloc_pages_exact(gfp_t gfp, size_t size)
{
struct page *page, *p, *e;
@@ -503,7 +501,7 @@ struct nvmap_handle_ref *nvmap_create_handle(struct nvmap_client *client,
struct nvmap_handle *h;
struct nvmap_handle_ref *ref = NULL;
- if (!client )
+ if (!client)
return ERR_PTR(-EINVAL);
if (!size)
diff --git a/drivers/video/tegra/nvmap/nvmap_heap.c b/drivers/video/tegra/nvmap/nvmap_heap.c
index 1378a5cb1f79..7474f31534ff 100644
--- a/drivers/video/tegra/nvmap/nvmap_heap.c
+++ b/drivers/video/tegra/nvmap/nvmap_heap.c
@@ -424,9 +424,8 @@ static struct nvmap_heap_block *do_heap_alloc(struct nvmap_heap *heap,
/* needed for compaction. relocated chunk
* should never go up */
- if (base_max && fix_base > base_max) {
+ if (base_max && fix_base > base_max)
break;
- }
if (fix_size >= len) {
b = i;
@@ -510,7 +509,7 @@ static void freelist_debug(struct nvmap_heap *heap, const char *title,
dev_debug(&heap->dev, "%s\n", title);
i = 0;
list_for_each_entry(n, &heap->free_list, free_list) {
- dev_debug(&heap->dev,"\t%d [%p..%p]%s\n", i, (void *)n->orig_addr,
+ dev_debug(&heap->dev, "\t%d [%p..%p]%s\n", i, (void *)n->orig_addr,
(void *)(n->orig_addr + n->size),
(n == token) ? "<--" : "");
i++;
@@ -901,9 +900,6 @@ struct nvmap_heap *nvmap_block_to_heap(struct nvmap_heap_block *b)
}
}
-int nvmap_flush_heap_block(struct nvmap_client *client,
- struct nvmap_heap_block *block, size_t len, unsigned int prot);
-
/* nvmap_heap_free: frees block b*/
void nvmap_heap_free(struct nvmap_heap_block *b)
{
diff --git a/drivers/video/tegra/nvmap/nvmap_heap.h b/drivers/video/tegra/nvmap/nvmap_heap.h
index 2533c13049c8..158a1fa3d33c 100644
--- a/drivers/video/tegra/nvmap/nvmap_heap.h
+++ b/drivers/video/tegra/nvmap/nvmap_heap.h
@@ -62,4 +62,7 @@ int __init nvmap_heap_init(void);
void nvmap_heap_deinit(void);
+int nvmap_flush_heap_block(struct nvmap_client *client,
+ struct nvmap_heap_block *block, size_t len, unsigned int prot);
+
#endif
diff --git a/drivers/video/tegra/nvmap/nvmap_ioctl.c b/drivers/video/tegra/nvmap/nvmap_ioctl.c
index 4b4d7c35aa20..76fa897b41e0 100644
--- a/drivers/video/tegra/nvmap/nvmap_ioctl.c
+++ b/drivers/video/tegra/nvmap/nvmap_ioctl.c
@@ -345,8 +345,7 @@ int nvmap_ioctl_get_param(struct file *filp, void __user* arg)
mutex_lock(&h->lock);
op.result = h->carveout->base;
mutex_unlock(&h->lock);
- }
- else if (h->pgalloc.contig)
+ } else if (h->pgalloc.contig)
op.result = page_to_phys(h->pgalloc.pages[0]);
else if (h->pgalloc.area)
op.result = h->pgalloc.area->iovm_start;
@@ -360,8 +359,7 @@ int nvmap_ioctl_get_param(struct file *filp, void __user* arg)
mutex_lock(&h->lock);
op.result = nvmap_carveout_usage(client, h->carveout);
mutex_unlock(&h->lock);
- }
- else if (h->pgalloc.contig)
+ } else if (h->pgalloc.contig)
op.result = NVMAP_HEAP_SYSMEM;
else
op.result = NVMAP_HEAP_IOVMM;
@@ -530,15 +528,14 @@ static bool fast_cache_maint(struct nvmap_client *client, struct nvmap_handle *h
{
int ret = false;
- if ( (op == NVMAP_CACHE_OP_INV) ||
- ((end - start) < FLUSH_CLEAN_BY_SET_WAY_THRESHOLD) )
+ if ((op == NVMAP_CACHE_OP_INV) ||
+ ((end - start) < FLUSH_CLEAN_BY_SET_WAY_THRESHOLD))
goto out;
- if (op == NVMAP_CACHE_OP_WB_INV) {
+ if (op == NVMAP_CACHE_OP_WB_INV)
inner_flush_cache_all();
- } else if (op == NVMAP_CACHE_OP_WB) {
+ else if (op == NVMAP_CACHE_OP_WB)
inner_clean_cache_all();
- }
if (h->heap_pgalloc && (h->flags != NVMAP_HANDLE_INNER_CACHEABLE)) {
heap_page_cache_maint(client, h, start, end, op,
@@ -719,7 +716,7 @@ static ssize_t rw_handle(struct nvmap_client *client, struct nvmap_handle *h,
ret = -EFAULT;
break;
}
- if(is_read)
+ if (is_read)
cache_maint(client, h, h_offs,
h_offs + elem_size, NVMAP_CACHE_OP_INV);
@@ -729,7 +726,7 @@ static ssize_t rw_handle(struct nvmap_client *client, struct nvmap_handle *h,
if (ret)
break;
- if(!is_read)
+ if (!is_read)
cache_maint(client, h, h_offs,
h_offs + elem_size, NVMAP_CACHE_OP_WB);
diff --git a/drivers/video/tegra/nvmap/nvmap_mru.c b/drivers/video/tegra/nvmap/nvmap_mru.c
index 55b79644223a..bfb8c12723ba 100644
--- a/drivers/video/tegra/nvmap/nvmap_mru.c
+++ b/drivers/video/tegra/nvmap/nvmap_mru.c
@@ -182,8 +182,6 @@ int nvmap_mru_init(struct nvmap_share *share)
void nvmap_mru_destroy(struct nvmap_share *share)
{
- if (share->mru_lists)
- kfree(share->mru_lists);
-
+ kfree(share->mru_lists);
share->mru_lists = NULL;
}
diff --git a/drivers/video/tegra/nvmap/nvmap_mru.h b/drivers/video/tegra/nvmap/nvmap_mru.h
index 79ba8145a3af..6c94630bc3ef 100644
--- a/drivers/video/tegra/nvmap/nvmap_mru.h
+++ b/drivers/video/tegra/nvmap/nvmap_mru.h
@@ -65,11 +65,11 @@ struct tegra_iovmm_area *nvmap_handle_iovmm_locked(struct nvmap_client *c,
#define nvmap_mru_vm_size(_a) tegra_iovmm_get_vm_size(_a)
static inline void nvmap_mru_insert_locked(struct nvmap_share *share,
- struct nvmap_handle *h)
+ struct nvmap_handle *h)
{ }
static inline void nvmap_mru_remove(struct nvmap_share *s,
- struct nvmap_handle *h)
+ struct nvmap_handle *h)
{ }
static inline struct tegra_iovmm_area *nvmap_handle_iovmm_locked(struct nvmap_client *c,