diff mbox series

[v2,5/6] md/dm-writecache: Don't request pointer dummy_addr when not required

Message ID 20180725162849.8320-6-yehs2007@zoho.com (mailing list archive)
State New, archived
Headers show
Series kaddr and pfn can be NULL to ->direct_access() | expand

Commit Message

Huaisheng Ye July 25, 2018, 4:28 p.m. UTC
From: Huaisheng Ye <yehs1@lenovo.com>

Function persistent_memory_claim doesn't need to get local pointer
dummy_addr from direct_access. Using NULL instead of having to pass
in a useless local pointer that caller then just throw away.

Suggested-by: Ross Zwisler <ross.zwisler@linux.intel.com>
Signed-off-by: Huaisheng Ye <yehs1@lenovo.com>
---
 drivers/md/dm-writecache.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Mike Snitzer July 27, 2018, 7:33 p.m. UTC | #1
On Wed, Jul 25 2018 at 12:28pm -0400,
Huaisheng Ye <yehs2007@zoho.com> wrote:

> From: Huaisheng Ye <yehs1@lenovo.com>
> 
> Function persistent_memory_claim doesn't need to get local pointer
> dummy_addr from direct_access. Using NULL instead of having to pass
> in a useless local pointer that caller then just throw away.
> 
> Suggested-by: Ross Zwisler <ross.zwisler@linux.intel.com>
> Signed-off-by: Huaisheng Ye <yehs1@lenovo.com>

Acked-by: Mike Snitzer <snitzer@redhat.com>
diff mbox series

Patch

diff --git a/drivers/md/dm-writecache.c b/drivers/md/dm-writecache.c
index 87107c9..9d79084 100644
--- a/drivers/md/dm-writecache.c
+++ b/drivers/md/dm-writecache.c
@@ -268,9 +268,8 @@  static int persistent_memory_claim(struct dm_writecache *wc)
 		i = 0;
 		do {
 			long daa;
-			void *dummy_addr;
 			daa = dax_direct_access(wc->ssd_dev->dax_dev, i, p - i,
-						&dummy_addr, &pfn);
+						NULL, &pfn);
 			if (daa <= 0) {
 				r = daa ? daa : -EINVAL;
 				goto err3;