函数源码

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source File:lib\dynamic_debug.c Create Date:2022-07-27 08:14:04
首页 Copyright©Brick

272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
/*
 * Parse a single line number.  Note that the empty string ""
 * is treated as a special case and converted to zero, which
 * is later treated as a "don't care" value.
 */
static inline int parse_lineno(const char *str, unsigned int *val)
{
    BUG_ON(str == NULL);
    if (*str == '\0') {
        *val = 0;
        return 0;
    }
    if (kstrtouint(str, 10, val) < 0) {
        pr_err("bad line-number: %s\n", str);
        return -EINVAL;
    }
    return 0;
}