Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:That function parses "suffix" crashkernel command lines like* crashkernel=size,[high|low]* It returns 0 on success and -EINVAL on failure.

Proto:static int __init parse_crashkernel_suffix(char *cmdline, unsigned long long *crash_size, const char *suffix)

Type:int

Parameter:

TypeParameterName
char *cmdline
unsigned long long *crash_size
const char *suffix
164  cur = cmdline
166  crash_size = memparse - parse a string with mem suffixes into a number*@ptr: Where parse begins*@retptr: (output) Optional pointer to next char after parse completes* Parses a string into a number. The number stored at @ptr is
167  If cmdline == cur Then
168  pr_warn("crashkernel: memory value expected\n")
169  Return -EINVAL
173  If strncmp(cur, suffix, strlen - Find the length of a string*@s: The string to be sized) Then
174  pr_warn("crashkernel: unrecognized char: %c\n", * cur)
175  Return -EINVAL
177  cur += strlen - Find the length of a string*@s: The string to be sized
178  If cur != ' ' && cur != '\0' Then
179  pr_warn("crashkernel: unrecognized char: %c\n", * cur)
180  Return -EINVAL
183  Return 0
Caller
NameDescribe
__parse_crashkernel