From bca54edb08d43653a0f1434fe5958f295dc2f43e Mon Sep 17 00:00:00 2001 From: Konsta Holtta Date: Wed, 16 Jan 2019 09:34:08 +0200 Subject: [PATCH] gpu: nvgpu: unit: use array for a lone tsg test_tsg_format_gen() uses a single tsg and passes its address on to be used as an array (of a single element). Reduce confusion by using a single-element tsg array already instead of a plain tsg. Coverity ID 8335811 Change-Id: I0135bcabeed12474beb9c52c9d186de1676b5423 Signed-off-by: Konsta Holtta Reviewed-on: https://git-master.nvidia.com/r/1996287 Reviewed-by: Deepak Nibade GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom Reviewed-by: mobile promotions Tested-by: mobile promotions --- userspace/units/fifo/runlist/nvgpu-runlist.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/userspace/units/fifo/runlist/nvgpu-runlist.c b/userspace/units/fifo/runlist/nvgpu-runlist.c index a82c0ffb9..3bb2921b7 100644 --- a/userspace/units/fifo/runlist/nvgpu-runlist.c +++ b/userspace/units/fifo/runlist/nvgpu-runlist.c @@ -160,7 +160,7 @@ static int test_tsg_format_gen(struct unit_module *m, struct gk20a *g, struct fifo_runlist_info_gk20a runlist; unsigned long active_tsgs_map = 0; unsigned long active_chs_map = 0; - struct tsg_gk20a tsg = {0}; + struct tsg_gk20a tsgs[1] = {{0}}; struct channel_gk20a chs[5] = {{0}}; /* header + at most five channels */ const u32 entries_in_list_max = 1 + 5; @@ -169,15 +169,15 @@ static int test_tsg_format_gen(struct unit_module *m, struct gk20a *g, struct tsg_fmt_test_args *test_args = args; (void)test_args->timeslice; - setup_fifo(g, &active_tsgs_map, &active_chs_map, &tsg, chs, 1, 5, + setup_fifo(g, &active_tsgs_map, &active_chs_map, tsgs, chs, 1, 5, &runlist, rl_data, false); active_chs_map = test_args->chs_bitmap; - tsg.timeslice_timeout = test_args->timeslice; - tsg.timeslice_scale = NVGPU_FIFO_DEFAULT_TIMESLICE_SCALE; + tsgs[0].timeslice_timeout = test_args->timeslice; + tsgs[0].timeslice_scale = NVGPU_FIFO_DEFAULT_TIMESLICE_SCALE; - ret = run_format_test(m, f, &tsg, chs, test_args->level, + ret = run_format_test(m, f, &tsgs[0], chs, test_args->level, test_args->channels, rl_data, test_args->expect_header, test_args->expect_channel); if (ret != 0) {