lkml.org 
[lkml]   [2024]   [Jan]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v3 4/7] hugetlb: pass *next_nid_to_alloc directly to for_each_node_mask_to_alloc
From
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.

\
 
 \ /
  Last update: 2024-01-03 03:23    [W:0.018 / U:2.716 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site