From 9e69e0cf978b53706f55ffb873e3966b4bb3a7a8 Mon Sep 17 00:00:00 2001 From: Srirangan Date: Thu, 16 Aug 2018 11:33:55 +0530 Subject: 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 Reviewed-on: https://git-master.nvidia.com/r/1795845 Reviewed-by: Adeel Raza Reviewed-by: svc-misra-checker Reviewed-by: Terje Bergstrom GVS: Gerrit_Virtual_Submit Reviewed-by: Vijayakumar Subbu Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/common/enabled.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'drivers/gpu/nvgpu/common/enabled.c') 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 @@ /* - * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2017-18, 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"), @@ -34,8 +34,9 @@ int nvgpu_init_enabled_flags(struct gk20a *g) g->enabled_flags = nvgpu_kzalloc(g, BITS_TO_LONGS(NVGPU_MAX_ENABLED_BITS) * sizeof(unsigned long)); - if (!g->enabled_flags) + if (!g->enabled_flags) { return -ENOMEM; + } return 0; } @@ -55,8 +56,9 @@ bool nvgpu_is_enabled(struct gk20a *g, int flag) bool __nvgpu_set_enabled(struct gk20a *g, int flag, bool state) { - if (state) + if (state) { return test_and_set_bit(flag, g->enabled_flags); - else + } else { return test_and_clear_bit(flag, g->enabled_flags); + } } -- cgit v1.2.2