From patchwork Thu Apr 30 06:11:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Leizhen (ThunderTown)" X-Patchwork-Id: 11519203 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A18AA13B2 for ; Thu, 30 Apr 2020 06:14:38 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 8645F214D8 for ; Thu, 30 Apr 2020 06:14:38 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8645F214D8 Authentication-Results: mail.kernel.org; dmarc=none (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 CB4A78E0008; Thu, 30 Apr 2020 02:14:37 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id C3E348E0001; Thu, 30 Apr 2020 02:14:37 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B2CF78E0008; Thu, 30 Apr 2020 02:14:37 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0138.hostedemail.com [216.40.44.138]) by kanga.kvack.org (Postfix) with ESMTP id 9B4518E0001 for ; Thu, 30 Apr 2020 02:14:37 -0400 (EDT) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 5414145C1 for ; Thu, 30 Apr 2020 06:14:37 +0000 (UTC) X-FDA: 76763507394.23.bone72_284a61e1dd252 X-Spam-Summary: 1,0,0,,d41d8cd98f00b204,thunder.leizhen@huawei.com,,RULES_HIT:30012:30054:30070,0,RBL:45.249.212.32:@huawei.com:.lbl8.mailshell.net-62.18.2.100 64.95.201.95,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:16,LUA_SUMMARY:none X-HE-Tag: bone72_284a61e1dd252 X-Filterd-Recvd-Size: 1561 Received: from huawei.com (szxga06-in.huawei.com [45.249.212.32]) by imf45.hostedemail.com (Postfix) with ESMTP for ; Thu, 30 Apr 2020 06:14:36 +0000 (UTC) Received: from DGGEMS413-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id A86498FB80CA7A31E1E1; Thu, 30 Apr 2020 14:14:21 +0800 (CST) Received: from DESKTOP-C3MD9UG.china.huawei.com (10.166.215.55) by DGGEMS413-HUB.china.huawei.com (10.3.19.213) with Microsoft SMTP Server id 14.3.487.0; Thu, 30 Apr 2020 14:14:13 +0800 From: Zhen Lei To: Tim Chen , Andrew Morton , linux-mm , linux-kernel CC: Zhen Lei Subject: [PATCH 0/3] clean up some functions in mm/swap_slots.c Date: Thu, 30 Apr 2020 14:11:40 +0800 Message-ID: <20200430061143.450-1-thunder.leizhen@huawei.com> X-Mailer: git-send-email 2.26.0.windows.1 MIME-Version: 1.0 X-Originating-IP: [10.166.215.55] X-CFilter-Loop: Reflected 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: When I studied the code of mm/swap_slots.c, I found some places can be improved. Zhen Lei (3): mm/swap: simplify alloc_swap_slot_cache() mm/swap: simplify enable_swap_slots_cache() mm/swap: remove redundant check for swap_slot_cache_initialized mm/swap_slots.c | 45 +++++++++++++++++++++------------------------ 1 file changed, 21 insertions(+), 24 deletions(-)