+ mm-sparse-fix-a-bad-comparison.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     Subject: mm/sparse: fix a bad comparison
has been added to the -mm tree.  Its filename is
     mm-sparse-fix-a-bad-comparison.patch

This patch should soon appear at
    http://ozlabs.org/~akpm/mmots/broken-out/mm-sparse-fix-a-bad-comparison.patch
and later at
    http://ozlabs.org/~akpm/mmotm/broken-out/mm-sparse-fix-a-bad-comparison.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: Qian Cai <cai@xxxxxx>
Subject: mm/sparse: fix a bad comparison

next_present_section_nr() could only return an unsigned number -1, so just
check it specifically where compilers will convert -1 to unsigned if
needed.

mm/sparse.c: In function 'sparse_init_nid':
mm/sparse.c:200:20: warning: comparison of unsigned expression >= 0 is
always true [-Wtype-limits]
       ((section_nr >= 0) &&    \
                    ^~
mm/sparse.c:478:2: note: in expansion of macro
'for_each_present_section_nr'
  for_each_present_section_nr(pnum_begin, pnum) {
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~
mm/sparse.c:200:20: warning: comparison of unsigned expression >= 0 is
always true [-Wtype-limits]
       ((section_nr >= 0) &&    \
                    ^~
mm/sparse.c:497:2: note: in expansion of macro
'for_each_present_section_nr'
  for_each_present_section_nr(pnum_begin, pnum) {
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~
mm/sparse.c: In function 'sparse_init':
mm/sparse.c:200:20: warning: comparison of unsigned expression >= 0 is
always true [-Wtype-limits]
       ((section_nr >= 0) &&    \
                    ^~
mm/sparse.c:520:2: note: in expansion of macro
'for_each_present_section_nr'
  for_each_present_section_nr(pnum_begin + 1, pnum_end) {
  ^~~~~~~~~~~~~~~~~~~~~~~~~~~

Link: http://lkml.kernel.org/r/20190228181839.86504-1-cai@xxxxxx
Fixes: c4e1be9ec113 ("mm, sparsemem: break out of loops early")
Signed-off-by: Qian Cai <cai@xxxxxx>
Reviewed-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
Cc: Dave Hansen <dave.hansen@xxxxxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

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

--- a/mm/sparse.c~mm-sparse-fix-a-bad-comparison
+++ a/mm/sparse.c
@@ -197,7 +197,7 @@ static inline int next_present_section_n
 }
 #define for_each_present_section_nr(start, section_nr)		\
 	for (section_nr = next_present_section_nr(start-1);	\
-	     ((section_nr >= 0) &&				\
+	     ((section_nr != -1) &&				\
 	      (section_nr <= __highest_present_section_nr));	\
 	     section_nr = next_present_section_nr(section_nr))
 
_

Patches currently in -mm which might be from cai@xxxxxx are

page_poison-play-nicely-with-kasan.patch
slab-kmemleak-no-scan-alien-caches.patch
slub-remove-an-unused-addr-argument.patch
mm-compaction-be-selective-about-what-pageblocks-to-clear-skip-hints-fix.patch
mm-hotplug-fix-an-imbalance-with-debug_pagealloc.patch
mm-sparse-fix-a-bad-comparison.patch
signal-allow-the-null-signal-in-rt_sigqueueinfo.patch




[Index of Archives]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux