mm-commits.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* + fix-zone_id-may-be-used-uninitialized-in-this-function-warning.patch added to -mm tree
@ 2021-07-16 21:12 akpm
  0 siblings, 0 replies; only message in thread
From: akpm @ 2021-07-16 21:12 UTC (permalink / raw)
  To: mm-commits, npache, rppt


The patch titled
     Subject: mm/page_alloc.c: fix 'zone_id' may be used uninitialized in this function warning
has been added to the -mm tree.  Its filename is
     fix-zone_id-may-be-used-uninitialized-in-this-function-warning.patch

This patch should soon appear at
    https://ozlabs.org/~akpm/mmots/broken-out/fix-zone_id-may-be-used-uninitialized-in-this-function-warning.patch
and later at
    https://ozlabs.org/~akpm/mmotm/broken-out/fix-zone_id-may-be-used-uninitialized-in-this-function-warning.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/process/submit-checklist.rst when testing your code ***

The -mm tree is included into linux-next and is updated
there every 3-4 working days

------------------------------------------------------
From: Nico Pache <npache@redhat.com>
Subject: mm/page_alloc.c: fix 'zone_id' may be used uninitialized in this function warning

When compiling with -Werror, cc1 will warn that 'zone_id' may be used
uninitialized in this function warning.

Initialize the zone_id as 0.

Its safe to assume that if the code reaches this point it has at least one
numa node with memory, so no need for an assertion before
init_unavilable_range.

Link: https://lkml.kernel.org/r/20210716210336.1114114-1-npache@redhat.com
Fixes: 122e093c1734 ("mm/page_alloc: fix memory map initialization for descending nodes")
Signed-off-by: Nico Pache <npache@redhat.com>
Cc: Mike Rapoport <rppt@linux.ibm.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
---

 mm/page_alloc.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/mm/page_alloc.c~fix-zone_id-may-be-used-uninitialized-in-this-function-warning
+++ a/mm/page_alloc.c
@@ -6714,7 +6714,7 @@ static void __init memmap_init(void)
 {
 	unsigned long start_pfn, end_pfn;
 	unsigned long hole_pfn = 0;
-	int i, j, zone_id, nid;
+	int i, j, zone_id = 0, nid;
 
 	for_each_mem_pfn_range(i, MAX_NUMNODES, &start_pfn, &end_pfn, &nid) {
 		struct pglist_data *node = NODE_DATA(nid);
_

Patches currently in -mm which might be from npache@redhat.com are

fix-zone_id-may-be-used-uninitialized-in-this-function-warning.patch


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-07-16 21:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-16 21:12 + fix-zone_id-may-be-used-uninitialized-in-this-function-warning.patch added to -mm tree akpm

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).