]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
Documentation: deprecated.rst: kmalloc-family: mark argument as optional
authorManuel Ebner <manuelebner@mailbox.org>
Wed, 29 Apr 2026 07:27:04 +0000 (09:27 +0200)
committerJonathan Corbet <corbet@lwn.net>
Sun, 3 May 2026 14:55:21 +0000 (08:55 -0600)
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>

Documentation/process/deprecated.rst

index fed56864d0363badc9f7c1b61b8c30727ecade90..ac75b7ecac470bdfff1f5ff811f71d9994e339a1 100644 (file)
@@ -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