From patchwork Sat Apr 10 07:23:44 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 12195443 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=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,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 A7DA0C43462 for ; Sat, 10 Apr 2021 07:24:52 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 38E85610CB for ; Sat, 10 Apr 2021 07:24:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 38E85610CB Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 933946B0070; Sat, 10 Apr 2021 03:24:51 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8E36C6B0071; Sat, 10 Apr 2021 03:24:51 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 75EFC6B0072; Sat, 10 Apr 2021 03:24:51 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0024.hostedemail.com [216.40.44.24]) by kanga.kvack.org (Postfix) with ESMTP id 5CF976B0070 for ; Sat, 10 Apr 2021 03:24:51 -0400 (EDT) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 0CBE2824805A for ; Sat, 10 Apr 2021 07:24:51 +0000 (UTC) X-FDA: 78015620382.07.C0ADF69 Received: from szxga07-in.huawei.com (szxga07-in.huawei.com [45.249.212.35]) by imf06.hostedemail.com (Postfix) with ESMTP id D8709C0007C1 for ; Sat, 10 Apr 2021 07:24:51 +0000 (UTC) Received: from DGGEMS410-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga07-in.huawei.com (SkyGuard) with ESMTP id 4FHRKK15ypz9xPQ; Sat, 10 Apr 2021 15:22:29 +0800 (CST) Received: from huawei.com (10.175.104.175) by DGGEMS410-HUB.china.huawei.com (10.3.19.210) with Microsoft SMTP Server id 14.3.498.0; Sat, 10 Apr 2021 15:24:35 +0800 From: Miaohe Lin To: , CC: , , , Subject: [PATCH v2 1/5] mm/hugeltb: remove redundant VM_BUG_ON() in region_add() Date: Sat, 10 Apr 2021 03:23:44 -0400 Message-ID: <20210410072348.20437-2-linmiaohe@huawei.com> X-Mailer: git-send-email 2.19.1 In-Reply-To: <20210410072348.20437-1-linmiaohe@huawei.com> References: <20210410072348.20437-1-linmiaohe@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.104.175] X-CFilter-Loop: Reflected X-Stat-Signature: sy9h9kwyrqautbsdjd9iew1yi8oo3s6p X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: D8709C0007C1 Received-SPF: none (huawei.com>: No applicable sender policy available) receiver=imf06; identity=mailfrom; envelope-from=""; helo=szxga07-in.huawei.com; client-ip=45.249.212.35 X-HE-DKIM-Result: none/none X-HE-Tag: 1618039491-709547 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: The same VM_BUG_ON() check is already done in the callee. Remove this extra one to simplify the code slightly. Reviewed-by: Mike Kravetz Signed-off-by: Miaohe Lin --- mm/hugetlb.c | 1 - 1 file changed, 1 deletion(-) diff --git a/mm/hugetlb.c b/mm/hugetlb.c index c22111f3da20..a03a50b7c410 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -556,7 +556,6 @@ static long region_add(struct resv_map *resv, long f, long t, resv->adds_in_progress -= in_regions_needed; spin_unlock(&resv->lock); - VM_BUG_ON(add < 0); return add; }