Re: [PATCH RFC v2] slab: introduce kmalloc_array

From: Xi Wang
Date: Mon Feb 13 2012 - 10:08:10 EST


Here goes a quick summary.

Proposed names
==============

kaalloc (Alexey Dobriyan)

kcallocn (Andrew Morton)

kmalloc_array (Pekka Enberg)

knalloc (Andrew Morton, Xi Wang)

kncalloc (Andrew Morton)

Other changes
=============

Documentation/CodingStyle "Chapter 14: Allocating memory"

* Mention the new array allocator whatever-it-is-called.

* Add some description:

"The preferred form for allocating an array is the following:

p = whatever-it-is-called(n, sizeof(...), ...);

To return zeroed items, the preferred form is the following:

p = kcalloc(n, sizeof(...), ...);

Both forms avoid overflowing the allocation size n * sizeof(...)."

* Add some checkpatch rule?

- xi
--
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/