bpos_parse(): parse symbolic constants

Signed-off-by: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
Kent Overstreet 2025-07-07 16:13:35 -04:00
parent ec23efce86
commit 39c00050d2

View File

@ -681,6 +681,15 @@ static int kstrtouint_symbolic(const char *s, unsigned int base, unsigned *res)
struct bpos bpos_parse(char *buf)
{
if (!strcmp(buf, "POS_MIN"))
return POS_MIN;
if (!strcmp(buf, "POS_MAX"))
return POS_MAX;
if (!strcmp(buf, "SPOS_MAX"))
return SPOS_MAX;
char *orig = strdup(buf);
char *s = buf;