diff --git a/drivers/gpu/nvgpu/common/nvs/nvs_sched.c b/drivers/gpu/nvgpu/common/nvs/nvs_sched.c index 960d0705e..188e67333 100644 --- a/drivers/gpu/nvgpu/common/nvs/nvs_sched.c +++ b/drivers/gpu/nvgpu/common/nvs/nvs_sched.c @@ -34,6 +34,9 @@ static struct nvs_sched_ops nvgpu_nvs_ops = { .recover = NULL, }; +#ifndef NSEC_PER_MSEC +#define NSEC_PER_MSEC 1000000U +#endif /* * TODO: make use of worker items when * 1) the active domain gets modified @@ -321,7 +324,7 @@ static void nvgpu_nvs_worker_wakeup_post_process(struct nvgpu_worker *worker) if (next_timeout_ns != 0U) { nvs_worker->current_timeout = - (next_timeout_ns + NSEC_PER_MSEC - 1) / NSEC_PER_MSEC; + (next_timeout_ns + NSEC_PER_MSEC - 1U) / NSEC_PER_MSEC; } nvgpu_timeout_init_cpu_timer_sw(g, &nvs_worker->timeout, diff --git a/drivers/gpu/nvgpu/include/external-nvs/impl.h b/drivers/gpu/nvgpu/include/external-nvs/impl.h index c821121a4..c8cd97f4e 100644 --- a/drivers/gpu/nvgpu/include/external-nvs/impl.h +++ b/drivers/gpu/nvgpu/include/external-nvs/impl.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 NVIDIA Corporation. All rights reserved. + * Copyright (c) 2021-2022 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"), @@ -42,7 +42,7 @@ #define nvs_log(sched, fmt, args...) \ nvgpu_log((struct gk20a *)(sched)->priv, \ - gpu_dbg_nvs_internal, (fmt), ##args) + gpu_dbg_nvs_internal, fmt, ##args) #endif