From 9578ed6c4ed9af8e6d3016f65c30b8f28d9168f6 Mon Sep 17 00:00:00 2001
From: dinesh
Date: Thu, 27 Dec 2018 00:03:28 +0530
Subject: [PATCH] gpu: nvgpu: VM fixup for MISRA 10.3
The function parameter of nvgpu_vm_map function is fixed for MISRA
where implicit assignment of objects to a narrower or different
essential type not allowed.This fixes few enum violations.
JIRA NVGPU-1584
Change-Id: I2353f7501c3326f792f5942b2e247badf03349cf
Signed-off-by: Dinesh T
Reviewed-on: https://git-master.nvidia.com/r/1986509
Reviewed-by: mobile promotions
Tested-by: mobile promotions
---
drivers/gpu/nvgpu/common/mm/vm.c | 2 +-
drivers/gpu/nvgpu/include/nvgpu/linux/vm.h | 5 +++--
drivers/gpu/nvgpu/include/nvgpu/vm.h | 4 ++--
drivers/gpu/nvgpu/os/linux/vm.c | 4 ++--
4 files changed, 8 insertions(+), 7 deletions(-)
diff --git a/drivers/gpu/nvgpu/common/mm/vm.c b/drivers/gpu/nvgpu/common/mm/vm.c
index 27a123e75..b7acf90ff 100644
--- a/drivers/gpu/nvgpu/common/mm/vm.c
+++ b/drivers/gpu/nvgpu/common/mm/vm.c
@@ -826,7 +826,7 @@ struct nvgpu_mapped_buf *nvgpu_vm_map(struct vm_gk20a *vm,
u64 map_addr,
u64 map_size,
u64 phys_offset,
- int rw,
+ enum gk20a_mem_rw_flag rw,
u32 flags,
s16 compr_kind,
s16 incompr_kind,
diff --git a/drivers/gpu/nvgpu/include/nvgpu/linux/vm.h b/drivers/gpu/nvgpu/include/nvgpu/linux/vm.h
index 6f3beaa96..b807d87e3 100644
--- a/drivers/gpu/nvgpu/include/nvgpu/linux/vm.h
+++ b/drivers/gpu/nvgpu/include/nvgpu/linux/vm.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2018, NVIDIA CORPORATION. All rights reserved.
+ * Copyright (c) 2017-2019, NVIDIA CORPORATION. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
@@ -38,6 +38,7 @@ struct device;
struct vm_gk20a;
struct vm_gk20a_mapping_batch;
struct nvgpu_vm_area;
+enum gk20a_mem_rw_flag;
struct nvgpu_os_buffer {
struct dma_buf *dmabuf;
@@ -59,7 +60,7 @@ int nvgpu_vm_map_linux(struct vm_gk20a *vm,
u32 page_size,
s16 compr_kind,
s16 incompr_kind,
- int rw_flag,
+ enum gk20a_mem_rw_flag rw_flag,
u64 buffer_offset,
u64 mapping_size,
struct vm_gk20a_mapping_batch *mapping_batch,
diff --git a/drivers/gpu/nvgpu/include/nvgpu/vm.h b/drivers/gpu/nvgpu/include/nvgpu/vm.h
index 28109b4e4..ce4d6b6b7 100644
--- a/drivers/gpu/nvgpu/include/nvgpu/vm.h
+++ b/drivers/gpu/nvgpu/include/nvgpu/vm.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2018, NVIDIA CORPORATION. All rights reserved.
+ * Copyright (c) 2017-2019, NVIDIA CORPORATION. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -256,7 +256,7 @@ struct nvgpu_mapped_buf *nvgpu_vm_map(struct vm_gk20a *vm,
u64 map_addr,
u64 map_size,
u64 phys_offset,
- int rw,
+ enum gk20a_mem_rw_flag rw,
u32 flags,
s16 compr_kind,
s16 incompr_kind,
diff --git a/drivers/gpu/nvgpu/os/linux/vm.c b/drivers/gpu/nvgpu/os/linux/vm.c
index 5ceff59f1..febbb6fb0 100644
--- a/drivers/gpu/nvgpu/os/linux/vm.c
+++ b/drivers/gpu/nvgpu/os/linux/vm.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2017-2018, NVIDIA CORPORATION. All rights reserved.
+ * Copyright (c) 2017-2019, NVIDIA CORPORATION. All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it
* under the terms and conditions of the GNU General Public License,
@@ -181,7 +181,7 @@ int nvgpu_vm_map_linux(struct vm_gk20a *vm,
u32 page_size,
s16 compr_kind,
s16 incompr_kind,
- int rw_flag,
+ enum gk20a_mem_rw_flag rw_flag,
u64 buffer_offset,
u64 mapping_size,
struct vm_gk20a_mapping_batch *batch,