Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp5163017ybh; Wed, 7 Aug 2019 01:42:42 -0700 (PDT) X-Google-Smtp-Source: APXvYqxQutQ5GsRokflVHGabZneV42rBr+RgpQUn2Hyyqs2fhie0REtGF1WWqTT4BSqqGFR1gVad X-Received: by 2002:a63:204b:: with SMTP id r11mr6744020pgm.121.1565167361820; Wed, 07 Aug 2019 01:42:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565167361; cv=none; d=google.com; s=arc-20160816; b=oCUaC7D3P5oI2o7+oGya/oJabW047fR2QGXcRAook4yCx20KsDBbt853Zfglk8JKRv OE2EPi9zwgdVGmNlCLsgqWg5+0LH/+cQ+FSkucQn83P0P5aQctiMNsYBXt1lgdZrFAmd /dTXsPnusYspygFZWbtvOoWcpUGA3OYdeQd5Y40xKDg195B30bLxwWQnKvJnztw6LjRf NLAtI+oBC2RVEt/2LpbqP09HEJgO1yDbPvQSokYfx7Z1/Jm5E98YUcboMB5eiLqZ25ax V3OjRE5Gcza5cQhF78hBZK6dr9BC/5JVn8HDbYFv1tzq1yXlHm//W9qvoLg4Vj1doEem eC+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=EyvgUT/mHFqMk636dxzLzzgFDS37eM5CM15yX+1C0h4=; b=T9Xepexp/j8jgwmygTMOOKo8iXreKbZcWpYGqgAOgk/ugdkZYCbvT/yuqm/3ia8BMl ZlWfxatlyRw/Ide9BotxPXHglkcRcB7Fn7wPjRgzsiO6dFvF3l5mTMIO9I4LTG0Ua/aA E41gAvFYm2dY7h7rwCzwzwNpBsAJcsKcNHfoigd05Sp6YYT6yD9Jmjmy4x5u4dNhu1vC 3SDdqCZgct6xKMDpS/eHPIpcCFYQBh9yxF/k38r/vMe7KqV5QOlI+60XYk9lZazRTSeW MtaOuPsfCHsENTBhpEuyyW7bmTDRL5Xqe5sb8UgwzMqtU0Anx0oObIpiEJuG6S2wZgL3 sWzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=OlUPUw8O; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g8si43839425plt.273.2019.08.07.01.42.26; Wed, 07 Aug 2019 01:42:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=OlUPUw8O; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387538AbfHGIlo (ORCPT + 99 others); Wed, 7 Aug 2019 04:41:44 -0400 Received: from mail-pl1-f193.google.com ([209.85.214.193]:37179 "EHLO mail-pl1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728202AbfHGIlm (ORCPT ); Wed, 7 Aug 2019 04:41:42 -0400 Received: by mail-pl1-f193.google.com with SMTP id b3so39740310plr.4 for ; Wed, 07 Aug 2019 01:41:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=EyvgUT/mHFqMk636dxzLzzgFDS37eM5CM15yX+1C0h4=; b=OlUPUw8OMiKKCWaFUHD6Ldd8xeESIBSCde7fJSBGlkMgtMtAXAF0V5RYNm/uBNjNWk SccP1cbUdZ1EMPUBm8h4Wqkr76glmchV0EXc+DlVxTNTNUWLZ2ZuSIcm2KyNqzBmoR53 CANTzvzY66eGU1DHo0OhI/Pna9FHVKCFPxPBSxoiMZNTSCn7Mi9iSqn/u4D3mVWELc07 g6J5hQQJK3EK5PAUyg3ZNM4KKjC/cfggdgAjUhK8PwHfdyjNAk8tCfyfAOhWZLkIdqBB P3RBckcsZrkxQEJ925kS0ZzxNlibQDNST4aGHHnFvSj7lYJsBj5VAhRVhwO8nRdeveDd Ytjg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=EyvgUT/mHFqMk636dxzLzzgFDS37eM5CM15yX+1C0h4=; b=ZWVmoyzV/m0lmW26Ivh4/Us71rTVecqF2EnXjS0Yw3PiZQhqF23f/p6VOpxUs7d0KG PCGcWSzTguYUY4D2dlIXcqQPJfyS+6jK9V9q26qU3ZlA4e7FbBLZq2QB55dpexc9BDvP RijR2ZbcCtl+DV6YRWNcYhyBMYNJIUV/FzL35TAq8mZaLhSw07AE0FL/ZxOHdKhSwZoH PS+BS2G8cADpOhSkyO59Qy6ZkqxABqFJzB3kPofhc3H4WtMu56KvvLgtVcuH2iaSOtwQ yEqAAFDRLKnrUG0RHj9AEZRehg4W+GfvJSHooAlr4P84Kow4tD2UFaK9R7/K8yQJmWlZ xDtw== X-Gm-Message-State: APjAAAWn3AqgRw8I1VcP3hDhPoe4M8LzfzfmDTntBNln1yC30oSPPaXq e9olvZQC87lFZiwTQNwuuA== X-Received: by 2002:a63:f048:: with SMTP id s8mr6613569pgj.26.1565167301983; Wed, 07 Aug 2019 01:41:41 -0700 (PDT) Received: from mylaptop.redhat.com ([209.132.188.80]) by smtp.gmail.com with ESMTPSA id f19sm135030521pfk.180.2019.08.07.01.41.37 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 07 Aug 2019 01:41:41 -0700 (PDT) From: Pingfan Liu To: linux-mm@kvack.org Cc: Pingfan Liu , =?UTF-8?q?J=C3=A9r=C3=B4me=20Glisse?= , Andrew Morton , Mel Gorman , Jan Kara , "Kirill A. Shutemov" , Michal Hocko , Mike Kravetz , Andrea Arcangeli , Matthew Wilcox , linux-kernel@vger.kernel.org Subject: [PATCHv2] mm/migrate: clean up useless code in migrate_vma_collect_pmd() Date: Wed, 7 Aug 2019 16:41:12 +0800 Message-Id: <1565167272-21453-1-git-send-email-kernelfans@gmail.com> X-Mailer: git-send-email 2.7.5 In-Reply-To: <20190807052858.GA9749@mypc> References: <20190807052858.GA9749@mypc> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Clean up useless 'pfn' variable. Signed-off-by: Pingfan Liu Cc: "Jérôme Glisse" Cc: Andrew Morton Cc: Mel Gorman Cc: Jan Kara Cc: "Kirill A. Shutemov" Cc: Michal Hocko Cc: Mike Kravetz Cc: Andrea Arcangeli Cc: Matthew Wilcox To: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org --- mm/migrate.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/mm/migrate.c b/mm/migrate.c index 8992741..d483a55 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -2225,17 +2225,15 @@ static int migrate_vma_collect_pmd(pmd_t *pmdp, pte_t pte; pte = *ptep; - pfn = pte_pfn(pte); if (pte_none(pte)) { mpfn = MIGRATE_PFN_MIGRATE; migrate->cpages++; - pfn = 0; goto next; } if (!pte_present(pte)) { - mpfn = pfn = 0; + mpfn = 0; /* * Only care about unaddressable device page special @@ -2252,10 +2250,10 @@ static int migrate_vma_collect_pmd(pmd_t *pmdp, if (is_write_device_private_entry(entry)) mpfn |= MIGRATE_PFN_WRITE; } else { + pfn = pte_pfn(pte); if (is_zero_pfn(pfn)) { mpfn = MIGRATE_PFN_MIGRATE; migrate->cpages++; - pfn = 0; goto next; } page = vm_normal_page(migrate->vma, addr, pte); @@ -2265,10 +2263,9 @@ static int migrate_vma_collect_pmd(pmd_t *pmdp, /* FIXME support THP */ if (!page || !page->mapping || PageTransCompound(page)) { - mpfn = pfn = 0; + mpfn = 0; goto next; } - pfn = page_to_pfn(page); /* * By getting a reference on the page we pin it and that blocks -- 2.7.5