函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:cmdline_parts_parse

函数原型:int cmdline_parts_parse(struct cmdline_parts **parts, const char *cmdline)

返回类型:int

参数:

类型参数名称
struct cmdline_parts **parts
const char *cmdline
172  * parts = NULL
174  next等于pbuf等于buf等于kstrdup - allocate space for and copy an existing string*@s: the string to duplicate*@gfp: the GFP mask used in the kmalloc() call when allocating memory* Return: newly allocated copy of @s or %NULL in case of error
175  如果非buf则返回:负ENOMEM
178  next_parts等于parts
180 nextpbuf循环
181  next等于strchr - Find the first occurrence of the character c in the string s.*@s: the string to be searched*@c: the character to search for
182  如果nextnext等于'\0'
185  ret等于parse_parts(next_parts, pbuf)
186  如果ret则转到:fail
189  如果nextpbuf等于next先自加
192  next_parts等于next_parts
195  如果非parts
196  打印警告信息("cmdline partition has no valid partition.")
197  ret等于负EINVAL
198  转到:fail
201  ret等于0
202  done :
203  释放内存
204  返回:ret
206  fail :
207  cmdline_parts_free(parts)
208  转到:done