summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/common/enabled.c
diff options
context:
space:
mode:
authorSrirangan <smadhavan@nvidia.com>2018-08-16 02:03:55 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2018-08-20 08:46:25 -0400
commit9e69e0cf978b53706f55ffb873e3966b4bb3a7a8 (patch)
tree2437cda373f2c37419e14b89772fb3c5f6d234e4 /drivers/gpu/nvgpu/common/enabled.c
parentde10cedf8caca9fd01f1b85031e538843da23252 (diff)
gpu: nvgpu: common: Fix MISRA 15.6 violations
MISRA Rule-15.6 requires that all if-else blocks be enclosed in braces, including single statement blocks. Fix errors due to single statement if blocks without braces, introducing the braces. JIRA NVGPU-671 Change-Id: I599cce2af1d6cdc24efefba4ec42abfe998aec47 Signed-off-by: Srirangan <smadhavan@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1795845 Reviewed-by: Adeel Raza <araza@nvidia.com> Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com> Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Vijayakumar Subbu <vsubbu@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.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/gpu/nvgpu/common/enabled.c b/drivers/gpu/nvgpu/common/enabled.c
index cded36c8..00df9e3b 100644
--- a/drivers/gpu/nvgpu/common/enabled.c
+++ b/drivers/gpu/nvgpu/common/enabled.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved. 2 * Copyright (c) 2017-18, 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"),
@@ -34,8 +34,9 @@ int nvgpu_init_enabled_flags(struct gk20a *g)
34 g->enabled_flags = nvgpu_kzalloc(g, 34 g->enabled_flags = nvgpu_kzalloc(g,
35 BITS_TO_LONGS(NVGPU_MAX_ENABLED_BITS) * 35 BITS_TO_LONGS(NVGPU_MAX_ENABLED_BITS) *
36 sizeof(unsigned long)); 36 sizeof(unsigned long));
37 if (!g->enabled_flags) 37 if (!g->enabled_flags) {
38 return -ENOMEM; 38 return -ENOMEM;
39 }
39 40
40 return 0; 41 return 0;
41} 42}
@@ -55,8 +56,9 @@ bool nvgpu_is_enabled(struct gk20a *g, int flag)
55 56
56bool __nvgpu_set_enabled(struct gk20a *g, int flag, bool state) 57bool __nvgpu_set_enabled(struct gk20a *g, int flag, bool state)
57{ 58{
58 if (state) 59 if (state) {
59 return test_and_set_bit(flag, g->enabled_flags); 60 return test_and_set_bit(flag, g->enabled_flags);
60 else 61 } else {
61 return test_and_clear_bit(flag, g->enabled_flags); 62 return test_and_clear_bit(flag, g->enabled_flags);
63 }
62} 64}