[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20211210232404.4098157-3-ira.weiny@intel.com>
Date: Fri, 10 Dec 2021 15:23:59 -0800
From: ira.weiny@...el.com
To: David Airlie <airlied@...ux.ie>, Daniel Vetter <daniel@...ll.ch>,
Patrik Jakobsson <patrik.r.jakobsson@...il.com>,
Rob Clark <robdclark@...il.com>, Sean Paul <sean@...rly.run>
Cc: Ira Weiny <ira.weiny@...el.com>, amd-gfx@...ts.freedesktop.org,
dri-devel@...ts.freedesktop.org, linux-kernel@...r.kernel.org,
intel-gfx@...ts.freedesktop.org, linux-arm-msm@...r.kernel.org
Subject: [PATCH 2/7] drm/amd: Replace kmap() with kmap_local_page()
From: Ira Weiny <ira.weiny@...el.com>
kmap() is being deprecated. These maps are thread local and can be
replaced with kmap_local_page().
Replace kmap() with kmap_local_page()
Signed-off-by: Ira Weiny <ira.weiny@...el.com>
---
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
index c875f1cdd2af..a3a2c73a44bb 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c
@@ -2281,9 +2281,9 @@ static ssize_t amdgpu_iomem_read(struct file *f, char __user *buf,
if (p->mapping != adev->mman.bdev.dev_mapping)
return -EPERM;
- ptr = kmap(p);
+ ptr = kmap_local_page(p);
r = copy_to_user(buf, ptr + off, bytes);
- kunmap(p);
+ kunmap_local(ptr);
if (r)
return -EFAULT;
@@ -2332,9 +2332,9 @@ static ssize_t amdgpu_iomem_write(struct file *f, const char __user *buf,
if (p->mapping != adev->mman.bdev.dev_mapping)
return -EPERM;
- ptr = kmap(p);
+ ptr = kmap_local_page(p);
r = copy_from_user(ptr + off, buf, bytes);
- kunmap(p);
+ kunmap_local(ptr);
if (r)
return -EFAULT;
--
2.31.1
Powered by blists - more mailing lists