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 [email protected] 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 <[email protected]>
- Re: [PATCH] use kzalloc instead of malloc+memset
- From: Pekka Enberg <[email protected]>
- Re: [PATCH] use kzalloc instead of malloc+memset
- References:
- [PATCH] use kzalloc instead of malloc+memset
- From: Lion Vollnhals <[email protected]>
- Re: [PATCH] use kzalloc instead of malloc+memset
- From: Jiri Slaby <[email protected]>
- Re: [PATCH] use kzalloc instead of malloc+memset
- From: Pekka Enberg <[email protected]>
- Re: [PATCH] use kzalloc instead of malloc+memset
- From: Dmitry Torokhov <[email protected]>
- Re: [PATCH] use kzalloc instead of malloc+memset
- From: Andrew Morton <[email protected]>
- Re: [PATCH] use kzalloc instead of malloc+memset
- From: Pekka J Enberg <[email protected]>
- [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):