gpu: nvgpu: fix REMAP android build failure

Rework nvgpu_vm_remap_os_buf structure initialization to
avoid android/clang build issues with the use of a single pair
of {} to initialize certain structures.

The os-dependent nvgpu_vm_remap_os_buf_get() routine now does
a memset of the structure prior to initializing its contents.

Jira NVGPU-6804

Change-Id: I08682c6ab7b8324a605a56ed660dea5bea11d16b
Signed-off-by: scottl <scottl@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2553193
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: svcacv <svcacv@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
This commit is contained in:
scottl
2021-07-02 11:54:53 -07:00
committed by mobile promotions
parent e9872a0d91
commit cd3ad1ccc7
2 changed files with 3 additions and 1 deletions

View File

@@ -544,7 +544,7 @@ static int nvgpu_vm_remap_get_mpool(struct vm_gk20a *vm,
struct nvgpu_vm_remap_mpool **curr_mpool, struct nvgpu_vm_remap_mpool **curr_mpool,
u32 *curr_mem_handle) u32 *curr_mem_handle)
{ {
struct nvgpu_vm_remap_os_buffer remap_os_buf = { 0 }; struct nvgpu_vm_remap_os_buffer remap_os_buf;
int err = 0; int err = 0;
if (op->mem_handle == *curr_mem_handle) { if (op->mem_handle == *curr_mem_handle) {

View File

@@ -100,6 +100,8 @@ int nvgpu_vm_remap_os_buf_get(struct vm_gk20a *vm,
goto clean_up; goto clean_up;
} }
memset(remap_os_buf, 0, sizeof(*remap_os_buf));
remap_os_buf->os_priv.dmabuf = dmabuf; remap_os_buf->os_priv.dmabuf = dmabuf;
remap_os_buf->os_priv.attachment = attachment; remap_os_buf->os_priv.attachment = attachment;
remap_os_buf->os_priv.sgt = sgt; remap_os_buf->os_priv.sgt = sgt;