Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp4982350iob; Mon, 9 May 2022 06:16:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzIc2KlnRmSexhPlXIqQSsuAUKKdzjJcoqyP5/RDGMDPIVdwkBVvVpwdnw1295We9RYgTTp X-Received: by 2002:a63:5752:0:b0:3c2:1c59:666f with SMTP id h18-20020a635752000000b003c21c59666fmr13039749pgm.59.1652102170137; Mon, 09 May 2022 06:16:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1652102170; cv=none; d=google.com; s=arc-20160816; b=pW4b55WqsIklNRRhOOYvuPY+/laG6IlofU3+cQP7DNBsVdNcg9pU9XypOarvoZ/Osc dgXxszUwX50LALes6u8PgW6EPsXVIBUBC1ckB32RU4nzXqF7QjWLTGuRptaPfu/u7y6z TpInbF9/vWRvbLxDY65KqSQPKqSV1aVFUI1Fwwtr1z1YYcWAdnV6+j3lJs9KWe8E4jNX Of1HVa2T/rRu6fufhdGMzbODz6rkT+kzOxmkl+NpfdjJMiiUZrbq+4YKela68Kf42eAV w5FQC4D7dgCwVXTZWPJBXok/tdQyOOE0/HCHiV5uOgvfiHSZEIyNVJt5fU62rkfTuMbE 7xbQ== 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=Ihn8qSgUK150f5e7W47jkVmqWNi6sM5Tqz/08sG6BGY=; b=mqwDRN+gEKGV5DRLWOvWoN9l54BrN7gzhfa3D+3YvuEcEU6FgjXo9t5J4tMpWquJHU +p50B6w3J+QHBRdegdcaBfpf7HF+CXKWOjh1nsOu9lSACURbHNiigxHs6le3F+eKA4Si b4N8yWpaxMMW11NdEdMGpP6FcTpsWbT7xVgXz8xuHHnbjwI3IS2mj3x8um9D+QDKKlpU 4ZdnaOnAnQ1dq9JGxTU19nlP/FBx+xoiiFtRe9jSHhUjKx9orJD7KE+SjpZ4rbpSroFN DtRZ6Wg8/QEOnGQPuZ/gV0oc6b6jBPTGHYJkfcp1BxJtHHwZVJ91LjH8347OR0tc3eE1 4lVg== 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:18 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 lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id o27-20020a63921b000000b003c6aa1dce5csi6152078pgd.704.2022.05.09.06.16.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 May 2022 06:16:10 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E1EE42AA2F6; Mon, 9 May 2022 06:14:54 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235409AbiEINSW (ORCPT + 99 others); Mon, 9 May 2022 09:18:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41626 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235311AbiEINSD (ORCPT ); Mon, 9 May 2022 09:18:03 -0400 Received: from szxga02-in.huawei.com (szxga02-in.huawei.com [45.249.212.188]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 494812A8046 for ; Mon, 9 May 2022 06:14:07 -0700 (PDT) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.56]) by szxga02-in.huawei.com (SkyGuard) with ESMTP id 4KxhSS6NWBzhZ3g; Mon, 9 May 2022 21:13:28 +0800 (CST) Received: from huawei.com (10.175.124.27) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Mon, 9 May 2022 21:14:01 +0800 From: Miaohe Lin To: CC: , , , , , , , , , , , Subject: [PATCH 04/15] mm/swap: remove unneeded return value of free_swap_slot Date: Mon, 9 May 2022 21:14:05 +0800 Message-ID: <20220509131416.17553-5-linmiaohe@huawei.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20220509131416.17553-1-linmiaohe@huawei.com> References: <20220509131416.17553-1-linmiaohe@huawei.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.124.27] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 The return value of free_swap_slot is always 0 and also ignored now. Remove it to clean up the code. Signed-off-by: Miaohe Lin --- include/linux/swap_slots.h | 2 +- mm/swap_slots.c | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/include/linux/swap_slots.h b/include/linux/swap_slots.h index 347f1a304190..15adfb8c813a 100644 --- a/include/linux/swap_slots.h +++ b/include/linux/swap_slots.h @@ -24,7 +24,7 @@ struct swap_slots_cache { void disable_swap_slots_cache_lock(void); void reenable_swap_slots_cache_unlock(void); void enable_swap_slots_cache(void); -int free_swap_slot(swp_entry_t entry); +void free_swap_slot(swp_entry_t entry); extern bool swap_slot_cache_enabled; diff --git a/mm/swap_slots.c b/mm/swap_slots.c index 0218ec1cd24c..2f877e6f87d7 100644 --- a/mm/swap_slots.c +++ b/mm/swap_slots.c @@ -269,7 +269,7 @@ static int refill_swap_slots_cache(struct swap_slots_cache *cache) return cache->nr; } -int free_swap_slot(swp_entry_t entry) +void free_swap_slot(swp_entry_t entry) { struct swap_slots_cache *cache; @@ -297,8 +297,6 @@ int free_swap_slot(swp_entry_t entry) direct_free: swapcache_free_entries(&entry, 1); } - - return 0; } swp_entry_t folio_alloc_swap(struct folio *folio) -- 2.23.0