summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/common/enabled.c
diff options
context:
space:
mode:
authorNicolas Benech <nbenech@nvidia.com>2018-08-31 11:46:00 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2018-09-04 19:17:07 -0400
commit010cd8510b41ed154720e0c440e1ccdb6d86e239 (patch)
tree9d712789bc899faa7ed26b7b3a64feaefeff0225 /drivers/gpu/nvgpu/common/enabled.c
parent9e4bbd2c9b4d5d9712921a7db058061e4f8cd389 (diff)
gpu: nvgpu: Fix __nvgpu_set_enabled 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 changes the signature of __nvgpu_set_enabled to return void since the signature never implied it should return the final value of the flag. No code within NVGPU was using the return value anyway. JIRA NVGPU-677 Change-Id: Ib5d44d9a6a604a68c1f94b9475e9596eb14d1032 Signed-off-by: Nicolas Benech <nbenech@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1810717 Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com> Reviewed-by: Scott Long <scottl@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@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/enabled.c')
-rw-r--r--drivers/gpu/nvgpu/common/enabled.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/gpu/nvgpu/common/enabled.c b/drivers/gpu/nvgpu/common/enabled.c
index 00df9e3b..eaebe48c 100644
--- a/drivers/gpu/nvgpu/common/enabled.c
+++ b/drivers/gpu/nvgpu/common/enabled.c
@@ -54,11 +54,11 @@ bool nvgpu_is_enabled(struct gk20a *g, int flag)
54 return test_bit(flag, g->enabled_flags); 54 return test_bit(flag, g->enabled_flags);
55} 55}
56 56
57bool __nvgpu_set_enabled(struct gk20a *g, int flag, bool state) 57void __nvgpu_set_enabled(struct gk20a *g, int flag, bool state)
58{ 58{
59 if (state) { 59 if (state) {
60 return test_and_set_bit(flag, g->enabled_flags); 60 set_bit(flag, g->enabled_flags);
61 } else { 61 } else {
62 return test_and_clear_bit(flag, g->enabled_flags); 62 clear_bit(flag, g->enabled_flags);
63 } 63 }
64} 64}