[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <73d7a087-1a5d-57ba-7026-5756b8a92381@suse.cz>
Date: Mon, 19 Jun 2017 22:23:03 +0200
From: Vlastimil Babka <vbabka@...e.cz>
To: Rasmus Villemoes <linux@...musvillemoes.dk>
Cc: Hao Lee <haolee.swjtu@...il.com>, akpm@...ux-foundation.org,
mgorman@...hsingularity.net, mhocko@...e.com, hannes@...xchg.org,
iamjoonsoo.kim@....com, minchan@...nel.org, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mm: remove a redundant condition in the for loop
On 06/19/2017 09:05 PM, Rasmus Villemoes wrote:
> On Mon, Jun 19 2017, Vlastimil Babka <vbabka@...e.cz> wrote:
>
>> On 06/19/2017 03:54 PM, Hao Lee wrote:
>>> The variable current_order decreases from MAX_ORDER-1 to order, so the
>>> condition current_order <= MAX_ORDER-1 is always true.
>>>
>>> Signed-off-by: Hao Lee <haolee.swjtu@...il.com>
>>
>> Sounds right.
>>
>> Acked-by: Vlastimil Babka <vbabka@...e.cz>
>
> current_order and order are both unsigned, and if order==0,
> current_order >= order is always true, and we may decrement
> current_order past 0 making it UINT_MAX... A comment would be in order,
> though.
Doh, right. Thanks.
Powered by blists - more mailing lists