mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-23 01:50:07 +03:00
gpu: nvgpu: fix CERT-C violations
This patch fixes following CERT-C violations for power management unit: - CERT INT31-C NVGPU-3403 Change-Id: I4eb2374cc720c6d0bb81d6a4d9750348d4e5a670 Signed-off-by: Vaibhav Kachore <vkachore@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/2117659 Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com> Reviewed-by: svc-mobile-misra <svc-mobile-misra@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Deepak Nibade <dnibade@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
7a18c10dbe
commit
854e861ad0
@@ -149,7 +149,7 @@ int gk20a_finalize_poweron(struct gk20a *g)
|
||||
{
|
||||
int err = 0;
|
||||
#if defined(CONFIG_TEGRA_GK20A_NVHOST)
|
||||
u32 nr_pages;
|
||||
u64 nr_pages;
|
||||
#endif
|
||||
|
||||
nvgpu_log_fn(g, " ");
|
||||
@@ -473,7 +473,7 @@ int gk20a_finalize_poweron(struct gk20a *g)
|
||||
#if defined(CONFIG_TEGRA_GK20A_NVHOST)
|
||||
if (nvgpu_has_syncpoints(g) && (g->syncpt_unit_size != 0UL)) {
|
||||
if (!nvgpu_mem_is_valid(&g->syncpt_mem)) {
|
||||
nr_pages = U32(DIV_ROUND_UP(g->syncpt_unit_size,
|
||||
nr_pages = U64(DIV_ROUND_UP(g->syncpt_unit_size,
|
||||
PAGE_SIZE));
|
||||
err = nvgpu_mem_create_from_phys(g, &g->syncpt_mem,
|
||||
g->syncpt_unit_base, nr_pages);
|
||||
|
||||
@@ -297,7 +297,7 @@ static const struct nvgpu_sgt_ops nvgpu_mem_phys_ops = {
|
||||
};
|
||||
|
||||
int nvgpu_mem_create_from_phys(struct gk20a *g, struct nvgpu_mem *dest,
|
||||
u64 src_phys, u32 nr_pages)
|
||||
u64 src_phys, u64 nr_pages)
|
||||
{
|
||||
int ret = 0;
|
||||
struct nvgpu_sgt *sgt;
|
||||
@@ -317,7 +317,7 @@ int nvgpu_mem_create_from_phys(struct gk20a *g, struct nvgpu_mem *dest,
|
||||
(void) memset(dest, 0, sizeof(*dest));
|
||||
|
||||
dest->aperture = APERTURE_SYSMEM;
|
||||
dest->size = (u64)nr_pages * SZ_4K;
|
||||
dest->size = nr_pages * SZ_4K;
|
||||
dest->aligned_size = dest->size;
|
||||
dest->mem_flags = __NVGPU_MEM_FLAG_NO_DMA;
|
||||
dest->phys_sgt = sgt;
|
||||
|
||||
@@ -57,7 +57,7 @@ static int set_syncpt_ro_map_gpu_va_locked(struct vm_gk20a *vm)
|
||||
int gv11b_syncpt_alloc_buf(struct nvgpu_channel *c,
|
||||
u32 syncpt_id, struct nvgpu_mem *syncpt_buf)
|
||||
{
|
||||
u32 nr_pages;
|
||||
u64 nr_pages;
|
||||
int err = 0;
|
||||
struct gk20a *g = c->g;
|
||||
|
||||
|
||||
@@ -243,7 +243,7 @@ int nvgpu_mem_create_from_mem(struct gk20a *g,
|
||||
* Returns 0 on success, or a relevant error otherwise.
|
||||
*/
|
||||
int nvgpu_mem_create_from_phys(struct gk20a *g, struct nvgpu_mem *dest,
|
||||
u64 src_phys, u32 nr_pages);
|
||||
u64 src_phys, u64 nr_pages);
|
||||
|
||||
/*
|
||||
* Really free a vidmem buffer. There's a fair amount of work involved in
|
||||
|
||||
Reference in New Issue
Block a user