mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-22 17:36:20 +03:00
gpu: nvgpu: make nvgpu_init_mutex return void
Make the nvgpu_init_mutex function return void. In linux case, this doesn't affect anything since mutex_init returns void. For posix, we assert() and die if pthread_mutex_init fails. This alleviates the need to error inject for _every_ nvgpu_mutex_init function in the driver. Jira NVGPU-3476 Change-Id: Ibc801116dc82cdfcedcba2c352785f2640b7d54f Signed-off-by: Thomas Fleury <tfleury@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/2130538 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
c74b89194d
commit
97762279b7
@@ -54,12 +54,8 @@ static int test_mutex_init(struct unit_module *m, struct gk20a *g,
|
||||
void *args)
|
||||
{
|
||||
struct nvgpu_mutex mutex;
|
||||
int err = nvgpu_mutex_init(&mutex);
|
||||
|
||||
if (err != 0) {
|
||||
unit_return_fail(m, "mutex_init failure: %d\n", err);
|
||||
}
|
||||
|
||||
nvgpu_mutex_init(&mutex);
|
||||
nvgpu_mutex_destroy(&mutex);
|
||||
|
||||
return UNIT_SUCCESS;
|
||||
@@ -74,9 +70,7 @@ static int test_mutex_tryacquire(struct unit_module *m, struct gk20a *g,
|
||||
struct nvgpu_mutex mutex;
|
||||
int status;
|
||||
|
||||
if (nvgpu_mutex_init(&mutex) != 0) {
|
||||
unit_return_fail(m, "mutex_init failure\n");
|
||||
}
|
||||
nvgpu_mutex_init(&mutex);
|
||||
|
||||
nvgpu_mutex_acquire(&mutex);
|
||||
|
||||
@@ -175,9 +169,7 @@ static int test_lock_acquire_release(struct unit_module *m, struct gk20a *g,
|
||||
|
||||
switch (type) {
|
||||
case TYPE_MUTEX:
|
||||
if (nvgpu_mutex_init(&mutex) != 0) {
|
||||
unit_return_fail(m, "mutex_init failure\n");
|
||||
}
|
||||
nvgpu_mutex_init(&mutex);
|
||||
worker_params.mutex = &mutex;
|
||||
break;
|
||||
case TYPE_SPINLOCK:
|
||||
|
||||
Reference in New Issue
Block a user