Commit 88b69fcc authored by Soby Mathew's avatar Soby Mathew Committed by TrustedFirmware Code Review
Browse files

Merge "Tegra: memctrl_v2: fix "overflow before widen" coverity issue" into integration

parents f52f73b3 36bf55d6
/* /*
* Copyright (c) 2015-2017, ARM Limited and Contributors. All rights reserved. * Copyright (c) 2015-2017, ARM Limited and Contributors. All rights reserved.
* Copyright (c) 2019, NVIDIA Corporation. All rights reserved.
* *
* SPDX-License-Identifier: BSD-3-Clause * SPDX-License-Identifier: BSD-3-Clause
*/ */
...@@ -360,17 +361,15 @@ void tegra_memctrl_videomem_setup(uint64_t phys_base, uint32_t size_in_bytes) ...@@ -360,17 +361,15 @@ void tegra_memctrl_videomem_setup(uint64_t phys_base, uint32_t size_in_bytes)
if ((phys_base > vmem_end_old) || (video_mem_base > vmem_end_new)) { if ((phys_base > vmem_end_old) || (video_mem_base > vmem_end_new)) {
tegra_clear_videomem(video_mem_base, tegra_clear_videomem(video_mem_base,
(uint32_t)video_mem_size_mb << 20U); video_mem_size_mb << 20U);
} else { } else {
if (video_mem_base < phys_base) { if (video_mem_base < phys_base) {
non_overlap_area_size = phys_base - video_mem_base; non_overlap_area_size = phys_base - video_mem_base;
tegra_clear_videomem(video_mem_base, tegra_clear_videomem(video_mem_base, non_overlap_area_size);
(uint32_t)non_overlap_area_size);
} }
if (vmem_end_old > vmem_end_new) { if (vmem_end_old > vmem_end_new) {
non_overlap_area_size = vmem_end_old - vmem_end_new; non_overlap_area_size = vmem_end_old - vmem_end_new;
tegra_clear_videomem(vmem_end_new, tegra_clear_videomem(vmem_end_new, non_overlap_area_size);
(uint32_t)non_overlap_area_size);
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment