From patchwork Mon Apr 18 23:55:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Shi X-Patchwork-Id: 66069 Delivered-To: patch@linaro.org Received: by 10.140.93.198 with SMTP id d64csp1565722qge; Mon, 18 Apr 2016 17:20:49 -0700 (PDT) X-Received: by 10.98.27.70 with SMTP id b67mr49138pfb.30.1461025248860; Mon, 18 Apr 2016 17:20:48 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id xc7si1038942pab.217.2016.04.18.17.20.48; Mon, 18 Apr 2016 17:20:48 -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=@linaro.org; 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 dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752617AbcDSAUr (ORCPT + 29 others); Mon, 18 Apr 2016 20:20:47 -0400 Received: from mail-pf0-f173.google.com ([209.85.192.173]:35913 "EHLO mail-pf0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751977AbcDSAUp (ORCPT ); Mon, 18 Apr 2016 20:20:45 -0400 Received: by mail-pf0-f173.google.com with SMTP id e128so322263pfe.3 for ; Mon, 18 Apr 2016 17:20:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=YbFnVpour0+FO0YdIipCMRbNX0kQE1/f4mVeQT0K1BI=; b=Ab04XXrVbV79AQIogFM2x5iOyxvVoWFEllO1db632g5oOtUucUm6sLcQ7N+6qidbhw J8einkftGn0cXrRiL6WwovbCmFeFVHyc6hN3+gdUu9OrR3c9rtfVxC5wm+m/U4wb6YPJ UFWoMt9VTB1RRdMyWUYtTCZwJZ78WyOFCUDHM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=YbFnVpour0+FO0YdIipCMRbNX0kQE1/f4mVeQT0K1BI=; b=jNAdPL7W8QjFo+/H/uLpLyVn6w7189eE1P7tyuk5CQVBROuGEDZrBP5BhJ9Skl/TL4 4JNPit6PgxbcqhEOGITfLKMe5XXckxYtqChUq+D6T5mkNN4lJCDMheeKrxFvwqgc9R5g v2v49f5+BDCCnAiZi/Pk2MlVOvVwYMgdbe6rzo7JVXFVXV2qRGbhLcbfX2ZRqkw90EQQ 0BTv/aStHCVAelCCT1ss2J6aKnqXAFa7bXD3yofl5nwEn/PB9Aa7wOt78nOatSbosJXr 63Y3ohVzCTmwO8iQ/y4EPTa/ZXuqe0Ncu+2SISWcDQUhP77tjmc805Ju/TNvyKrKjlu/ 7s+g== X-Gm-Message-State: AOPr4FWcntQ4SFv3ocfoV2I3zxl8g0vMKPGaUmCoHqD67Z9vjpxuqbiuHMnLcsNQ4Lz/Lu+f X-Received: by 10.98.25.69 with SMTP id 66mr36321pfz.60.1461025245034; Mon, 18 Apr 2016 17:20:45 -0700 (PDT) Received: from yshi-Precision-T5600.corp.ad.wrs.com (unknown-216-82.windriver.com. [147.11.216.82]) by smtp.gmail.com with ESMTPSA id r70sm33004947pfb.74.2016.04.18.17.20.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 18 Apr 2016 17:20:44 -0700 (PDT) From: Yang Shi To: akpm@linux-foundation.org, kirill.shutemov@linux.intel.com, aarcange@redhat.com, hughd@google.com, mgorman@suse.de Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, linaro-kernel@lists.linaro.org, yang.shi@linaro.org Subject: [PATCH] mm: thp: simplify the implementation of mk_huge_pmd Date: Mon, 18 Apr 2016 16:55:00 -0700 Message-Id: <1461023700-5851-1-git-send-email-yang.shi@linaro.org> X-Mailer: git-send-email 2.0.2 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The implementation of mk_huge_pmd looks verbose, it could be just simplified to one line code. Signed-off-by: Yang Shi --- mm/huge_memory.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) -- 2.0.2 diff --git a/mm/huge_memory.c b/mm/huge_memory.c index 8adf3c2..fecbbc5 100644 --- a/mm/huge_memory.c +++ b/mm/huge_memory.c @@ -764,10 +764,7 @@ pmd_t maybe_pmd_mkwrite(pmd_t pmd, struct vm_area_struct *vma) static inline pmd_t mk_huge_pmd(struct page *page, pgprot_t prot) { - pmd_t entry; - entry = mk_pmd(page, prot); - entry = pmd_mkhuge(entry); - return entry; + return pmd_mkhuge(mk_pmd(page, prot)); } static inline struct list_head *page_deferred_list(struct page *page)