Re: [PATCH v3] mm: hugetlb: optionally allocate gigantic hugepages using cma
From: Qian Cai
Date: Thu Mar 12 2020 - 09:33:25 EST
On Wed, 2020-03-11 at 15:09 -0700, Roman Gushchin wrote:
> +#ifdef CONFIG_CMA
> +static unsigned long hugetlb_cma_size __initdata;
> +
> +static int __init cmdline_parse_hugetlb_cma(char *p)
> +{
> + unsigned long long val;
> + char *endptr;
> +
> + if (!p)
> + return -EINVAL;
> +
> + val = simple_strtoull(p, &endptr, 0);
> + hugetlb_cma_size = memparse(p, &p);
> + return 0;
> +}
> +
Here will generate a compilation warning,
mm/hugetlb.c: In function 'cmdline_parse_hugetlb_cma':
mm/hugetlb.c:5548:21: warning: variable 'val' set but not used [-Wunused-but-
set-variable]
 unsigned long long val;
ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂ^~~
Also, the comments for simple_strtoull() in lib/vsprintf.c said,
"This function is obsolete. Please use kstrtoull instead."