From patchwork Thu Jul 5 06:49:50 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Williams X-Patchwork-Id: 10508259 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 71B42603D7 for ; Thu, 5 Jul 2018 06:59:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5DC0828DF2 for ; Thu, 5 Jul 2018 06:59:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 5265428E49; Thu, 5 Jul 2018 06:59:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D600928DF2 for ; Thu, 5 Jul 2018 06:59:51 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 16E176B0275; Thu, 5 Jul 2018 02:59:50 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 145E06B0276; Thu, 5 Jul 2018 02:59:50 -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 05F4E6B0277; Thu, 5 Jul 2018 02:59:50 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pf0-f199.google.com (mail-pf0-f199.google.com [209.85.192.199]) by kanga.kvack.org (Postfix) with ESMTP id B8D666B0275 for ; Thu, 5 Jul 2018 02:59:49 -0400 (EDT) Received: by mail-pf0-f199.google.com with SMTP id d4-v6so4311431pfn.9 for ; Wed, 04 Jul 2018 23:59:49 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:subject:from :to:cc:date:message-id:in-reply-to:references:user-agent :mime-version:content-transfer-encoding; bh=x6tHyyksI0rmrA/3v0BP+CdDcvc26FohjA6U/98K0Wg=; b=DM1uX88l6wkCxo1ziBFuoLuhVhMgNJFDwF/nxmHjZJa51ZaTAFXBl0HVIsa1NUOo8B 9g12FCrVjkhIyV8Si5ihcEe5ufmDUMOY5DtbmCLWj0/hSVoiZyLCIiOqsN4LlqLApiLD u3LPd+HRKs606oC+M/LocypTFJk8elT3GhEdcGEWSKs6kOpUtN9MezCqhBgZxNt4NQjx V/vTXYj0Rqz8aHzmbYkBhgKQkBrIDYU9TmeWIicaSfRWhODcrUsr0hWrbRRWeHmPyDwD jZxPkoNJvMGRRnuX5NjYC8Pzbvb2BrKPZ6+CTgawRLWE9OFJAILIw0uQu7Z94GAM0nvA lPeg== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of dan.j.williams@intel.com designates 134.134.136.31 as permitted sender) smtp.mailfrom=dan.j.williams@intel.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Gm-Message-State: APt69E0X/uydBupgSlWZ1YsZtJ+HTDXHUSB23a5ks5CReetcqrecjsmn m/OrkZopPF+YFtHc2dXYG4zsH0jCNZvEZX8cMuNEWDg9zO0Cgn0UOUBjLObbyFTb9oSzNUAEhJF 06mjKaM/5VRsuc0fiCePbuSuLGqRRavcsiQxlFLPbZ9BPc4y5SrHnXToyGqpwdR2CxQ== X-Received: by 2002:aa7:86d7:: with SMTP id h23-v6mr5137315pfo.132.1530773989445; Wed, 04 Jul 2018 23:59:49 -0700 (PDT) X-Google-Smtp-Source: AAOMgpeBRcjMt+jC03MnVReJXGPvU9slzLAVZS34wvqn9yFTUncZNbjUBe98uDF08nD6hCCpl2kb X-Received: by 2002:aa7:86d7:: with SMTP id h23-v6mr5137280pfo.132.1530773988686; Wed, 04 Jul 2018 23:59:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530773988; cv=none; d=google.com; s=arc-20160816; b=F/4Ms9Rv4K8YP87a2eMNU4jEY5hmbQom2/qLxzlpJfiklOePUC8bHDGQr+bn/jPtuq X9z+oQHkEq1a2Tek4CH9ZMao4l7Foy5opDd3TENQS6fFaW2mQwDdQeYpLSYMcbE8JuHy qda0yrfZ4MiSR7JpppfdxkgqTtQEzXdBopz2CmOwFHwvNOix3HiKPYfe+4F+ZLSJIWRO yKhqPPHd/4ZQ2bfgqM1HTYPhqrSSNp+I4qvihewVrp5aGV5T7jA9owqnimxXd48l8EEN UmC46nOztD5QkfQMGclZBuAVQkRSY8NnrDzmJlB/gJFgSJ28O7FOagqd+iVVlbVZBg+5 vfoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=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=tw+MY7zu3Z8c0vuqEe06dXtycnOukefpei0HvFpUJMtLRVfTN/l0muVNgdqXBhIWXz +STLs5WbYKqX0yfnqHiuRXgY2XxmW2zRAbYz0aB8wDuu0H10oNu3ukfFlyfVdg+EjDf6 bfQLDTE46B/EfvoQ3yI/pzNNUB7lIDupf7AtegCAbJDhblFIgQ8bJ8/UalXDs/giYXu5 kVH/N1pAQc/rQAvFIBKiTTk2zGxaJgNhQdvLCUgk6Qe0SDuIZL6xp/sGYIWWSmGEDueG jhAoPzC6fSKTIgYtgRGxHDVmc84wVkuSsLH9rjkJzsfuReK6Oq+gL5Ew7ODUkgmHxj8J zMeg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of dan.j.williams@intel.com designates 134.134.136.31 as permitted sender) smtp.mailfrom=dan.j.williams@intel.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from mga06.intel.com (mga06.intel.com. [134.134.136.31]) by mx.google.com with ESMTPS id m67-v6si5208675pgm.517.2018.07.04.23.59.48 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 04 Jul 2018 23:59:48 -0700 (PDT) Received-SPF: pass (google.com: domain of dan.j.williams@intel.com designates 134.134.136.31 as permitted sender) client-ip=134.134.136.31; Authentication-Results: mx.google.com; spf=pass (google.com: domain of dan.j.williams@intel.com designates 134.134.136.31 as permitted sender) smtp.mailfrom=dan.j.williams@intel.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga104.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 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: X-Virus-Scanned: ClamAV using ClamSMTP 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;