summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/common/priv_ring
diff options
context:
space:
mode:
authorSrirangan <smadhavan@nvidia.com>2018-08-23 02:49:48 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2018-08-27 10:52:22 -0400
commit385d3473e72c653906c82062eb2545abd7eeefe4 (patch)
tree82b51998c166623074f7f4c2e4415d128559cb86 /drivers/gpu/nvgpu/common/priv_ring
parent5c9bedf6f6e3213cd830d045d70f61de49f6e42b (diff)
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: I18cf871f2d1296b931d6ab43f1ac668551171dcc Signed-off-by: Srirangan <smadhavan@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1805076 Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com> Reviewed-by: Konsta Holtta <kholtta@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com> Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/common/priv_ring')
-rw-r--r--drivers/gpu/nvgpu/common/priv_ring/priv_ring_gp10b.c33
1 files changed, 22 insertions, 11 deletions
diff --git a/drivers/gpu/nvgpu/common/priv_ring/priv_ring_gp10b.c b/drivers/gpu/nvgpu/common/priv_ring/priv_ring_gp10b.c
index 04525375..53141c9a 100644
--- a/drivers/gpu/nvgpu/common/priv_ring/priv_ring_gp10b.c
+++ b/drivers/gpu/nvgpu/common/priv_ring/priv_ring_gp10b.c
@@ -75,24 +75,28 @@ void gp10b_priv_ring_decode_error_code(struct gk20a *g,
75 75
76 if (error_code == 0xBADF1000) { 76 if (error_code == 0xBADF1000) {
77 if (error_type_index < 77 if (error_type_index <
78 ARRAY_SIZE(error_type_badf1xyy)) 78 ARRAY_SIZE(error_type_badf1xyy)) {
79 nvgpu_err(g, "%s", 79 nvgpu_err(g, "%s",
80 error_type_badf1xyy[error_type_index]); 80 error_type_badf1xyy[error_type_index]);
81 }
81 } else if (error_code == 0xBADF2000) { 82 } else if (error_code == 0xBADF2000) {
82 if (error_type_index < 83 if (error_type_index <
83 ARRAY_SIZE(error_type_badf2xyy)) 84 ARRAY_SIZE(error_type_badf2xyy)) {
84 nvgpu_err(g, "%s", 85 nvgpu_err(g, "%s",
85 error_type_badf2xyy[error_type_index]); 86 error_type_badf2xyy[error_type_index]);
87 }
86 } else if (error_code == 0xBADF3000) { 88 } else if (error_code == 0xBADF3000) {
87 if (error_type_index < 89 if (error_type_index <
88 ARRAY_SIZE(error_type_badf3xyy)) 90 ARRAY_SIZE(error_type_badf3xyy)) {
89 nvgpu_err(g, "%s", 91 nvgpu_err(g, "%s",
90 error_type_badf3xyy[error_type_index]); 92 error_type_badf3xyy[error_type_index]);
93 }
91 } else if (error_code == 0xBADF5000) { 94 } else if (error_code == 0xBADF5000) {
92 if (error_type_index < 95 if (error_type_index <
93 ARRAY_SIZE(error_type_badf5xyy)) 96 ARRAY_SIZE(error_type_badf5xyy)) {
94 nvgpu_err(g, "%s", 97 nvgpu_err(g, "%s",
95 error_type_badf5xyy[error_type_index]); 98 error_type_badf5xyy[error_type_index]);
99 }
96 } 100 }
97} 101}
98 102
@@ -117,15 +121,18 @@ void gp10b_priv_ring_isr(struct gk20a *g)
117 nvgpu_err(g, "ringmaster intr status0: 0x%08x," 121 nvgpu_err(g, "ringmaster intr status0: 0x%08x,"
118 "status1: 0x%08x", status0, status1); 122 "status1: 0x%08x", status0, status1);
119 123
120 if (pri_ringmaster_intr_status0_ring_start_conn_fault_v(status0) != 0) 124 if (pri_ringmaster_intr_status0_ring_start_conn_fault_v(status0) != 0) {
121 nvgpu_err(g, 125 nvgpu_err(g,
122 "BUG: connectivity problem on the startup sequence"); 126 "BUG: connectivity problem on the startup sequence");
127 }
123 128
124 if (pri_ringmaster_intr_status0_disconnect_fault_v(status0) != 0) 129 if (pri_ringmaster_intr_status0_disconnect_fault_v(status0) != 0) {
125 nvgpu_err(g, "ring disconnected"); 130 nvgpu_err(g, "ring disconnected");
131 }
126 132
127 if (pri_ringmaster_intr_status0_overflow_fault_v(status0) != 0) 133 if (pri_ringmaster_intr_status0_overflow_fault_v(status0) != 0) {
128 nvgpu_err(g, "ring overflowed"); 134 nvgpu_err(g, "ring overflowed");
135 }
129 136
130 if (pri_ringmaster_intr_status0_gbl_write_error_sys_v(status0) != 0) { 137 if (pri_ringmaster_intr_status0_gbl_write_error_sys_v(status0) != 0) {
131 error_info = 138 error_info =
@@ -141,8 +148,9 @@ void gp10b_priv_ring_isr(struct gk20a *g)
141 pri_ringstation_sys_priv_error_info_subid_v(error_info), 148 pri_ringstation_sys_priv_error_info_subid_v(error_info),
142 pri_ringstation_sys_priv_error_info_priv_level_v(error_info), 149 pri_ringstation_sys_priv_error_info_priv_level_v(error_info),
143 error_code); 150 error_code);
144 if (g->ops.priv_ring.decode_error_code) 151 if (g->ops.priv_ring.decode_error_code) {
145 g->ops.priv_ring.decode_error_code(g, error_code); 152 g->ops.priv_ring.decode_error_code(g, error_code);
153 }
146 } 154 }
147 155
148 if (status1) { 156 if (status1) {
@@ -167,13 +175,15 @@ void gp10b_priv_ring_isr(struct gk20a *g)
167 pri_ringstation_gpc_gpc0_priv_error_info_priv_level_v(error_info), 175 pri_ringstation_gpc_gpc0_priv_error_info_priv_level_v(error_info),
168 error_code); 176 error_code);
169 177
170 if (g->ops.priv_ring.decode_error_code) 178 if (g->ops.priv_ring.decode_error_code) {
171 g->ops.priv_ring.decode_error_code(g, 179 g->ops.priv_ring.decode_error_code(g,
172 error_code); 180 error_code);
181 }
173 182
174 status1 = status1 & (~(BIT(gpc))); 183 status1 = status1 & (~(BIT(gpc)));
175 if (!status1) 184 if (!status1) {
176 break; 185 break;
186 }
177 } 187 }
178 } 188 }
179 } 189 }
@@ -193,6 +203,7 @@ void gp10b_priv_ring_isr(struct gk20a *g)
193 retry--; 203 retry--;
194 } 204 }
195 205
196 if (retry == 0) 206 if (retry == 0) {
197 nvgpu_err(g, "priv ringmaster intr ack failed"); 207 nvgpu_err(g, "priv ringmaster intr ack failed");
208 }
198} 209}