mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs.git
synced 2026-10-28 21:02:43 +01:00
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 <[email protected]> Acked-by: SeongJae Park <[email protected]> Acked-by: Vlastimil Babka (SUSE) <[email protected]> Signed-off-by: Jonathan Corbet <[email protected]> Message-ID: <[email protected]>
This commit is contained in:
1 parent
f61bf5fdf7
commit
d957b4184a
1 file changed
+7
-6
@@ -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
|
||||
|
||||
Reference in new issue
Block a user