Pekka J Enberg writes: [...] > + > +The kernel provides the following general purpose memory allocators: > +kmalloc(), kzalloc(), kcalloc(), and vmalloc(). Please refer to the API > +documentation for further information about them. > + > +The preferred form for passing a size of a struct is the following: > + > + p = kmalloc(sizeof(*p), ...); Parentheses around *p are superfluous. See > The C Programming Language, Second Edition > by Brian W. Kernighan and Dennis M. Ritchie. Nikita. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
- Follow-Ups:
- Re: [PATCH] use kzalloc instead of malloc+memset
- From: Denis Vlasenko <vda@ilport.com.ua>
- Re: [PATCH] use kzalloc instead of malloc+memset
- From: Pekka Enberg <penberg@cs.helsinki.fi>
- Re: [PATCH] use kzalloc instead of malloc+memset
- References:
- [PATCH] use kzalloc instead of malloc+memset
- From: Lion Vollnhals <lion.vollnhals@web.de>
- Re: [PATCH] use kzalloc instead of malloc+memset
- From: Jiri Slaby <jirislaby@gmail.com>
- Re: [PATCH] use kzalloc instead of malloc+memset
- From: Pekka Enberg <penberg@cs.helsinki.fi>
- Re: [PATCH] use kzalloc instead of malloc+memset
- From: Dmitry Torokhov <dtor_core@ameritech.net>
- Re: [PATCH] use kzalloc instead of malloc+memset
- From: Andrew Morton <akpm@osdl.org>
- Re: [PATCH] use kzalloc instead of malloc+memset
- From: Pekka J Enberg <penberg@cs.Helsinki.FI>
- [PATCH] use kzalloc instead of malloc+memset
- Prev by Date: [patch 9/11] net: dst_entry.refcount, use, lastuse to use alloc_percpu
- Next by Date: Re: reiser4 oops while mounting
- Previous by thread: Re: [PATCH] use kzalloc instead of malloc+memset
- Next by thread: Re: [PATCH] use kzalloc instead of malloc+memset
- Index(es):
