gpu: nvgpu: unit: fifo: move assert to unit_assert

unit_assert macro is provided to check a condition and execute bail_out
action given as a second argument.
Currently, in fifo unit, unit_assert() is redefined as assert with
common bail_out action. However, name assert() creates confusion with
linux assert macro. So, this patch removes redefined assert macro and
replaces with unit_assert.

Jira NVGPU-4684

Change-Id: I3a880f965a191f16efdabced5e23723e66ecaf3c
Signed-off-by: Vedashree Vidwans <vvidwans@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2276863
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:
Vedashree Vidwans
2020-01-09 14:46:19 -08:00
committed by Alex Waterman
parent 4a287f08cd
commit 652cff2cd0
32 changed files with 795 additions and 710 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2019, NVIDIA CORPORATION. All rights reserved.
* Copyright (c) 2019-2020, 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"),
@@ -53,7 +53,6 @@
} while (0)
#endif
#define assert(cond) unit_assert(cond, goto done)
#define branches_str test_fifo_flags_str
int test_gv11b_usermode(struct unit_module *m,
@@ -70,21 +69,22 @@ int test_gv11b_usermode(struct unit_module *m,
u32 token;
u32 val;
assert(base == usermode_cfg0_r());
assert(bus_base == usermode_cfg0_r());
unit_assert(base == usermode_cfg0_r(), goto done);
unit_assert(bus_base == usermode_cfg0_r(), goto done);
ch = nvgpu_channel_open_new(g, runlist_id,
privileged, getpid(), getpid());
assert(ch != NULL);
unit_assert(ch != NULL, goto done);
hw_chid = f->channel_base + ch->chid;
token = gv11b_usermode_doorbell_token(ch);
assert(token == usermode_notify_channel_pending_id_f(hw_chid));
unit_assert(token == usermode_notify_channel_pending_id_f(hw_chid),
goto done);
nvgpu_usermode_writel(g, usermode_notify_channel_pending_r(), 0);
gv11b_usermode_ring_doorbell(ch);
val = nvgpu_readl(g, usermode_notify_channel_pending_r());
assert(val == token);
unit_assert(val == token, goto done);
ret = UNIT_SUCCESS;
done: