linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Vlastimil Babka <vbabka@suse.cz>
To: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Cc: Hao Lee <haolee.swjtu@gmail.com>,
	akpm@linux-foundation.org, mgorman@techsingularity.net,
	mhocko@suse.com, hannes@cmpxchg.org, iamjoonsoo.kim@lge.com,
	minchan@kernel.org, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm: remove a redundant condition in the for loop
Date: Mon, 19 Jun 2017 22:23:03 +0200	[thread overview]
Message-ID: <73d7a087-1a5d-57ba-7026-5756b8a92381@suse.cz> (raw)
In-Reply-To: <87y3snajd2.fsf@rasmusvillemoes.dk>

On 06/19/2017 09:05 PM, Rasmus Villemoes wrote:
> On Mon, Jun 19 2017, Vlastimil Babka <vbabka@suse.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@gmail.com>
>>
>> Sounds right.
>>
>> Acked-by: Vlastimil Babka <vbabka@suse.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.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2017-06-19 20:23 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-19 13:54 Hao Lee
2017-06-19 14:17 ` Vlastimil Babka
2017-06-19 19:05   ` Rasmus Villemoes
2017-06-19 20:23     ` Vlastimil Babka [this message]
2017-06-20  1:39     ` Hao Lee
2017-06-21  9:43     ` Michal Hocko
2017-06-21 18:55       ` [PATCH] mm/page_alloc.c: eliminate unsigned confusion in __rmqueue_fallback Rasmus Villemoes
2017-06-23 12:22         ` Michal Hocko
2017-06-23 13:10         ` Vlastimil Babka
2017-06-24 13:26         ` Wei Yang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=73d7a087-1a5d-57ba-7026-5756b8a92381@suse.cz \
    --to=vbabka@suse.cz \
    --cc=akpm@linux-foundation.org \
    --cc=hannes@cmpxchg.org \
    --cc=haolee.swjtu@gmail.com \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=linux@rasmusvillemoes.dk \
    --cc=mgorman@techsingularity.net \
    --cc=mhocko@suse.com \
    --cc=minchan@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox