summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/common/xve
diff options
context:
space:
mode:
authorAmulya <Amurthyreddy@nvidia.com>2018-08-29 07:09:46 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2018-09-05 23:40:03 -0400
commitcf7850ee33a5a9ffc32f584c7c3beefe286ceed2 (patch)
treeeaa6af1806dd3242857d41efe427f0240d7e5310 /drivers/gpu/nvgpu/common/xve
parent2eface802a4aea417206bcdda689a65cf47d300b (diff)
nvgpu: common: MISRA 10.1 boolean fixes
Fix violations where a variable of type non-boolean is used as a boolean in gpu/nvgpu/common. JIRA NVGPU-646 Change-Id: I91baa5cf1d38081161336bde5fbc06661b741273 Signed-off-by: Amulya <Amurthyreddy@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1807133 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/common/xve')
-rw-r--r--drivers/gpu/nvgpu/common/xve/xve_gp106.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/gpu/nvgpu/common/xve/xve_gp106.c b/drivers/gpu/nvgpu/common/xve/xve_gp106.c
index 4f3def11..3ed02f1b 100644
--- a/drivers/gpu/nvgpu/common/xve/xve_gp106.c
+++ b/drivers/gpu/nvgpu/common/xve/xve_gp106.c
@@ -111,7 +111,7 @@ int xve_get_speed_gp106(struct gk20a *g, u32 *xve_link_speed)
111 if (link_speed == xve_link_control_status_link_speed_link_speed_8p0_v()) 111 if (link_speed == xve_link_control_status_link_speed_link_speed_8p0_v())
112 real_link_speed = GPU_XVE_SPEED_8P0; 112 real_link_speed = GPU_XVE_SPEED_8P0;
113 113
114 if (!real_link_speed) 114 if (real_link_speed == 0U)
115 return -ENODEV; 115 return -ENODEV;
116 116
117 *xve_link_speed = real_link_speed; 117 *xve_link_speed = real_link_speed;
@@ -147,7 +147,7 @@ static void set_xve_l0s_mask(struct gk20a *g, bool status)
147static void set_xve_l1_mask(struct gk20a *g, int status) 147static void set_xve_l1_mask(struct gk20a *g, int status)
148{ 148{
149 u32 xve_priv; 149 u32 xve_priv;
150 u32 status_bit = status ? 1 : 0; 150 u32 status_bit = (status != 0) ? 1 : 0;
151 151
152 xve_priv = g->ops.xve.xve_readl(g, xve_priv_xv_r()); 152 xve_priv = g->ops.xve.xve_readl(g, xve_priv_xv_r());
153 153
@@ -242,7 +242,7 @@ static int __do_xve_set_speed_gp106(struct gk20a *g, u32 next_link_speed)
242 (xp_pl_link_config_ltssm_directive_f(pl_link_config) == 242 (xp_pl_link_config_ltssm_directive_f(pl_link_config) ==
243 xp_pl_link_config_ltssm_directive_normal_operations_v())) 243 xp_pl_link_config_ltssm_directive_normal_operations_v()))
244 break; 244 break;
245 } while (!nvgpu_timeout_expired(&timeout)); 245 } while (nvgpu_timeout_expired(&timeout) == 0);
246 246
247 if (nvgpu_timeout_peek_expired(&timeout)) { 247 if (nvgpu_timeout_peek_expired(&timeout)) {
248 err_status = -ETIMEDOUT; 248 err_status = -ETIMEDOUT;
@@ -313,7 +313,7 @@ static int __do_xve_set_speed_gp106(struct gk20a *g, u32 next_link_speed)
313 if (pl_link_config == 313 if (pl_link_config ==
314 gk20a_readl(g, xp_pl_link_config_r(0))) 314 gk20a_readl(g, xp_pl_link_config_r(0)))
315 break; 315 break;
316 } while (!nvgpu_timeout_expired(&timeout)); 316 } while (nvgpu_timeout_expired(&timeout) == 0);
317 317
318 if (nvgpu_timeout_peek_expired(&timeout)) { 318 if (nvgpu_timeout_peek_expired(&timeout)) {
319 err_status = -ETIMEDOUT; 319 err_status = -ETIMEDOUT;
@@ -348,7 +348,7 @@ static int __do_xve_set_speed_gp106(struct gk20a *g, u32 next_link_speed)
348 (xp_pl_link_config_ltssm_directive_f(pl_link_config) == 348 (xp_pl_link_config_ltssm_directive_f(pl_link_config) ==
349 xp_pl_link_config_ltssm_directive_normal_operations_v())) 349 xp_pl_link_config_ltssm_directive_normal_operations_v()))
350 break; 350 break;
351 } while (!nvgpu_timeout_expired(&timeout)); 351 } while (nvgpu_timeout_expired(&timeout) == 0);
352 352
353 if (nvgpu_timeout_peek_expired(&timeout)) { 353 if (nvgpu_timeout_peek_expired(&timeout)) {
354 err_status = -ETIMEDOUT; 354 err_status = -ETIMEDOUT;