tegra: hwpm: Use conftest for get_user_pages

The conftest script already has a test for checking which variant of the
get_user_pages() function is present in the kernel. So use the
definition generated by conftest to select which function variant is
used.

Bug 4276500

Change-Id: I29d216c8cead657c1daca4ce11b3dc3f74928467
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-hwpm/+/3015357
Reviewed-by: Vedashree Vidwans <vvidwans@nvidia.com>
GVS: Gerrit_Virtual_Submit <buildbot_gerritrpt@nvidia.com>
This commit is contained in:
Jon Hunter
2023-11-13 18:03:48 +00:00
committed by mobile promotions
parent 13a7312154
commit f9360f364f

View File

@@ -467,12 +467,12 @@ int tegra_hwpm_map_update_allowlist(struct tegra_soc_hwpm *hwpm,
goto fail; goto fail;
} }
#if (LINUX_VERSION_CODE < KERNEL_VERSION(6, 5, 0)) #if defined(NV_GET_USER_PAGES_HAS_ARGS_FLAGS) /* Linux v6.5 */
pinned_pages = get_user_pages(user_va & PAGE_MASK,
hwpm->alist_map->num_pages, 0, hwpm->alist_map->pages, NULL);
#else
pinned_pages = get_user_pages(user_va & PAGE_MASK, pinned_pages = get_user_pages(user_va & PAGE_MASK,
hwpm->alist_map->num_pages, 0, hwpm->alist_map->pages); hwpm->alist_map->num_pages, 0, hwpm->alist_map->pages);
#else
pinned_pages = get_user_pages(user_va & PAGE_MASK,
hwpm->alist_map->num_pages, 0, hwpm->alist_map->pages, NULL);
#endif #endif
if (pinned_pages != hwpm->alist_map->num_pages) { if (pinned_pages != hwpm->alist_map->num_pages) {
tegra_hwpm_err(hwpm, "Requested %llu pages / Got %ld pages", tegra_hwpm_err(hwpm, "Requested %llu pages / Got %ld pages",