xfs
[Top] [All Lists]

[PATCH] mark kmem_free / kmem_realloc argument as const

To: xfs@xxxxxxxxxxx
Subject: [PATCH] mark kmem_free / kmem_realloc argument as const
From: Christoph Hellwig <hch@xxxxxx>
Date: Wed, 21 May 2008 10:06:27 +0200
Sender: xfs-bounce@xxxxxxxxxxx
User-agent: Mutt/1.3.28i
Otherwise we get warnings when trying to free const pointers, as done
in the CI code.


Signed-off-by: Christoph Hellwig <hch@xxxxxx>

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;


<Prev in Thread] Current Thread [Next in Thread>
  • [PATCH] mark kmem_free / kmem_realloc argument as const, Christoph Hellwig <=