[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <958bf051-e776-4cbf-ae3c-76ee82d55bcc@linux.dev>
Date: Wed, 3 Jan 2024 10:22:46 +0800
From: Gang Li <gang.li@...ux.dev>
To: David Rientjes <rientjes@...gle.com>
Cc: David Hildenbrand <david@...hat.com>,
Mike Kravetz <mike.kravetz@...cle.com>, Muchun Song <muchun.song@...ux.dev>,
Andrew Morton <akpm@...ux-foundation.org>,
Tim Chen <tim.c.chen@...ux.intel.com>, linux-mm@...ck.org,
linux-kernel@...r.kernel.org, ligang.bdlg@...edance.com
Subject: Re: [PATCH v3 4/7] hugetlb: pass *next_nid_to_alloc directly to
for_each_node_mask_to_alloc
On 2024/1/3 09:32, David Rientjes wrote:
> Same error as v2:
>
> mm/hugetlb.c:3315:53: warning: variable 'node' is used uninitialized whenever '&&' condition is false [-Wsometimes-uninitialized]
> for_each_node_mask_to_alloc(&h->next_nid_to_alloc, nr_nodes, node, &node_states[N_MEMORY]) {
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> mm/hugetlb.c:1501:3: note: expanded from macro 'for_each_node_mask_to_alloc'
> nr_nodes > 0 && \
> ^~~~~~~~~~~~
> mm/hugetlb.c:3342:38: note: uninitialized use occurs here
> list_add(&m->list, &huge_boot_pages[node]);
> ^~~~
> mm/hugetlb.c:3315:53: note: remove the '&&' if its condition is always true
> for_each_node_mask_to_alloc(&h->next_nid_to_alloc, nr_nodes, node, &node_states[N_MEMORY]) {
> ^
> mm/hugetlb.c:3310:7: warning: variable 'node' is used uninitialized whenever 'if' condition is false [-Wsometimes-uninitialized]
> if (!m)
> ^~
> mm/hugetlb.c:3342:38: note: uninitialized use occurs here
> list_add(&m->list, &huge_boot_pages[node]);
> ^~~~
> mm/hugetlb.c:3310:3: note: remove the 'if' if its condition is always true
> if (!m)
> ^~~~~~~
> mm/hugetlb.c:3304:20: note: initialize the variable 'node' to silence this warning
> int nr_nodes, node;
> ^
> = 0
> 2 warnings generated.
>
How did you get those warnings? I got nothing in my compilation.
Powered by blists - more mailing lists