Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp17596445rwd; Tue, 27 Jun 2023 05:22:46 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5wSo6HWvjSorvDXGP3QKOv1dvQEsB9DIMWOdNMlaiABA59qyz13K8KvnglY1yQ/NICn6rM X-Received: by 2002:aca:1e07:0:b0:39c:59e2:dd79 with SMTP id m7-20020aca1e07000000b0039c59e2dd79mr31866343oic.36.1687868566371; Tue, 27 Jun 2023 05:22:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687868566; cv=none; d=google.com; s=arc-20160816; b=sElp+KD/lqWz8mn80hO8lG31R9Dk//MIiCWtzfKiNh1rYyolfCZe4ic0QbmouYhumJ 1/ySkgqTfotBhqODon46SxlJqx7RLsWjln4qJMQmEU8ygBGlAXIDcS9GrnCDul20tIfk 4hrPbc2lbDck2mpzPVm+oW+iYxA2+/SlFXsCihp1oKjP0SM6jL4UCUGKzH8o7jdKjYue sofYe+5Uad9LMWEnnJzAC5WlOgHh2XQm07m0oGKhah/kSHcpdCzD+vO2ui106NV3F0lU 7XpvdboZgLfezK7JhDnYs8tFjNVxWI2XHOcx/7/shOgaCd2CIfzyW1RnTabmkRf9tdLh LZpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=JG+MxX5N+LS7YTjk/+01l2Yc0IeaacdIWZ6zRJ97y0A=; fh=B+lalLlRMhceeGv6a2GD0rnKBVzY964FmD9hd9xoQ4s=; b=mXaY20K5RVG8QvPMZ4v59Fm348VBd7T7NxRAr6J4OUGJhAF+cCI6I7jNDk2YkTESLJ yR6HeDe1xyNt67YNWsjLZQmn1hNziyrntllpCPpCQ5bm+42WfJxl7aqhSsVD+i8Pib6v w2I5eAVSCsa4iee2Agz4JQzH2bhtIq1BZ2EYsCe+FpIGLMgSQ7d43xHdywlWOkhlmoOY kgcnmdkm711BypolrrBeIVbEU9HLXBYMr5Uuf9C1LMYL7ek/pgZtAE4ntv6mwy73oNoa loTZgY1uNQausMJrRkpohRSpdg/b1OQF9aSlyt1GK1vin5JGw/Q/vQzUMPTJ+VcB9GPb DiIA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d18-20020a056a00199200b00648019bae38si7025658pfl.277.2023.06.27.05.22.34; Tue, 27 Jun 2023 05:22:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231805AbjF0MIp (ORCPT + 99 others); Tue, 27 Jun 2023 08:08:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231793AbjF0MIn (ORCPT ); Tue, 27 Jun 2023 08:08:43 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F946198D for ; Tue, 27 Jun 2023 05:08:41 -0700 (PDT) Received: from dggpemm500014.china.huawei.com (unknown [172.30.72.53]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4Qr3QG5QRCzqV0Q; Tue, 27 Jun 2023 20:08:22 +0800 (CST) Received: from localhost.localdomain (10.175.112.125) by dggpemm500014.china.huawei.com (7.185.36.153) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.27; Tue, 27 Jun 2023 20:08:38 +0800 From: Wupeng Ma To: CC: , , Subject: [PATCH 1/2] swap: Cleanup duplicated WARN_ON in add_to_avail_list Date: Tue, 27 Jun 2023 20:08:32 +0800 Message-ID: <20230627120833.2230766-2-mawupeng1@huawei.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230627120833.2230766-1-mawupeng1@huawei.com> References: <20230627120833.2230766-1-mawupeng1@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.112.125] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpemm500014.china.huawei.com (7.185.36.153) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ma Wupeng Empty check for plist_node is checked in add_to_avail_list and plist_add. Drop the duplicate one in add_to_avail_list. Signed-off-by: Ma Wupeng --- mm/swapfile.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mm/swapfile.c b/mm/swapfile.c index 274bbf797480..879cb80bf37b 100644 --- a/mm/swapfile.c +++ b/mm/swapfile.c @@ -713,10 +713,8 @@ static void add_to_avail_list(struct swap_info_struct *p) int nid; spin_lock(&swap_avail_lock); - for_each_node(nid) { - WARN_ON(!plist_node_empty(&p->avail_lists[nid])); + for_each_node(nid) plist_add(&p->avail_lists[nid], &swap_avail_heads[nid]); - } spin_unlock(&swap_avail_lock); } -- 2.25.1