Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

slab.h: remove duplicate kmalloc declaration and fix kernel-doc warnings

Fix kernel-doc warning for duplicate definition of 'kmalloc':

Documentation/DocBook/kernel-api.xml:9483: element refentry: validity error : ID API-kmalloc already defined
<refentry id="API-kmalloc">

Also combine the kernel-doc info from the 2 kmalloc definitions into one
block and remove the "see kcalloc" comment since kmalloc now contains the
@flags info.

Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Acked-by: Christoph Lameter <cl@linux.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Randy Dunlap and committed by
Linus Torvalds
7e3528c3 76ae076f

+46 -56
+46 -56
include/linux/slab.h
··· 388 388 /** 389 389 * kmalloc - allocate memory 390 390 * @size: how many bytes of memory are required. 391 - * @flags: the type of memory to allocate (see kcalloc). 391 + * @flags: the type of memory to allocate. 392 392 * 393 393 * kmalloc is the normal method of allocating memory 394 394 * for objects smaller than page size in the kernel. 395 + * 396 + * The @flags argument may be one of: 397 + * 398 + * %GFP_USER - Allocate memory on behalf of user. May sleep. 399 + * 400 + * %GFP_KERNEL - Allocate normal kernel ram. May sleep. 401 + * 402 + * %GFP_ATOMIC - Allocation will not sleep. May use emergency pools. 403 + * For example, use this inside interrupt handlers. 404 + * 405 + * %GFP_HIGHUSER - Allocate pages from high memory. 406 + * 407 + * %GFP_NOIO - Do not do any I/O at all while trying to get memory. 408 + * 409 + * %GFP_NOFS - Do not make any fs calls while trying to get memory. 410 + * 411 + * %GFP_NOWAIT - Allocation will not sleep. 412 + * 413 + * %GFP_THISNODE - Allocate node-local memory only. 414 + * 415 + * %GFP_DMA - Allocation suitable for DMA. 416 + * Should only be used for kmalloc() caches. Otherwise, use a 417 + * slab created with SLAB_DMA. 418 + * 419 + * Also it is possible to set different flags by OR'ing 420 + * in one or more of the following additional @flags: 421 + * 422 + * %__GFP_COLD - Request cache-cold pages instead of 423 + * trying to return cache-warm pages. 424 + * 425 + * %__GFP_HIGH - This allocation has high priority and may use emergency pools. 426 + * 427 + * %__GFP_NOFAIL - Indicate that this allocation is in no way allowed to fail 428 + * (think twice before using). 429 + * 430 + * %__GFP_NORETRY - If memory is not immediately available, 431 + * then give up at once. 432 + * 433 + * %__GFP_NOWARN - If allocation fails, don't issue any warnings. 434 + * 435 + * %__GFP_REPEAT - If allocation fails initially, try once more before failing. 436 + * 437 + * There are other flags available as well, but these are not intended 438 + * for general use, and so are not documented here. For a full list of 439 + * potential flags, always refer to linux/gfp.h. 395 440 */ 396 441 static __always_inline void *kmalloc(size_t size, gfp_t flags) 397 442 { ··· 545 500 struct seq_file; 546 501 int cache_show(struct kmem_cache *s, struct seq_file *m); 547 502 void print_slabinfo_header(struct seq_file *m); 548 - 549 - /** 550 - * kmalloc - allocate memory 551 - * @size: how many bytes of memory are required. 552 - * @flags: the type of memory to allocate. 553 - * 554 - * The @flags argument may be one of: 555 - * 556 - * %GFP_USER - Allocate memory on behalf of user. May sleep. 557 - * 558 - * %GFP_KERNEL - Allocate normal kernel ram. May sleep. 559 - * 560 - * %GFP_ATOMIC - Allocation will not sleep. May use emergency pools. 561 - * For example, use this inside interrupt handlers. 562 - * 563 - * %GFP_HIGHUSER - Allocate pages from high memory. 564 - * 565 - * %GFP_NOIO - Do not do any I/O at all while trying to get memory. 566 - * 567 - * %GFP_NOFS - Do not make any fs calls while trying to get memory. 568 - * 569 - * %GFP_NOWAIT - Allocation will not sleep. 570 - * 571 - * %GFP_THISNODE - Allocate node-local memory only. 572 - * 573 - * %GFP_DMA - Allocation suitable for DMA. 574 - * Should only be used for kmalloc() caches. Otherwise, use a 575 - * slab created with SLAB_DMA. 576 - * 577 - * Also it is possible to set different flags by OR'ing 578 - * in one or more of the following additional @flags: 579 - * 580 - * %__GFP_COLD - Request cache-cold pages instead of 581 - * trying to return cache-warm pages. 582 - * 583 - * %__GFP_HIGH - This allocation has high priority and may use emergency pools. 584 - * 585 - * %__GFP_NOFAIL - Indicate that this allocation is in no way allowed to fail 586 - * (think twice before using). 587 - * 588 - * %__GFP_NORETRY - If memory is not immediately available, 589 - * then give up at once. 590 - * 591 - * %__GFP_NOWARN - If allocation fails, don't issue any warnings. 592 - * 593 - * %__GFP_REPEAT - If allocation fails initially, try once more before failing. 594 - * 595 - * There are other flags available as well, but these are not intended 596 - * for general use, and so are not documented here. For a full list of 597 - * potential flags, always refer to linux/gfp.h. 598 - * 599 - * kmalloc is the normal method of allocating memory 600 - * in the kernel. 601 - */ 602 - static __always_inline void *kmalloc(size_t size, gfp_t flags); 603 503 604 504 /** 605 505 * kmalloc_array - allocate memory for an array.