From 573f02e68d618b110b86084bdea2c58a29a921ed Mon Sep 17 00:00:00 2001 From: srajum Date: Thu, 6 May 2021 15:21:59 +0530 Subject: [PATCH] gpu: nvgpu: Fixing MISRA 21.1 violation. - "misra_c_2012_rule_21_1_violation" Defining or undefining a reserved name "__NVGPU_SAVE_KALLOC_STACK_TRACES", which is an identifier or macro name beginning with an underscore. Change-Id: If89ce68fb6dc76e5ffcdd2dc436dddcbe9ba96ee Signed-off-by: srajum Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2525631 (cherry picked from commit a84c9e0d6987b22e24d777c5ac632c4072cbbb58) Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2526776 Tested-by: mobile promotions Reviewed-by: svc_kernel_abi Reviewed-by: Vaibhav Kachore Reviewed-by: mobile promotions GVS: Gerrit_Virtual_Submit --- drivers/gpu/nvgpu/include/nvgpu/kmem.h | 2 +- drivers/gpu/nvgpu/os/linux/kmem.c | 8 ++++---- drivers/gpu/nvgpu/os/linux/kmem_priv.h | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/nvgpu/include/nvgpu/kmem.h b/drivers/gpu/nvgpu/include/nvgpu/kmem.h index d811d6ddb..f13c912d1 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/kmem.h +++ b/drivers/gpu/nvgpu/include/nvgpu/kmem.h @@ -64,7 +64,7 @@ struct nvgpu_kmem_cache; */ #if 0 -#define __NVGPU_SAVE_KALLOC_STACK_TRACES +#define NVGPU_SAVE_KALLOC_STACK_TRACES #endif /** diff --git a/drivers/gpu/nvgpu/os/linux/kmem.c b/drivers/gpu/nvgpu/os/linux/kmem.c index 28657535d..75b09b250 100644 --- a/drivers/gpu/nvgpu/os/linux/kmem.c +++ b/drivers/gpu/nvgpu/os/linux/kmem.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2020, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2017-2021, NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -182,7 +182,7 @@ void kmem_print_mem_alloc(struct gk20a *g, struct nvgpu_mem_alloc *alloc, struct seq_file *s) { -#ifdef __NVGPU_SAVE_KALLOC_STACK_TRACES +#ifdef NVGPU_SAVE_KALLOC_STACK_TRACES int i; __pstat(s, "nvgpu-alloc: addr=0x%llx size=%ld\n", @@ -231,7 +231,7 @@ static int __nvgpu_save_kmem_alloc(struct nvgpu_mem_alloc_tracker *tracker, { int ret; struct nvgpu_mem_alloc *alloc; -#ifdef __NVGPU_SAVE_KALLOC_STACK_TRACES +#ifdef NVGPU_SAVE_KALLOC_STACK_TRACES struct stack_trace stack_trace; #endif @@ -245,7 +245,7 @@ static int __nvgpu_save_kmem_alloc(struct nvgpu_mem_alloc_tracker *tracker, alloc->addr = addr; alloc->ip = ip; -#ifdef __NVGPU_SAVE_KALLOC_STACK_TRACES +#ifdef NVGPU_SAVE_KALLOC_STACK_TRACES stack_trace.max_entries = MAX_STACK_TRACE; stack_trace.nr_entries = 0; stack_trace.entries = alloc->stack; diff --git a/drivers/gpu/nvgpu/os/linux/kmem_priv.h b/drivers/gpu/nvgpu/os/linux/kmem_priv.h index 6f7a60f16..3d7c37ff1 100644 --- a/drivers/gpu/nvgpu/os/linux/kmem_priv.h +++ b/drivers/gpu/nvgpu/os/linux/kmem_priv.h @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017-2018, NVIDIA CORPORATION. All rights reserved. + * Copyright (c) 2017-2021, NVIDIA CORPORATION. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, @@ -54,7 +54,7 @@ struct nvgpu_mem_alloc { struct nvgpu_mem_alloc_tracker *owner; void *ip; -#ifdef __NVGPU_SAVE_KALLOC_STACK_TRACES +#ifdef NVGPU_SAVE_KALLOC_STACK_TRACES unsigned long stack[MAX_STACK_TRACE]; int stack_length; #endif