drivers: Use conftest for vm_flags

The conftest script has a test for checking if the vm_area struct has a
const vm_flags member. So enable this test and use the definition
generated in the appropriate drivers.

Bug 4374520

Change-Id: I0e7bd105fe8a821b0af23c0a5553b8d4468fa8c4
Signed-off-by: Jon Hunter <jonathanh@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3026924
(cherry picked from commit d0e427c6e1)
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3029982
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Jon Hunter
2023-12-02 16:40:32 +00:00
committed by mobile promotions
parent daec781815
commit a6701b19b9
5 changed files with 8 additions and 10 deletions

View File

@@ -3,6 +3,8 @@
#define pr_fmt(fmt) "nvscic2c-pcie: stream-ext: " fmt
#include <nvidia/conftest.h>
#include <linux/anon_inodes.h>
#include <linux/device.h>
#include <linux/errno.h>
@@ -15,7 +17,6 @@
#include <linux/slab.h>
#include <linux/syscalls.h>
#include <linux/tegra-pcie-edma.h>
#include <linux/version.h>
#include <uapi/misc/nvscic2c-pcie-ioctl.h>
@@ -294,7 +295,7 @@ fops_mmap(struct file *filep, struct vm_area_struct *vma)
memaddr = stream_obj->aper;
vma->vm_pgoff = 0;
#if defined(CONFIG_TEGRA_SYSTEM_TYPE_ACK) && (LINUX_VERSION_CODE >= KERNEL_VERSION(6, 1, 0))
#if defined(NV_VM_AREA_STRUCT_HAS_CONST_VM_FLAGS) /* Linux v6.3 */
vm_flags_set(vma, VM_DONTCOPY);
#else
vma->vm_flags |= (VM_DONTCOPY);