From: Victor Fusco <victor@cetuc.puc-rio.br>
Subject: [KJ] [PATCH 2.6.13-c1 2/17] fix sparse warnings [UPDATE]

Fix the sparse warning "implicit cast to nocast type"

File/Subsystem: mm/slab

Signed-off-by: Victor Fusco <victor@cetuc.puc-rio.br>


---
 include/linux/slab.h |    8 ++++++--
 mm/slab.c            |    4 ++--
 2 files changed, 8 insertions(+), 4 deletions(-)

Index: quilt/mm/slab.c
===================================================================
--- quilt.orig/mm/slab.c
+++ quilt/mm/slab.c
@@ -1425,7 +1425,7 @@ next:
 	INIT_LIST_HEAD(&cachep->lists.slabs_free);
 
 	if (flags & CFLGS_OFF_SLAB)
-		cachep->slabp_cache = kmem_find_general_cachep(slab_size,0);
+		cachep->slabp_cache = kmem_find_general_cachep(slab_size, 0u);
 	cachep->ctor = ctor;
 	cachep->dtor = dtor;
 	cachep->name = name;
@@ -2365,7 +2365,7 @@ out:
  * and can sleep. And it will allocate memory on the given node, which
  * can improve the performance for cpu bound structures.
  */
-void *kmem_cache_alloc_node(kmem_cache_t *cachep, int flags, int nodeid)
+void *kmem_cache_alloc_node(kmem_cache_t *cachep, unsigned int __nocast flags, int nodeid)
 {
 	int loop;
 	void *objp;
Index: quilt/include/linux/slab.h
===================================================================
--- quilt.orig/include/linux/slab.h
+++ quilt/include/linux/slab.h
@@ -104,10 +104,14 @@ extern void kfree(const void *);
 extern unsigned int ksize(const void *);
 
 #ifdef CONFIG_NUMA
-extern void *kmem_cache_alloc_node(kmem_cache_t *, int flags, int node);
+extern void *kmem_cache_alloc_node(kmem_cache_t *,
+                                   unsigned int __nocast flags,
+                                   int node);
 extern void *kmalloc_node(size_t size, int flags, int node);
 #else
-static inline void *kmem_cache_alloc_node(kmem_cache_t *cachep, int flags, int node)
+static inline void *kmem_cache_alloc_node(kmem_cache_t *cachep,
+                                          unsigned int __nocast flags,
+                                          int node)
 {
 	return kmem_cache_alloc(cachep, flags);
 }
