From 76acbc02bc9517c997a3ce8c7e366cb61cbf885c Mon Sep 17 00:00:00 2001 From: Philip Elcan Date: Tue, 22 Jan 2019 13:22:28 -0500 Subject: [PATCH] gpu: nvgpu: clk: fix return type for vflookup() This changes the return type for the API fvlookup() from a u32 to an int. The implementation of the API in vflookup_prob_1x_master() was already trying to return negative values. This allows users of the API to properly check the return value. JIRA NVGPU-1008 Change-Id: Ifb12b5ffbde7fed501e7dfec9bd6a28dcc1b242e Signed-off-by: Philip Elcan Reviewed-on: https://git-master.nvidia.com/r/2001225 Reviewed-by: svc-mobile-coverity Reviewed-by: svc-mobile-misra GVS: Gerrit_Virtual_Submit Reviewed-by: Alex Waterman Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/common/pmu/clk/clk_prog.c | 4 ++-- drivers/gpu/nvgpu/common/pmu/clk/clk_prog.h | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/nvgpu/common/pmu/clk/clk_prog.c b/drivers/gpu/nvgpu/common/pmu/clk/clk_prog.c index 72689969c..16581bc3e 100644 --- a/drivers/gpu/nvgpu/common/pmu/clk/clk_prog.c +++ b/drivers/gpu/nvgpu/common/pmu/clk/clk_prog.c @@ -41,7 +41,7 @@ static int vfflatten_prog_1x_master(struct gk20a *g, struct clk_pmupstate *pclk, struct clk_prog_1x_master *p1xmaster, u8 clk_domain_idx, u16 *pfreqmaxlastmhz); -static u32 vflookup_prog_1x_master(struct gk20a *g, +static int vflookup_prog_1x_master(struct gk20a *g, struct clk_pmupstate *pclk, struct clk_prog_1x_master *p1xmaster, u8 *slave_clk_domain, @@ -1474,7 +1474,7 @@ done: return status; } -static u32 vflookup_prog_1x_master +static int vflookup_prog_1x_master ( struct gk20a *g, struct clk_pmupstate *pclk, diff --git a/drivers/gpu/nvgpu/common/pmu/clk/clk_prog.h b/drivers/gpu/nvgpu/common/pmu/clk/clk_prog.h index c6241f4d2..3033449b2 100644 --- a/drivers/gpu/nvgpu/common/pmu/clk/clk_prog.h +++ b/drivers/gpu/nvgpu/common/pmu/clk/clk_prog.h @@ -1,5 +1,5 @@ /* -* Copyright (c) 2016-2018, NVIDIA CORPORATION. All rights reserved. +* Copyright (c) 2016-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"), @@ -36,7 +36,7 @@ typedef int vf_flatten(struct gk20a *g, struct clk_pmupstate *pclk, struct clk_prog_1x_master *p1xmaster, u8 clk_domain_idx, u16 *pfreqmaxlastmhz); -typedef u32 vf_lookup(struct gk20a *g, struct clk_pmupstate *pclk, +typedef int vf_lookup(struct gk20a *g, struct clk_pmupstate *pclk, struct clk_prog_1x_master *p1xmaster, u8 *slave_clk_domain_idx, u16 *pclkmhz, u32 *pvoltuv, u8 rail);