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

* Re: [KJ] [PATCH 2.6.13-c1 2/17] fix sparse warnings (__nocast type)
  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
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Alexey Dobriyan @ 2005-07-03 22:22 UTC (permalink / raw)
  To: kernel-janitors

On Sunday 03 July 2005 22:48, Victor Fusco wrote:
> --- linux-2.6-git.orig/mm/slab.c
> +++ linux-2.6-git/mm/slab.c

> -		cachep->slabp_cache = kmem_find_general_cachep(slab_size,0);
> +		cachep->slabp_cache = kmem_find_general_cachep(slab_size, 0u);

> -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)

Everything except kmem_cache_alloc_node() annotations and 0u chunk is already in -mm.
_______________________________________________
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

* Re: [KJ] [PATCH 2.6.13-c1 2/17] fix sparse warnings (__nocast type)
  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
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Victor Fusco @ 2005-07-04  0:58 UTC (permalink / raw)
  To: kernel-janitors

Em Dom 03 Jul 2005 22:22, você escreveu:
> On Sunday 03 July 2005 22:48, Victor Fusco wrote:
> > --- linux-2.6-git.orig/mm/slab.c
> > +++ linux-2.6-git/mm/slab.c
> 
> > -		cachep->slabp_cache = kmem_find_general_cachep(slab_size,0);
> > +		cachep->slabp_cache = kmem_find_general_cachep(slab_size, 0u);
> 
> > -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)
> 
> Everything except kmem_cache_alloc_node() annotations and 0u chunk is
> already in -mm. 

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

Signed-off-by: Victor Fusco <victor@cetuc.puc-rio.br>
 
slab.c |    4 ++--
 1 files changed, 2 insertions(+), 2 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
@@ -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;

_______________________________________________
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

* Re: [KJ] [PATCH 2.6.13-c1 2/17] fix sparse warnings (__nocast type)
  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
  4 siblings, 0 replies; 6+ messages in thread
From: Domen Puncer @ 2005-07-05 14:06 UTC (permalink / raw)
  To: kernel-janitors

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

On 04/07/05 00:58 +0000, Victor Fusco wrote:
> Em Dom 03 Jul 2005 22:22, voc? escreveu:
> > On Sunday 03 July 2005 22:48, Victor Fusco wrote:
> > > --- linux-2.6-git.orig/mm/slab.c
> > > +++ linux-2.6-git/mm/slab.c
> > 
> > > -		cachep->slabp_cache = kmem_find_general_cachep(slab_size,0);
> > > +		cachep->slabp_cache = kmem_find_general_cachep(slab_size, 0u);
> > 
> > > -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)
> > 
> > Everything except kmem_cache_alloc_node() annotations and 0u chunk is
> > already in -mm. 
> 
> Description:
> ????????Fix the sparse warning "implicit cast to nocast type"

Can you change "quote-printable" to 7bit, 8bit, plain text or something sane?

> ?
> File/Subsystem: mm/slab
> 
> Signed-off-by: Victor Fusco <victor@cetuc.puc-rio.br>
>  
> slab.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 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
> @@ -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)

Line wrapped.


[-- Attachment #2: 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

* [KJ] [PATCH 2.6.13-c1 2/17] fix sparse warnings [UPDATE]
  2005-07-03 18:48 [KJ] [PATCH 2.6.13-c1 2/17] fix sparse warnings (__nocast type) Victor Fusco
                   ` (2 preceding siblings ...)
  2005-07-05 14:06 ` Domen Puncer
@ 2005-07-05 14:52 ` Victor Fusco
  2005-07-05 15:07 ` [KJ] [PATCH 2.6.13-c1 2/17] fix sparse warnings (__nocast type) Alexey Dobriyan
  4 siblings, 0 replies; 6+ messages in thread
From: Victor Fusco @ 2005-07-05 14:52 UTC (permalink / raw)
  To: kernel-janitors

On Tuesday 05 Jul 2005 15:07, Alexey Dobriyan wrote:
> > Line wrapped.
> 
> And doesn't change prototype.
> 

Description:
     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: linux-2.6-git/mm/slab.c
=================================--- linux-2.6-git.orig/mm/slab.c	2005-07-05 13:30:54.000000000 +0000
+++ linux-2.6-git/mm/slab.c	2005-07-05 13:31:03.000000000 +0000
@@ -1425,7 +1425,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 +2365,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;
Index: linux-2.6-git/include/linux/slab.h
=================================--- linux-2.6-git.orig/include/linux/slab.h	2005-07-05 13:18:04.000000000 +0000
+++ linux-2.6-git/include/linux/slab.h	2005-07-05 13:34:54.000000000 +0000
@@ -104,10 +104,14 @@
 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);
 }

--

_______________________________________________
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

* Re: [KJ] [PATCH 2.6.13-c1 2/17] fix sparse warnings (__nocast type)
  2005-07-03 18:48 [KJ] [PATCH 2.6.13-c1 2/17] fix sparse warnings (__nocast type) Victor Fusco
                   ` (3 preceding siblings ...)
  2005-07-05 14:52 ` [KJ] [PATCH 2.6.13-c1 2/17] fix sparse warnings [UPDATE] Victor Fusco
@ 2005-07-05 15:07 ` Alexey Dobriyan
  4 siblings, 0 replies; 6+ messages in thread
From: Alexey Dobriyan @ 2005-07-05 15:07 UTC (permalink / raw)
  To: kernel-janitors

On Tuesday 05 July 2005 18:06, Domen Puncer wrote:
> On 04/07/05 00:58 +0000, Victor Fusco wrote:
> > --- 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
> > @@ -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)
> 
> Line wrapped.

And doesn't change prototype.
_______________________________________________
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.