mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-24 02:22:34 +03:00
gpu: nvgpu: simplify nvgpu_timeout_init
nvgpu_timeout_init() returns an error code only when the flags parameter is invalid. There are very few possible values for flags, so extract the two most common cases - cpu clock based and a retry based timeout - to functions that cannot fail and thus return nothing. Adjust all callers to use those, simplfying error handling quite a bit. Change-Id: I985fe7fa988ebbae25601d15cf57fd48eda0c677 Signed-off-by: Konsta Hölttä <kholtta@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2613833 Tested-by: mobile promotions <svcmobile_promotions@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
9b3f3ea4be
commit
f4ec400d5f
@@ -936,8 +936,7 @@ __acquires(&cde_app->mutex)
|
||||
struct gk20a_cde_ctx *cde_ctx = NULL;
|
||||
struct nvgpu_timeout timeout;
|
||||
|
||||
nvgpu_timeout_init(g, &timeout, MAX_CTX_RETRY_TIME,
|
||||
NVGPU_TIMER_CPU_TIMER);
|
||||
nvgpu_timeout_init_cpu_timer(g, &timeout, MAX_CTX_RETRY_TIME);
|
||||
|
||||
do {
|
||||
cde_ctx = gk20a_cde_do_get_context(l);
|
||||
|
||||
Reference in New Issue
Block a user