Re: [PATCH] mm/sparse: remove a check that compare if unsigned variable is negative

2018-10-19 Thread Wei Yang
On Sat, Oct 13, 2018 at 01:04:45PM -0400, Pavel Tatashin wrote: >This is incorrect: next_present_section_nr() returns "int" and -1 no >next section, this change would lead to infinite loop. Yes, the -1 is a very special value. -- Wei Yang Help you, Help me

Re: [PATCH] mm/sparse: remove a check that compare if unsigned variable is negative

2018-10-13 Thread Pavel Tatashin
This is incorrect: next_present_section_nr() returns "int" and -1 no next section, this change would lead to infinite loop. On Sat, Oct 13, 2018 at 12:16 PM Peng Hao wrote: > > > From: Peng Hao > > In all use locations for for_each_present_section_nr, variable > section_nr is unsigned. It is unne

[PATCH] mm/sparse: remove a check that compare if unsigned variable is negative

2018-10-13 Thread Peng Hao
From: Peng Hao In all use locations for for_each_present_section_nr, variable section_nr is unsigned. It is unnecessary to test if it is negative. Signed-off-by: Peng Hao --- mm/sparse.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mm/sparse.c b/mm/sparse.c index 10b