]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
accel/habanalabs: remove old interface variation of 'access_ok()'
authorIlia Levi <ilia.levi@intel.com>
Mon, 19 Aug 2024 09:13:07 +0000 (12:13 +0300)
committerKoby Elbaz <koby.elbaz@intel.com>
Thu, 25 Sep 2025 06:09:29 +0000 (09:09 +0300)
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 <ilia.levi@intel.com>
Reviewed-by: Koby Elbaz <koby.elbaz@intel.com>
Signed-off-by: Koby Elbaz <koby.elbaz@intel.com>
drivers/accel/habanalabs/common/memory_mgr.c

index 99cd83139d46b536339c56f145e290dd1e91bf78..4401beb99e42c02c234dae0f98194735b2c52360 100644 (file)
@@ -259,13 +259,8 @@ int hl_mem_mgr_mmap(struct hl_mem_mgr *mmg, struct vm_area_struct *vma,
                goto put_mem;
        }
 
-#ifdef _HAS_TYPE_ARG_IN_ACCESS_OK
-       if (!access_ok(VERIFY_WRITE, (void __user *)(uintptr_t)vma->vm_start,
-                      user_mem_size)) {
-#else
        if (!access_ok((void __user *)(uintptr_t)vma->vm_start,
                       user_mem_size)) {
-#endif
                dev_err(mmg->dev, "%s: User pointer is invalid - 0x%lx\n",
                        buf->behavior->topic, vma->vm_start);