[<prev] [next>] [day] [month] [year] [list]
Message-id: <1478579872-881-1-git-send-email-ashish.kalra@samsung.com>
Date: Tue, 08 Nov 2016 10:07:52 +0530
From: Ashish Kalra <ashish.kalra@...sung.com>
To: Andrew Morton <akpm@...ux-foundation.org>,
Tejun Heo <tj@...nel.org>, Joe Perches <joe@...ches.com>
Cc: linux-mm@...ck.org, linux-kernel@...r.kernel.org,
Ashish Kalra <ashish.kalra@...sung.com>,
shailesh pandey <p.shailesh@...sung.com>,
vidushi.koul@...sung.com
Subject: [PATCH] mm: dmapool: Fixed following warnings
From: AshishKalra <ashish.kalra@...sung.com>
WARNING: Prefer 'unsigned int' to bare use of 'unsigned'
WARNING: Symbolic permissions 'S_IRUGO' are not preferred. Consider using octal permissions '0444'.
WARNING: Missing a blank line after declarations
Warning were detected with checkpatch.pl
Signed-off-by: AshishKalra <ashish.kalra@...sung.com>
---
mm/dmapool.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/mm/dmapool.c b/mm/dmapool.c
index abcbfe8..9fde077 100644
--- a/mm/dmapool.c
+++ b/mm/dmapool.c
@@ -67,8 +67,8 @@ struct dma_page { /* cacheable header for 'allocation' bytes */
static ssize_t
show_pools(struct device *dev, struct device_attribute *attr, char *buf)
{
- unsigned temp;
- unsigned size;
+ unsigned int temp;
+ unsigned int size;
char *next;
struct dma_page *page;
struct dma_pool *pool;
@@ -82,8 +82,8 @@ struct dma_page { /* cacheable header for 'allocation' bytes */
mutex_lock(&pools_lock);
list_for_each_entry(pool, &dev->dma_pools, pools) {
- unsigned pages = 0;
- unsigned blocks = 0;
+ unsigned int pages = 0;
+ unsigned int blocks = 0;
spin_lock_irq(&pool->lock);
list_for_each_entry(page, &pool->page_list, page_list) {
@@ -105,7 +105,7 @@ struct dma_page { /* cacheable header for 'allocation' bytes */
return PAGE_SIZE - size;
}
-static DEVICE_ATTR(pools, S_IRUGO, show_pools, NULL);
+static DEVICE_ATTR(pools, 0444, show_pools, NULL);
/**
* dma_pool_create - Creates a pool of consistent memory blocks, for dma.
@@ -210,6 +210,7 @@ static void pool_initialise_page(struct dma_pool *pool, struct dma_page *page)
do {
unsigned int next = offset + pool->size;
+
if (unlikely((next + pool->size) >= next_boundary)) {
next = next_boundary;
next_boundary += pool->boundary;
@@ -286,6 +287,7 @@ void dma_pool_destroy(struct dma_pool *pool)
while (!list_empty(&pool->page_list)) {
struct dma_page *page;
+
page = list_entry(pool->page_list.next,
struct dma_page, page_list);
if (is_page_busy(page)) {
@@ -443,6 +445,7 @@ void dma_pool_free(struct dma_pool *pool, void *vaddr, dma_addr_t dma)
}
{
unsigned int chain = page->offset;
+
while (chain < pool->allocation) {
if (chain != offset) {
chain = *(int *)(page->vaddr + chain);
--
1.7.9.5
Powered by blists - more mailing lists