diff options
author | Michael Opdenacker <michael.opdenacker@free-electrons.com> | 2013-06-25 12:16:55 -0400 |
---|---|---|
committer | Pekka Enberg <penberg@kernel.org> | 2013-07-07 12:02:59 -0400 |
commit | e7efa615ccf78394338144ff0187be331240748a (patch) | |
tree | 7daaf9b4106ec8fb9e8e946a07fcc2b7cf901547 | |
parent | 0f8f8094d28eb53368ac09186ea6b3a324cc7d44 (diff) |
slab: add kmalloc() to kernel API documentation
At the moment, kmalloc() isn't even listed in the kernel API
documentation (DocBook/kernel-api.html after running "make htmldocs").
Another issue is that the documentation for kmalloc_node()
refers to kcalloc()'s documentation to describe its 'flags' parameter,
while kcalloc() refered to kmalloc()'s documentation, which doesn't exist!
This patch is a proposed fix for this. It also removes the documentation
for kmalloc() in include/linux/slob_def.h which isn't included to
generate the documentation anyway. This way, kmalloc() is described
in only one place.
Acked-by: Christoph Lameter <cl@linux.com>
Acked-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Michael Opdenacker <michael.opdenacker@free-electrons.com>
Signed-off-by: Pekka Enberg <penberg@kernel.org>
-rw-r--r-- | include/linux/slab.h | 18 | ||||
-rw-r--r-- | include/linux/slob_def.h | 8 |
2 files changed, 14 insertions, 12 deletions
diff --git a/include/linux/slab.h b/include/linux/slab.h index 9690c14eb7fb..6c5cc0ea8713 100644 --- a/include/linux/slab.h +++ b/include/linux/slab.h | |||
@@ -373,9 +373,8 @@ int cache_show(struct kmem_cache *s, struct seq_file *m); | |||
373 | void print_slabinfo_header(struct seq_file *m); | 373 | void print_slabinfo_header(struct seq_file *m); |
374 | 374 | ||
375 | /** | 375 | /** |
376 | * kmalloc_array - allocate memory for an array. | 376 | * kmalloc - allocate memory |
377 | * @n: number of elements. | 377 | * @size: how many bytes of memory are required. |
378 | * @size: element size. | ||
379 | * @flags: the type of memory to allocate. | 378 | * @flags: the type of memory to allocate. |
380 | * | 379 | * |
381 | * The @flags argument may be one of: | 380 | * The @flags argument may be one of: |
@@ -422,6 +421,17 @@ void print_slabinfo_header(struct seq_file *m); | |||
422 | * There are other flags available as well, but these are not intended | 421 | * There are other flags available as well, but these are not intended |
423 | * for general use, and so are not documented here. For a full list of | 422 | * for general use, and so are not documented here. For a full list of |
424 | * potential flags, always refer to linux/gfp.h. | 423 | * potential flags, always refer to linux/gfp.h. |
424 | * | ||
425 | * kmalloc is the normal method of allocating memory | ||
426 | * in the kernel. | ||
427 | */ | ||
428 | static __always_inline void *kmalloc(size_t size, gfp_t flags); | ||
429 | |||
430 | /** | ||
431 | * kmalloc_array - allocate memory for an array. | ||
432 | * @n: number of elements. | ||
433 | * @size: element size. | ||
434 | * @flags: the type of memory to allocate (see kmalloc). | ||
425 | */ | 435 | */ |
426 | static inline void *kmalloc_array(size_t n, size_t size, gfp_t flags) | 436 | static inline void *kmalloc_array(size_t n, size_t size, gfp_t flags) |
427 | { | 437 | { |
@@ -445,7 +455,7 @@ static inline void *kcalloc(size_t n, size_t size, gfp_t flags) | |||
445 | /** | 455 | /** |
446 | * kmalloc_node - allocate memory from a specific node | 456 | * kmalloc_node - allocate memory from a specific node |
447 | * @size: how many bytes of memory are required. | 457 | * @size: how many bytes of memory are required. |
448 | * @flags: the type of memory to allocate (see kcalloc). | 458 | * @flags: the type of memory to allocate (see kmalloc). |
449 | * @node: node to allocate from. | 459 | * @node: node to allocate from. |
450 | * | 460 | * |
451 | * kmalloc() for non-local nodes, used to allocate from a specific node | 461 | * kmalloc() for non-local nodes, used to allocate from a specific node |
diff --git a/include/linux/slob_def.h b/include/linux/slob_def.h index f28e14a12e3f..095a5a4a8516 100644 --- a/include/linux/slob_def.h +++ b/include/linux/slob_def.h | |||
@@ -18,14 +18,6 @@ static __always_inline void *kmalloc_node(size_t size, gfp_t flags, int node) | |||
18 | return __kmalloc_node(size, flags, node); | 18 | return __kmalloc_node(size, flags, node); |
19 | } | 19 | } |
20 | 20 | ||
21 | /** | ||
22 | * kmalloc - allocate memory | ||
23 | * @size: how many bytes of memory are required. | ||
24 | * @flags: the type of memory to allocate (see kcalloc). | ||
25 | * | ||
26 | * kmalloc is the normal method of allocating memory | ||
27 | * in the kernel. | ||
28 | */ | ||
29 | static __always_inline void *kmalloc(size_t size, gfp_t flags) | 21 | static __always_inline void *kmalloc(size_t size, gfp_t flags) |
30 | { | 22 | { |
31 | return __kmalloc_node(size, flags, NUMA_NO_NODE); | 23 | return __kmalloc_node(size, flags, NUMA_NO_NODE); |