Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:block\cmdline-parser.c Create Date:2022-07-28 18:01:54
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:cmdline_parts_parse

Proto:int cmdline_parts_parse(struct cmdline_parts **parts, const char *cmdline)

Type:int

Parameter:

TypeParameterName
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  If Not buf Then Return -ENOMEM
178  next_parts = parts
180  When next && pbuf cycle
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  If next Then next = '\0'
185  ret = parse_parts(next_parts, pbuf)
186  If ret Then Go to fail
189  If next Then pbuf = ++next
192  next_parts = next_parts
195  If Not parts Then
196  pr_warn("cmdline partition has no valid partition.")
197  ret = -EINVAL
198  Go to fail
201  ret = 0
202  done :
203  kfree(buf)
204  Return ret
206  fail :
207  cmdline_parts_free(parts)
208  Go to done