函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:parse_parts

函数原型:static int parse_parts(struct cmdline_parts **parts, const char *bdevdef)

返回类型:int

参数:

类型参数名称
struct cmdline_parts **parts
const char *bdevdef
92  ret等于负EINVAL
99  * parts = NULL
101  newparts等于分配内存并置零
102  如果非newparts则返回:负ENOMEM
105  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
106  如果非next
107  打印警告信息("cmdline partition has no block device.")
108  转到:fail
111  length等于min_t - return minimum of two values, using the specified type*@type: data type to use*@x: first value*@y: second value(int, next - bdevdef, block device, such as 'mmcblk0' 的长度 - 1)
112  strncpy( block device, such as 'mmcblk0' , bdevdef, length)
113  block device, such as 'mmcblk0' [length]等于'\0'
114  nr_subparts等于0
116  next_subpart等于subpart
118 next且*next先自加循环
119  bdevdef等于next
120  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
122  length等于如果非nextbuf的长度减1否则min_t - return minimum of two values, using the specified type*@type: data type to use*@x: first value*@y: second value(int, next - bdevdef, buf的长度 - 1)
125  strncpy(buf, bdevdef, length)
126  buf[length]等于'\0'
128  ret等于parse_subpart(next_subpart, buf)
129  如果ret则转到:fail
132  nr_subparts自加
133  next_subpart等于next_subpart
136  如果非subpart
137  打印警告信息("cmdline partition has no valid partition.")
138  ret等于负EINVAL
139  转到:fail
142  parts等于newparts
144  返回:0
145  fail :
146  free_subpart(newparts)
147  释放内存
148  返回:ret
调用者
名称描述
cmdline_parts_parse