summaryrefslogtreecommitdiff
path: root/Documentation/process
diff options
context:
space:
mode:
authorManuel Ebner <manuelebner@mailbox.org>2026-04-29 09:27:04 +0200
committerJonathan Corbet <corbet@lwn.net>2026-05-03 08:55:21 -0600
commitd957b4184aee15344ceb223248e09f6403b25967 (patch)
treebbce8e6939923010cb41f8ae570dc6f905821cad /Documentation/process
parentf61bf5fdf77d8871391a8c25af75c4cad96012e9 (diff)
Documentation: deprecated.rst: kmalloc-family: mark argument as optional
put the optional argument (gfp) in square brackets add default value = GFP_KERNEL eg. ptr = kmalloc_obj(*ptr, gfp); -> ptr = kmalloc_obj(*ptr [, gfp] ); Signed-off-by: Manuel Ebner <manuelebner@mailbox.org> Acked-by: SeongJae Park <sj@kernel.org> Acked-by: Vlastimil Babka (SUSE) <vbabka@kernel.org> Signed-off-by: Jonathan Corbet <corbet@lwn.net> Message-ID: <20260429072704.311603-2-manuelebner@mailbox.org>
Diffstat (limited to 'Documentation/process')
-rw-r--r--Documentation/process/deprecated.rst15
1 files changed, 8 insertions, 7 deletions
diff --git a/Documentation/process/deprecated.rst b/Documentation/process/deprecated.rst
index fed56864d036..ac75b7ecac47 100644
--- a/Documentation/process/deprecated.rst
+++ b/Documentation/process/deprecated.rst
@@ -392,13 +392,14 @@ allocations. For example, these open coded assignments::
become, respectively::
- ptr = kmalloc_obj(*ptr, gfp);
- ptr = kzalloc_obj(*ptr, gfp);
- ptr = kmalloc_objs(*ptr, count, gfp);
- ptr = kzalloc_objs(*ptr, count, gfp);
- ptr = kmalloc_flex(*ptr, flex_member, count, gfp);
- __auto_type ptr = kmalloc_obj(struct foo, gfp);
-
+ ptr = kmalloc_obj(*ptr [, gfp] );
+ ptr = kzalloc_obj(*ptr [, gfp] );
+ ptr = kmalloc_objs(*ptr, count [, gfp] );
+ ptr = kzalloc_objs(*ptr, count [, gfp] );
+ ptr = kmalloc_flex(*ptr, flex_member, count [, gfp] );
+ __auto_type ptr = kmalloc_obj(struct foo [, gfp] );
+
+The argument gfp is optional, the default value is GFP_KERNEL.
If `ptr->flex_member` is annotated with __counted_by(), the allocation
will automatically fail if `count` is larger than the maximum
representable value that can be stored in the counter member associated