Skip to content

Commit 0668db4

Browse files
illeviKobyElbaz
authored andcommitted
accel/habanalabs: remove old interface variation of 'access_ok()'
The access_ok() API no longer requires the VERIFY_WRITE argument, and the use of the old interface with VERIFY_WRITE is deprecated. Clean up the habanalabs memory manager to use the modern access_ok() interface consistently. This removes old #ifdef guards and aligns the driver with current upstream kernel APIs. Signed-off-by: Ilia Levi <[email protected]> Reviewed-by: Koby Elbaz <[email protected]> Signed-off-by: Koby Elbaz <[email protected]>
1 parent 0529b19 commit 0668db4

File tree

1 file changed

+0
-5
lines changed

1 file changed

+0
-5
lines changed

drivers/accel/habanalabs/common/memory_mgr.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -259,13 +259,8 @@ int hl_mem_mgr_mmap(struct hl_mem_mgr *mmg, struct vm_area_struct *vma,
259259
goto put_mem;
260260
}
261261

262-
#ifdef _HAS_TYPE_ARG_IN_ACCESS_OK
263-
if (!access_ok(VERIFY_WRITE, (void __user *)(uintptr_t)vma->vm_start,
264-
user_mem_size)) {
265-
#else
266262
if (!access_ok((void __user *)(uintptr_t)vma->vm_start,
267263
user_mem_size)) {
268-
#endif
269264
dev_err(mmg->dev, "%s: User pointer is invalid - 0x%lx\n",
270265
buf->behavior->topic, vma->vm_start);
271266

0 commit comments

Comments
 (0)