函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:lib\kasprintf.c Create Date:2022-07-27 07:17:13
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:If fmt contains no % (or is exactly %s), use kstrdup_const. If fmt* (or the sole vararg) points to rodata, we will then save a memory* allocation and string copy. In any case, the return value should be* freed using kfree_const().

函数原型:const char *kvasprintf_const(gfp_t gfp, const char *fmt, va_list ap)

返回类型:char

参数:

类型参数名称
gfp_tgfp
const char *fmt
va_listap
45  如果非strchr(fmt, '%')则返回:kstrdup_const - conditionally duplicate an existing const string*@s: the string to duplicate*@gfp: the GFP mask used in the kmalloc() call when allocating memory* Note: Strings allocated by kstrdup_const should be freed by kfree_const.
47  如果非strcmp(fmt, "%s")则返回:kstrdup_const - conditionally duplicate an existing const string*@s: the string to duplicate*@gfp: the GFP mask used in the kmalloc() call when allocating memory* Note: Strings allocated by kstrdup_const should be freed by kfree_const.
49  返回:Simplified asprintf.
调用者
名称描述
kobject_set_name_vargs设置kobject名字