Received: by 2002:ac0:a591:0:0:0:0:0 with SMTP id m17-v6csp298709imm; Thu, 5 Jul 2018 00:03:06 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcrc7/YwXOp42EHgPThM1zcnBoTJ16Qj/FKPsN2TC5RWHFdL2+/4h7go7HMpBKYGZvOxn1Q X-Received: by 2002:a17:902:5a83:: with SMTP id r3-v6mr4882082pli.78.1530774186582; Thu, 05 Jul 2018 00:03:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530774186; cv=none; d=google.com; s=arc-20160816; b=TxGNffaAUbAeYhEI+HZyNDoy2l+sWdgoMgAYmXt9lt75Wl3+Q438bcvQtckD4eoKpy 2g70vpYm1Yd0u8f985vT7hRaUeKZMkmFhVMawkwrATHmXhSUyWteDi+mq708x43RWuqr OXiiWnQIANy0rBn/yM2Jj0qZsFt5INDkCQp9ifJ7u+cqX5dTTxsWoGUOS2q8QREfXhbM UIWSMLHKmP7fxfYyGPk3hhcvR3gIwUNnH+7uxfOsb80QjTy4j1oyL0aYBzIhEmYLp8Pb gKUBoeJf4EPnUGUQTZiDqejnWX33QxKN1/j2YnBxnlYvX/7zO56onLxpcbzEE0DE9HGt h9Fw== 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 :user-agent:references:in-reply-to:message-id:date:cc:to:from :subject:arc-authentication-results; bh=x6tHyyksI0rmrA/3v0BP+CdDcvc26FohjA6U/98K0Wg=; b=b60+C0Q/R5HYUq7Xb6sAy7p0/SFMafVP4qqu8+DXJAr2AqqQ9KsbX4VF34G6OeXNqx gcxERCwRSbJpDlLONuanv+s/2Ps4ktJB02VKMreqVxk/uWxZKUS3soxOum0e/aeejtqR YzDP9+qy29cHy7maIurD7eOZH4iEBerSEVmDrEEt7q87E8KHx1Sv9PqXEyQRcUV3XmoA Ni2pkEJmbk/hOz+i8prUtszZ4PsHd1V6GXcxh6ehSnxX7v5U3xrQd1WgpZ2ttYmy1kND 1U+imOl+4Wkjac/khPRm25/H7aEB+zck0m04t/16H5FJFWJKpHswo4PM8tgxSnBtO9hM JfgA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 15-v6si1804173pgo.574.2018.07.05.00.02.52; Thu, 05 Jul 2018 00:03:06 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753553AbeGEG7v (ORCPT + 99 others); Thu, 5 Jul 2018 02:59:51 -0400 Received: from mga18.intel.com ([134.134.136.126]:36394 "EHLO mga18.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753528AbeGEG7s (ORCPT ); Thu, 5 Jul 2018 02:59:48 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 04 Jul 2018 23:59:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,311,1526367600"; d="scan'208";a="64559174" Received: from dwillia2-desk3.jf.intel.com (HELO dwillia2-desk3.amr.corp.intel.com) ([10.54.39.16]) by orsmga003.jf.intel.com with ESMTP; 04 Jul 2018 23:59:48 -0700 Subject: [PATCH 09/13] fs/dax: Assign NULL to pfn of dax_direct_access if useless From: Dan Williams To: akpm@linux-foundation.org Cc: Huaisheng Ye , Jan Kara , vishal.l.verma@intel.com, hch@lst.de, linux-nvdimm@lists.01.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Date: Wed, 04 Jul 2018 23:49:50 -0700 Message-ID: <153077339083.40830.7002878534903996422.stgit@dwillia2-desk3.amr.corp.intel.com> In-Reply-To: <153077334130.40830.2714147692560185329.stgit@dwillia2-desk3.amr.corp.intel.com> References: <153077334130.40830.2714147692560185329.stgit@dwillia2-desk3.amr.corp.intel.com> User-Agent: StGit/0.18-2-gc94f MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Huaisheng Ye Some functions within fs/dax don't need to get pfn from direct_access. Assigning NULL to pfn of dax_direct_access is more intuitive and simple than offering a useless local variable. Signed-off-by: Huaisheng Ye Reviewed-by: Jan Kara Signed-off-by: Dan Williams --- fs/dax.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/fs/dax.c b/fs/dax.c index 641192808bb6..28264ff4e343 100644 --- a/fs/dax.c +++ b/fs/dax.c @@ -647,7 +647,6 @@ static int copy_user_dax(struct block_device *bdev, struct dax_device *dax_dev, { void *vto, *kaddr; pgoff_t pgoff; - pfn_t pfn; long rc; int id; @@ -656,7 +655,7 @@ static int copy_user_dax(struct block_device *bdev, struct dax_device *dax_dev, return rc; id = dax_read_lock(); - rc = dax_direct_access(dax_dev, pgoff, PHYS_PFN(size), &kaddr, &pfn); + rc = dax_direct_access(dax_dev, pgoff, PHYS_PFN(size), &kaddr, NULL); if (rc < 0) { dax_read_unlock(id); return rc; @@ -1052,15 +1051,13 @@ int __dax_zero_page_range(struct block_device *bdev, pgoff_t pgoff; long rc, id; void *kaddr; - pfn_t pfn; rc = bdev_dax_pgoff(bdev, sector, PAGE_SIZE, &pgoff); if (rc) return rc; id = dax_read_lock(); - rc = dax_direct_access(dax_dev, pgoff, 1, &kaddr, - &pfn); + rc = dax_direct_access(dax_dev, pgoff, 1, &kaddr, NULL); if (rc < 0) { dax_read_unlock(id); return rc; @@ -1116,7 +1113,6 @@ dax_iomap_actor(struct inode *inode, loff_t pos, loff_t length, void *data, ssize_t map_len; pgoff_t pgoff; void *kaddr; - pfn_t pfn; if (fatal_signal_pending(current)) { ret = -EINTR; @@ -1128,7 +1124,7 @@ dax_iomap_actor(struct inode *inode, loff_t pos, loff_t length, void *data, break; map_len = dax_direct_access(dax_dev, pgoff, PHYS_PFN(size), - &kaddr, &pfn); + &kaddr, NULL); if (map_len < 0) { ret = map_len; break;