All of lore.kernel.org
 help / color / mirror / Atom feed
* [KJ] [PATCH 2.6.13-c1 2/17] fix sparse warnings (__nocast type)
@ 2005-07-03 18:48 Victor Fusco
  2005-07-03 22:22 ` Alexey Dobriyan
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Victor Fusco @ 2005-07-03 18:48 UTC (permalink / raw)
  To: kernel-janitors

[-- Attachment #1: Type: text/plain, Size: 151 bytes --]

Description:
	Fix the sparse warning "implicit cast to nocast type"
 
File/Subsystem: mm/slab

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

[-- Attachment #2: slab.patch --]
[-- Type: text/x-diff, Size: 4198 bytes --]

 include/linux/slab.h   |   12 +++++++-----
 include/linux/string.h |    2 +-
 mm/slab.c              |   13 +++++++------
 3 files changed, 15 insertions(+), 12 deletions(-)

Index: linux-2.6-git/mm/slab.c
===================================================================
--- linux-2.6-git.orig/mm/slab.c	2005-07-03 15:00:06.000000000 +0000
+++ linux-2.6-git/mm/slab.c	2005-07-03 15:00:51.000000000 +0000
@@ -584,7 +584,8 @@
 	return cachep->array[smp_processor_id()];
 }
 
-static inline kmem_cache_t *__find_general_cachep(size_t size, int gfpflags)
+static inline kmem_cache_t *__find_general_cachep(size_t size,
+                                                  unsigned int __nocast gfpflags)
 {
 	struct cache_sizes *csizep = malloc_sizes;
 
@@ -608,7 +609,7 @@
 	return csizep->cs_cachep;
 }
 
-kmem_cache_t *kmem_find_general_cachep(size_t size, int gfpflags)
+kmem_cache_t *kmem_find_general_cachep(size_t size, unsigned int __nocast gfpflags)
 {
 	return __find_general_cachep(size, gfpflags);
 }
@@ -1425,7 +1426,7 @@
 	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 +2366,7 @@
  * 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;
@@ -2439,7 +2440,7 @@
 }
 EXPORT_SYMBOL(kmem_cache_alloc_node);
 
-void *kmalloc_node(size_t size, int flags, int node)
+void *kmalloc_node(size_t size, unsigned int __nocast flags, int node)
 {
 	kmem_cache_t *cachep;
 
@@ -3091,7 +3092,7 @@
  * @s: the string to duplicate
  * @gfp: the GFP mask used in the kmalloc() call when allocating memory
  */
-char *kstrdup(const char *s, int gfp)
+char *kstrdup(const char *s, unsigned int __nocast gfp)
 {
 	size_t len;
 	char *buf;
Index: linux-2.6-git/include/linux/slab.h
===================================================================
--- linux-2.6-git.orig/include/linux/slab.h	2005-07-03 15:00:06.000000000 +0000
+++ linux-2.6-git/include/linux/slab.h	2005-07-03 15:00:20.000000000 +0000
@@ -65,7 +65,8 @@
 extern void kmem_cache_free(kmem_cache_t *, void *);
 extern unsigned int kmem_cache_size(kmem_cache_t *);
 extern const char *kmem_cache_name(kmem_cache_t *);
-extern kmem_cache_t *kmem_find_general_cachep(size_t size, int gfpflags);
+extern kmem_cache_t *kmem_find_general_cachep(size_t size,
+                                              unsigned int __nocast gfpflags);
 
 /* Size description struct for general caches. */
 struct cache_sizes {
@@ -104,14 +105,15 @@
 extern unsigned int ksize(const void *);
 
 #ifdef CONFIG_NUMA
-extern void *kmem_cache_alloc_node(kmem_cache_t *, int flags, int node);
-extern void *kmalloc_node(size_t size, 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, unsigned int __nocast 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);
 }
-static inline void *kmalloc_node(size_t size, int flags, int node)
+static inline void *kmalloc_node(size_t size, unsigned int __nocast flags, int node)
 {
 	return kmalloc(size, flags);
 }
Index: linux-2.6-git/include/linux/string.h
===================================================================
--- linux-2.6-git.orig/include/linux/string.h	2005-07-03 15:00:06.000000000 +0000
+++ linux-2.6-git/include/linux/string.h	2005-07-03 15:00:20.000000000 +0000
@@ -88,7 +88,7 @@
 extern void * memchr(const void *,int,__kernel_size_t);
 #endif
 
-extern char *kstrdup(const char *s, int gfp);
+extern char *kstrdup(const char *s, unsigned int __nocast gfp);
 
 #ifdef __cplusplus
 }

[-- Attachment #3: Type: text/plain, Size: 168 bytes --]

_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
https://lists.osdl.org/mailman/listinfo/kernel-janitors

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2005-07-05 15:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-03 18:48 [KJ] [PATCH 2.6.13-c1 2/17] fix sparse warnings (__nocast type) Victor Fusco
2005-07-03 22:22 ` Alexey Dobriyan
2005-07-04  0:58 ` Victor Fusco
2005-07-05 14:06 ` Domen Puncer
2005-07-05 14:52 ` [KJ] [PATCH 2.6.13-c1 2/17] fix sparse warnings [UPDATE] Victor Fusco
2005-07-05 15:07 ` [KJ] [PATCH 2.6.13-c1 2/17] fix sparse warnings (__nocast type) Alexey Dobriyan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.