diff options
author | Nicolas Benech <nbenech@nvidia.com> | 2018-08-23 16:23:52 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2018-09-05 23:39:08 -0400 |
commit | 2eface802a4aea417206bcdda689a65cf47d300b (patch) | |
tree | 502af9d48004af4edf8f02a2a7cf751ef5a11325 /drivers/gpu/nvgpu/common/mm/comptags.c | |
parent | b44c7fdb114a63ab98fffc0f246776b56399ff64 (diff) |
gpu: nvgpu: Fix mutex MISRA 17.7 violations
MISRA Rule-17.7 requires the return value of all functions to be used.
Fix is either to use the return value or change the function to return
void. This patch contains fix for calls to nvgpu_mutex_init and
improves related error handling.
JIRA NVGPU-677
Change-Id: I609fa138520cc7ccfdd5aa0e7fd28c8ca0b3a21c
Signed-off-by: Nicolas Benech <nbenech@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1805598
Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com>
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>
Diffstat (limited to 'drivers/gpu/nvgpu/common/mm/comptags.c')
-rw-r--r-- | drivers/gpu/nvgpu/common/mm/comptags.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/common/mm/comptags.c b/drivers/gpu/nvgpu/common/mm/comptags.c index e6c99702..334236ec 100644 --- a/drivers/gpu/nvgpu/common/mm/comptags.c +++ b/drivers/gpu/nvgpu/common/mm/comptags.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved. | 2 | * Copyright (c) 2017-2018, NVIDIA CORPORATION. All rights reserved. |
3 | * | 3 | * |
4 | * Permission is hereby granted, free of charge, to any person obtaining a | 4 | * Permission is hereby granted, free of charge, to any person obtaining a |
5 | * copy of this software and associated documentation files (the "Software"), | 5 | * copy of this software and associated documentation files (the "Software"), |
@@ -66,7 +66,12 @@ int gk20a_comptag_allocator_init(struct gk20a *g, | |||
66 | struct gk20a_comptag_allocator *allocator, | 66 | struct gk20a_comptag_allocator *allocator, |
67 | unsigned long size) | 67 | unsigned long size) |
68 | { | 68 | { |
69 | nvgpu_mutex_init(&allocator->lock); | 69 | int err = nvgpu_mutex_init(&allocator->lock); |
70 | |||
71 | if (err != 0) { | ||
72 | nvgpu_err(g, "Error in allocator.lock mutex initialization"); | ||
73 | return err; | ||
74 | } | ||
70 | 75 | ||
71 | /* | 76 | /* |
72 | * 0th comptag is special and is never used. The base for this bitmap | 77 | * 0th comptag is special and is never used. The base for this bitmap |