From 99ed40b7fb310e28cab85fbd4d1e81af8ee1e992 Mon Sep 17 00:00:00 2001 From: Philip Elcan Date: Tue, 22 Jan 2019 13:07:45 -0500 Subject: [PATCH] gpu: nvgpu: clk: fix MISRA 10.3 issues for size_t MISRA Rule 10.3 prohibits implicit casting of objects to a different type. This change addresses a number of MISRA 10.3 violations in clk_domain.c where size_t values were being implicitly cast to u16. JIRA NVGPU-1008 Change-Id: If2dc6c6a288fe4b16425a210bc6d76bbef2ce019 Signed-off-by: Philip Elcan Reviewed-on: https://git-master.nvidia.com/r/2001224 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_domain.c | 20 +++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/gpu/nvgpu/common/pmu/clk/clk_domain.c b/drivers/gpu/nvgpu/common/pmu/clk/clk_domain.c index af376503e..51fa4cacc 100644 --- a/drivers/gpu/nvgpu/common/pmu/clk/clk_domain.c +++ b/drivers/gpu/nvgpu/common/pmu/clk/clk_domain.c @@ -846,14 +846,14 @@ static int clkdomaingetfpoints_stub( static int clk_domain_construct_super(struct gk20a *g, struct boardobj **ppboardobj, - u16 size, void *pargs) + size_t size, void *pargs) { struct clk_domain *pdomain; struct clk_domain *ptmpdomain = (struct clk_domain *)pargs; int status = 0; status = boardobj_construct_super(g, ppboardobj, - size, pargs); + (u16)size, pargs); if (status != 0) { return -EINVAL; @@ -907,7 +907,7 @@ static int _clk_domain_pmudatainit_3x(struct gk20a *g, static int clk_domain_construct_3x(struct gk20a *g, struct boardobj **ppboardobj, - u16 size, void *pargs) + size_t size, void *pargs) { struct boardobj *ptmpobj = (struct boardobj *)pargs; struct clk_domain_3x *pdomain; @@ -1241,7 +1241,7 @@ static int _clk_domain_pmudatainit_3x_prog(struct gk20a *g, static int clk_domain_construct_35_prog(struct gk20a *g, struct boardobj **ppboardobj, - u16 size, void *pargs) + size_t size, void *pargs) { struct boardobj *ptmpobj = (struct boardobj *)pargs; struct clk_domain_35_prog *pdomain; @@ -1294,7 +1294,7 @@ static int clk_domain_construct_35_prog(struct gk20a *g, static int clk_domain_construct_3x_prog(struct gk20a *g, struct boardobj **ppboardobj, - u16 size, void *pargs) + size_t size, void *pargs) { struct boardobj *ptmpobj = (struct boardobj *)pargs; struct clk_domain_3x_prog *pdomain; @@ -1389,7 +1389,7 @@ static int clk_domain_pmudatainit_3x_slave(struct gk20a *g, static int clk_domain_construct_35_slave(struct gk20a *g, struct boardobj **ppboardobj, - u16 size, void *pargs) + size_t size, void *pargs) { struct boardobj *ptmpobj = (struct boardobj *)pargs; struct clk_domain_35_slave *pdomain; @@ -1422,7 +1422,7 @@ static int clk_domain_construct_35_slave(struct gk20a *g, static int clk_domain_construct_3x_slave(struct gk20a *g, struct boardobj **ppboardobj, - u16 size, void *pargs) + size_t size, void *pargs) { struct boardobj *ptmpobj = (struct boardobj *)pargs; struct clk_domain_3x_slave *pdomain; @@ -1555,7 +1555,7 @@ static int _clk_domain_pmudatainit_3x_master(struct gk20a *g, static int clk_domain_construct_35_master(struct gk20a *g, struct boardobj **ppboardobj, - u16 size, void *pargs) + size_t size, void *pargs) { struct boardobj *ptmpobj = (struct boardobj *)pargs; struct clk_domain_35_master *pdomain; @@ -1588,7 +1588,7 @@ static int clk_domain_construct_35_master(struct gk20a *g, static int clk_domain_construct_3x_master(struct gk20a *g, struct boardobj **ppboardobj, - u16 size, void *pargs) + size_t size, void *pargs) { struct boardobj *ptmpobj = (struct boardobj *)pargs; struct clk_domain_3x_master *pdomain; @@ -1651,7 +1651,7 @@ static int _clk_domain_pmudatainit_3x_fixed(struct gk20a *g, static int clk_domain_construct_3x_fixed(struct gk20a *g, struct boardobj **ppboardobj, - u16 size, void *pargs) + size_t size, void *pargs) { struct boardobj *ptmpobj = (struct boardobj *)pargs; struct clk_domain_3x_fixed *pdomain;