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_prog.c where size_t values were being implicitly cast to u16.

JIRA NVGPU-1008

Change-Id: I39a257a056faf0f903363ed8d697efa88d74e75e
Signed-off-by: Philip Elcan <pelcan@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2001226
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: Alex Waterman <alexw@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Philip Elcan
2019-01-22 13:35:12 -05:00
committed by mobile promotions
parent 76acbc02bc
commit fea84c09fa

View File

@@ -945,13 +945,13 @@ done:
static int clk_prog_construct_super(struct gk20a *g,
struct boardobj **ppboardobj,
u16 size, void *pargs)
size_t size, void *pargs)
{
struct clk_prog *pclkprog;
int status = 0;
status = boardobj_construct_super(g, ppboardobj,
size, pargs);
(u16)size, pargs);
if (status != 0) {
return -EINVAL;
}
@@ -966,7 +966,7 @@ static int clk_prog_construct_super(struct gk20a *g,
static int clk_prog_construct_1x(struct gk20a *g,
struct boardobj **ppboardobj,
u16 size, void *pargs)
size_t size, void *pargs)
{
struct boardobj *ptmpobj = (struct boardobj *)pargs;
struct clk_prog_1x *pclkprog;
@@ -995,7 +995,7 @@ static int clk_prog_construct_1x(struct gk20a *g,
static int clk_prog_construct_35(struct gk20a *g,
struct boardobj **ppboardobj,
u16 size, void *pargs)
size_t size, void *pargs)
{
struct boardobj *ptmpobj = (struct boardobj *)pargs;
struct clk_prog_1x *pclkprog;
@@ -1024,7 +1024,7 @@ static int clk_prog_construct_35(struct gk20a *g,
static int clk_prog_construct_1x_master(struct gk20a *g,
struct boardobj **ppboardobj,
u16 size, void *pargs)
size_t size, void *pargs)
{
struct boardobj *ptmpobj = (struct boardobj *)pargs;
struct clk_prog_1x_master *pclkprog;
@@ -1082,7 +1082,7 @@ static int clk_prog_construct_1x_master(struct gk20a *g,
static int clk_prog_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_prog_35_master *pclkprog;
@@ -1121,7 +1121,7 @@ static int clk_prog_construct_35_master(struct gk20a *g,
static int clk_prog_construct_1x_master_ratio(struct gk20a *g,
struct boardobj **ppboardobj,
u16 size, void *pargs)
size_t size, void *pargs)
{
struct boardobj *ptmpobj = (struct boardobj *)pargs;
struct clk_prog_1x_master_ratio *pclkprog;
@@ -1164,7 +1164,7 @@ static int clk_prog_construct_1x_master_ratio(struct gk20a *g,
static int clk_prog_construct_35_master_ratio(struct gk20a *g,
struct boardobj **ppboardobj,
u16 size, void *pargs)
size_t size, void *pargs)
{
struct boardobj *ptmpobj = (struct boardobj *)pargs;
struct clk_prog_35_master_ratio *pclkprog;
@@ -1207,7 +1207,7 @@ static int clk_prog_construct_35_master_ratio(struct gk20a *g,
static int clk_prog_construct_1x_master_table(struct gk20a *g,
struct boardobj **ppboardobj,
u16 size, void *pargs)
size_t size, void *pargs)
{
struct boardobj *ptmpobj = (struct boardobj *)pargs;
struct clk_prog_1x_master_table *pclkprog;
@@ -1259,7 +1259,7 @@ exit:
static int clk_prog_construct_35_master_table(struct gk20a *g,
struct boardobj **ppboardobj,
u16 size, void *pargs)
size_t size, void *pargs)
{
struct boardobj *ptmpobj = (struct boardobj *)pargs;
struct clk_prog_35_master_table *pclkprog;