From 67179c661e608d528d346c107dfd30d3e29fece7 Mon Sep 17 00:00:00 2001 From: Scott Long Date: Sun, 29 Sep 2019 10:08:03 -0700 Subject: [PATCH] gpu: nvgpu: fix misra 4.4 violations This change eliminates the two instances of MISRA Advisory Rule 4.4 violations from nvgpu by moving the code in question within #if 0/#endif. Advisory Rule 4.4 states that sections of code should not be commented out. JIRA NVGPU-3798 Change-Id: Id7c501d2d9407a87af5db54c3590705f67ba1ba3 Signed-off-by: Scott Long Reviewed-on: https://git-master.nvidia.com/r/2208185 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Philip Elcan Reviewed-by: Alex Waterman GVS: Gerrit_Virtual_Submit Reviewed-by: Adeel Raza Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/include/nvgpu/allocator.h | 8 +++++++- drivers/gpu/nvgpu/include/nvgpu/kmem.h | 5 ++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/nvgpu/include/nvgpu/allocator.h b/drivers/gpu/nvgpu/include/nvgpu/allocator.h index 937a28cd8..5bceeac50 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/allocator.h +++ b/drivers/gpu/nvgpu/include/nvgpu/allocator.h @@ -38,7 +38,13 @@ #include #include -/* #define ALLOCATOR_DEBUG_FINE */ +/* + * Enable this flag to get finer control over allocator debug messaging + * (see below). + */ +#if 0 +#define ALLOCATOR_DEBUG_FINE +#endif struct nvgpu_allocator; struct nvgpu_alloc_carveout; diff --git a/drivers/gpu/nvgpu/include/nvgpu/kmem.h b/drivers/gpu/nvgpu/include/nvgpu/kmem.h index f8a956681..d83ad18e6 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/kmem.h +++ b/drivers/gpu/nvgpu/include/nvgpu/kmem.h @@ -67,7 +67,10 @@ struct nvgpu_kmem_cache; * Since this is a fairly high overhead operation and is only necessary for * debugging actual bugs it's left here for developers to enable. */ -/* #define __NVGPU_SAVE_KALLOC_STACK_TRACES */ + +#if 0 +#define __NVGPU_SAVE_KALLOC_STACK_TRACES +#endif /* * Defined per-OS.