Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:We break the rule and mangle the string.

Proto:static int param_array(struct module *mod, const char *name, const char *val, unsigned int min, unsigned int max, void *elem, int elemsize, int (*set)(const char *, const struct kernel_param *kp), s16 level, unsigned int *num)

Type:int

Parameter:

TypeParameterName
struct module *mod
const char *name
const char *val
unsigned intmin
unsigned intmax
void *elem
intelemsize
int (*set
s16level
unsigned int *num
408  name = name
409  arg = elem
410  level = level
412  num = 0
414  Do
417  If num == max Then
418  pr_err("%s: can only take %i arguments\n", name, max)
419  Return -EINVAL
421  len = strcspn - Calculate the length of the initial substring of @s which does not contain letters in @reject*@s: The string to be searched*@reject: The string to avoid
424  save = val[len]
425  ) = '\0'
426  check_kparam_locked(mod)
427  ret = set(val, & kp)
429  If ret != 0 Then Return ret
431  arg += elemsize
432  val += len + 1
433  num++
434  When save == ',' cycle
436  If num < min Then
437  pr_err("%s: needs at least %i arguments\n", name, min)
438  Return -EINVAL
440  Return 0
Caller
NameDescribe
param_array_set