From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C85CDC433E7 for ; Fri, 9 Oct 2020 13:51:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 77B8C222B9 for ; Fri, 9 Oct 2020 13:51:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387568AbgJINvW (ORCPT ); Fri, 9 Oct 2020 09:51:22 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:15201 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1732456AbgJINvW (ORCPT ); Fri, 9 Oct 2020 09:51:22 -0400 Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 4CAA0C8C8E38F4713939; Fri, 9 Oct 2020 21:51:20 +0800 (CST) Received: from huawei.com (10.175.104.175) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.487.0; Fri, 9 Oct 2020 21:51:13 +0800 From: Miaohe Lin To: , , , CC: , , , Subject: [PATCH] mm: memcontrol: eliminate redundant check in __mem_cgroup_insert_exceeded() Date: Fri, 9 Oct 2020 09:51:04 -0400 Message-ID: <20201009135104.39048-1-linmiaohe@huawei.com> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.104.175] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The mz->usage_in_excess >= mz_node->usage_in_excess check is exactly the else case of mz->usage_in_excess < mz_node->usage_in_excess. So we could replace else if (mz->usage_in_excess >= mz_node->usage_in_excess) with else equally. Signed-off-by: Miaohe Lin --- mm/memcontrol.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/memcontrol.c b/mm/memcontrol.c index 2636f8bad908..f607afd0fcbf 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -629,7 +629,7 @@ static void __mem_cgroup_insert_exceeded(struct mem_cgroup_per_node *mz, * We can't avoid mem cgroups that are over their soft * limit by the same amount */ - else if (mz->usage_in_excess >= mz_node->usage_in_excess) + else p = &(*p)->rb_right; } -- 2.19.1