[PATCH -next] drm: ttm_page_alloc, fix all sparse warnings
Randy Dunlap
randy.dunlap at oracle.com
Mon Jun 28 15:27:28 PDT 2010
From: Randy Dunlap <randy.dunlap at oracle.com>
Fix all sparse warnings in ttm_page_alloc.c.
Signed-off-by: Randy Dunlap <randy.dunlap at oracle.com>
Cc: David Airlie <airlied at linux.ie>
Cc: dri-devel at lists.freedesktop.org
---
drivers/gpu/drm/ttm/ttm_page_alloc.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/ttm/ttm_page_alloc.c:819:26: warning: non-ANSI function declaration of function 'ttm_page_alloc_fini'
drivers/gpu/drm/ttm/ttm_page_alloc.c:499:21: warning: incorrect type in argument 1 (different base types)
drivers/gpu/drm/ttm/ttm_page_alloc.c:499:21: expected restricted gfp_t [usertype] gfp_mask
drivers/gpu/drm/ttm/ttm_page_alloc.c:499:21: got int [signed] gfp_flags
drivers/gpu/drm/ttm/ttm_page_alloc.c:670:25: warning: incorrect type in initializer (different base types)
drivers/gpu/drm/ttm/ttm_page_alloc.c:670:25: expected int [signed] gfp_flags
drivers/gpu/drm/ttm/ttm_page_alloc.c:670:25: got restricted gfp_t
drivers/gpu/drm/ttm/ttm_page_alloc.c:675:27: warning: invalid assignment: |=
drivers/gpu/drm/ttm/ttm_page_alloc.c:675:27: left side has type int
drivers/gpu/drm/ttm/ttm_page_alloc.c:675:27: right side has type restricted gfp_t
drivers/gpu/drm/ttm/ttm_page_alloc.c:680:35: warning: invalid assignment: |=
drivers/gpu/drm/ttm/ttm_page_alloc.c:680:35: left side has type int
drivers/gpu/drm/ttm/ttm_page_alloc.c:680:35: right side has type restricted gfp_t
drivers/gpu/drm/ttm/ttm_page_alloc.c:682:35: warning: invalid assignment: |=
drivers/gpu/drm/ttm/ttm_page_alloc.c:682:35: left side has type int
drivers/gpu/drm/ttm/ttm_page_alloc.c:682:35: right side has type restricted gfp_t
drivers/gpu/drm/ttm/ttm_page_alloc.c:685:29: warning: incorrect type in argument 1 (different base types)
drivers/gpu/drm/ttm/ttm_page_alloc.c:685:29: expected restricted gfp_t [usertype] gfp_mask
drivers/gpu/drm/ttm/ttm_page_alloc.c:685:29: got int [signed] gfp_flags
drivers/gpu/drm/ttm/ttm_page_alloc.c:793:54: warning: incorrect type in argument 2 (different base types)
drivers/gpu/drm/ttm/ttm_page_alloc.c:793:54: expected int [signed] flags
drivers/gpu/drm/ttm/ttm_page_alloc.c:793:54: got restricted gfp_t
drivers/gpu/drm/ttm/ttm_page_alloc.c:795:54: warning: incorrect type in argument 2 (different base types)
drivers/gpu/drm/ttm/ttm_page_alloc.c:795:54: expected int [signed] flags
drivers/gpu/drm/ttm/ttm_page_alloc.c:795:54: got restricted gfp_t
drivers/gpu/drm/ttm/ttm_page_alloc.c:797:69: warning: incorrect type in argument 2 (different base types)
drivers/gpu/drm/ttm/ttm_page_alloc.c:797:69: expected int [signed] flags
drivers/gpu/drm/ttm/ttm_page_alloc.c:797:69: got restricted gfp_t
drivers/gpu/drm/ttm/ttm_page_alloc.c:800:69: warning: incorrect type in argument 2 (different base types)
drivers/gpu/drm/ttm/ttm_page_alloc.c:800:69: expected int [signed] flags
drivers/gpu/drm/ttm/ttm_page_alloc.c:800:69: got restricted gfp_t
--- linux-next-20100625.orig/drivers/gpu/drm/ttm/ttm_page_alloc.c
+++ linux-next-20100625/drivers/gpu/drm/ttm/ttm_page_alloc.c
@@ -67,7 +67,7 @@ struct ttm_page_pool {
spinlock_t lock;
bool fill_lock;
struct list_head list;
- int gfp_flags;
+ gfp_t gfp_flags;
unsigned npages;
char *name;
unsigned long nfrees;
@@ -476,7 +476,7 @@ static void ttm_handle_caching_state_fai
* This function is reentrant if caller updates count depending on number of
* pages returned in pages array.
*/
-static int ttm_alloc_new_pages(struct list_head *pages, int gfp_flags,
+static int ttm_alloc_new_pages(struct list_head *pages, gfp_t gfp_flags,
int ttm_flags, enum ttm_caching_state cstate, unsigned count)
{
struct page **caching_array;
@@ -667,7 +667,7 @@ int ttm_get_pages(struct list_head *page
{
struct ttm_page_pool *pool = ttm_get_pool(flags, cstate);
struct page *p = NULL;
- int gfp_flags = GFP_USER;
+ gfp_t gfp_flags = GFP_USER;
int r;
/* set zero flag for page allocation if required */
@@ -771,7 +771,7 @@ void ttm_put_pages(struct list_head *pag
ttm_page_pool_free(pool, page_count);
}
-static void ttm_page_pool_init_locked(struct ttm_page_pool *pool, int flags,
+static void ttm_page_pool_init_locked(struct ttm_page_pool *pool, gfp_t flags,
char *name)
{
spin_lock_init(&pool->lock);
More information about the dri-devel
mailing list