From: Christoph Hellwig <hch@lst.de>
To: xfs@oss.sgi.com
Subject: [PATCH] mark kmem_free / kmem_realloc argument as const
Date: Wed, 21 May 2008 10:06:27 +0200 [thread overview]
Message-ID: <20080521080627.GA1605@lst.de> (raw)
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;
reply other threads:[~2008-05-21 8:05 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080521080627.GA1605@lst.de \
--to=hch@lst.de \
--cc=xfs@oss.sgi.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.