[PATCH] slab: add __must_check to krealloc

From: Pekka J Enberg
Date: Wed Feb 21 2007 - 06:11:02 EST


From: Pekka Enberg <penberg@xxxxxxxxxxxxxx>

As suggested by Arjan, make GCC warn about classic misuse of the realloc API.

Cc: Arjan van de Ven <arjan@xxxxxxxxxxxxx>
Signed-off-by: Pekka Enberg <penberg@xxxxxxxxxxxxxx>
---
include/linux/slab.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Index: 2.6/include/linux/slab.h
===================================================================
--- 2.6.orig/include/linux/slab.h 2007-02-21 13:06:47.000000000 +0200
+++ 2.6/include/linux/slab.h 2007-02-21 13:07:06.000000000 +0200
@@ -72,7 +72,7 @@
*/
void *__kmalloc(size_t, gfp_t);
void *__kzalloc(size_t, gfp_t);
-void *krealloc(const void *, size_t, gfp_t);
+void * __must_check krealloc(const void *, size_t, gfp_t);
void kfree(const void *);
unsigned int ksize(const void *);

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/