Re: [PATCH 2/3] vmalloc: Switch to for_each_vmap_node() helper
From: Andrew Morton
Date: Wed Apr 09 2025 - 20:32:25 EST
On Thu, 10 Apr 2025 01:39:24 +0800 kernel test robot <lkp@xxxxxxxxx> wrote:
> | Reported-by: kernel test robot <lkp@xxxxxxxxx>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202504100130.OjlBJLkQ-lkp@xxxxxxxxx/
>
> All warnings (new ones prefixed by >>):
>
> mm/vmalloc.c: In function 'vmap_init_nodes':
> >> mm/vmalloc.c:5087:9: warning: unused variable 'n' [-Wunused-variable]
> int i, n;
> ^
Thanks, I added
--- a/mm/vmalloc.c~vmalloc-switch-to-for_each_vmap_node-helper-fix
+++ a/mm/vmalloc.c
@@ -5084,7 +5084,7 @@ static void __init vmap_init_free_space(
static void vmap_init_nodes(void)
{
struct vmap_node *vn;
- int i, n;
+ int i;
#if BITS_PER_LONG == 64
/*
@@ -5101,7 +5101,7 @@ static void vmap_init_nodes(void)
* set of cores. Therefore a per-domain purging is supposed to
* be added as well as a per-domain balancing.
*/
- n = clamp_t(unsigned int, num_possible_cpus(), 1, 128);
+ int n = clamp_t(unsigned int, num_possible_cpus(), 1, 128);
if (n > 1) {
vn = kmalloc_array(n, sizeof(*vn), GFP_NOWAIT | __GFP_NOWARN);
_