diff options
-rw-r--r-- | drivers/gpu/nvgpu/common/linux/log.c | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/drivers/gpu/nvgpu/common/linux/log.c b/drivers/gpu/nvgpu/common/linux/log.c index e120a3de..01d3add1 100644 --- a/drivers/gpu/nvgpu/common/linux/log.c +++ b/drivers/gpu/nvgpu/common/linux/log.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved. | 2 | * Copyright (c) 2017-2018, NVIDIA CORPORATION. All rights reserved. |
3 | * | 3 | * |
4 | * This program is free software; you can redistribute it and/or modify it | 4 | * This program is free software; you can redistribute it and/or modify it |
5 | * under the terms and conditions of the GNU General Public License, | 5 | * under the terms and conditions of the GNU General Public License, |
@@ -60,10 +60,8 @@ static inline const char *nvgpu_log_name(struct gk20a *g) | |||
60 | #ifdef CONFIG_GK20A_TRACE_PRINTK | 60 | #ifdef CONFIG_GK20A_TRACE_PRINTK |
61 | static void __nvgpu_trace_printk_log(u32 trace, const char *gpu_name, | 61 | static void __nvgpu_trace_printk_log(u32 trace, const char *gpu_name, |
62 | const char *func_name, int line, | 62 | const char *func_name, int line, |
63 | enum nvgpu_log_type type, const char *log) | 63 | const char *log_type, const char *log) |
64 | { | 64 | { |
65 | const char *log_type = log_types[type]; | ||
66 | |||
67 | trace_printk(LOG_FMT, gpu_name, func_name, line, log_type, log); | 65 | trace_printk(LOG_FMT, gpu_name, func_name, line, log_type, log); |
68 | } | 66 | } |
69 | #endif | 67 | #endif |
@@ -73,14 +71,13 @@ static void __nvgpu_really_print_log(u32 trace, const char *gpu_name, | |||
73 | enum nvgpu_log_type type, const char *log) | 71 | enum nvgpu_log_type type, const char *log) |
74 | { | 72 | { |
75 | const char *name = gpu_name ? gpu_name : ""; | 73 | const char *name = gpu_name ? gpu_name : ""; |
74 | const char *log_type = log_types[type]; | ||
76 | 75 | ||
77 | #ifdef CONFIG_GK20A_TRACE_PRINTK | 76 | #ifdef CONFIG_GK20A_TRACE_PRINTK |
78 | if (trace) | 77 | if (trace) |
79 | return __nvgpu_trace_printk_log(trace, name, func_name, | 78 | return __nvgpu_trace_printk_log(trace, name, func_name, |
80 | line, type, log); | 79 | line, log_type, log); |
81 | #else | 80 | #endif |
82 | const char *log_type = log_types[type]; | ||
83 | |||
84 | switch (type) { | 81 | switch (type) { |
85 | case NVGPU_DEBUG: | 82 | case NVGPU_DEBUG: |
86 | /* | 83 | /* |
@@ -100,7 +97,6 @@ static void __nvgpu_really_print_log(u32 trace, const char *gpu_name, | |||
100 | pr_err(LOG_FMT, name, func_name, line, log_type, log); | 97 | pr_err(LOG_FMT, name, func_name, line, log_type, log); |
101 | break; | 98 | break; |
102 | } | 99 | } |
103 | #endif | ||
104 | } | 100 | } |
105 | 101 | ||
106 | __attribute__((format (printf, 5, 6))) | 102 | __attribute__((format (printf, 5, 6))) |