public inbox for linux-xfs@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mark kmem_free / kmem_realloc argument as const
@ 2008-05-21  8:06 Christoph Hellwig
  0 siblings, 0 replies; only message in thread
From: Christoph Hellwig @ 2008-05-21  8:06 UTC (permalink / raw)
  To: xfs

Otherwise we get warnings when trying to free const pointers, as done
in the CI code.


Signed-off-by: Christoph Hellwig <hch@lst.de>

Index: linux-2.6-xfs/fs/xfs/linux-2.6/kmem.h
===================================================================
--- linux-2.6-xfs.orig/fs/xfs/linux-2.6/kmem.h	2008-05-21 10:00:42.000000000 +0200
+++ linux-2.6-xfs/fs/xfs/linux-2.6/kmem.h	2008-05-21 10:02:17.000000000 +0200
@@ -57,8 +57,8 @@ kmem_flags_convert(unsigned int __nocast
 extern void *kmem_alloc(size_t, unsigned int __nocast);
 extern void *kmem_zalloc(size_t, unsigned int __nocast);
 extern void *kmem_zalloc_greedy(size_t *, size_t, size_t, unsigned int __nocast);
-extern void *kmem_realloc(void *, size_t, size_t, unsigned int __nocast);
-extern void  kmem_free(void *);
+extern void *kmem_realloc(const void *, size_t, size_t, unsigned int __nocast);
+extern void  kmem_free(const void *);
 
 /*
  * Zone interfaces
Index: linux-2.6-xfs/fs/xfs/linux-2.6/kmem.c
===================================================================
--- linux-2.6-xfs.orig/fs/xfs/linux-2.6/kmem.c	2008-05-21 10:02:21.000000000 +0200
+++ linux-2.6-xfs/fs/xfs/linux-2.6/kmem.c	2008-05-21 10:02:33.000000000 +0200
@@ -90,7 +90,7 @@ kmem_zalloc_greedy(size_t *size, size_t 
 }
 
 void
-kmem_free(void *ptr)
+kmem_free(const void *ptr)
 {
 	if (((unsigned long)ptr < VMALLOC_START) ||
 	    ((unsigned long)ptr >= VMALLOC_END)) {
@@ -101,7 +101,7 @@ kmem_free(void *ptr)
 }
 
 void *
-kmem_realloc(void *ptr, size_t newsize, size_t oldsize,
+kmem_realloc(const void *ptr, size_t newsize, size_t oldsize,
 	     unsigned int __nocast flags)
 {
 	void	*new;

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2008-05-21  8:05 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-21  8:06 [PATCH] mark kmem_free / kmem_realloc argument as const Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox