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 <srajum@nvidia.com>
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 <svcmobile_promotions@nvidia.com>
Reviewed-by: svc_kernel_abi <svc_kernel_abi@nvidia.com>
Reviewed-by: Vaibhav Kachore <vkachore@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
GVS: Gerrit_Virtual_Submit
This commit is contained in:
srajum
2021-05-06 15:21:59 +05:30
committed by mobile promotions
parent 096f4ef055
commit 573f02e68d
3 changed files with 7 additions and 7 deletions

View File

@@ -64,7 +64,7 @@ struct nvgpu_kmem_cache;
*/
#if 0
#define __NVGPU_SAVE_KALLOC_STACK_TRACES
#define NVGPU_SAVE_KALLOC_STACK_TRACES
#endif
/**

View File

@@ -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;

View File

@@ -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