From cf7850ee33a5a9ffc32f584c7c3beefe286ceed2 Mon Sep 17 00:00:00 2001 From: Amulya Date: Wed, 29 Aug 2018 16:39:46 +0530 Subject: 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 Reviewed-on: https://git-master.nvidia.com/r/1807133 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/common/xve/xve_gp106.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'drivers/gpu/nvgpu/common/xve') 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) if (link_speed == xve_link_control_status_link_speed_link_speed_8p0_v()) real_link_speed = GPU_XVE_SPEED_8P0; - if (!real_link_speed) + if (real_link_speed == 0U) return -ENODEV; *xve_link_speed = real_link_speed; @@ -147,7 +147,7 @@ static void set_xve_l0s_mask(struct gk20a *g, bool status) static void set_xve_l1_mask(struct gk20a *g, int status) { u32 xve_priv; - u32 status_bit = status ? 1 : 0; + u32 status_bit = (status != 0) ? 1 : 0; xve_priv = g->ops.xve.xve_readl(g, xve_priv_xv_r()); @@ -242,7 +242,7 @@ static int __do_xve_set_speed_gp106(struct gk20a *g, u32 next_link_speed) (xp_pl_link_config_ltssm_directive_f(pl_link_config) == xp_pl_link_config_ltssm_directive_normal_operations_v())) break; - } while (!nvgpu_timeout_expired(&timeout)); + } while (nvgpu_timeout_expired(&timeout) == 0); if (nvgpu_timeout_peek_expired(&timeout)) { err_status = -ETIMEDOUT; @@ -313,7 +313,7 @@ static int __do_xve_set_speed_gp106(struct gk20a *g, u32 next_link_speed) if (pl_link_config == gk20a_readl(g, xp_pl_link_config_r(0))) break; - } while (!nvgpu_timeout_expired(&timeout)); + } while (nvgpu_timeout_expired(&timeout) == 0); if (nvgpu_timeout_peek_expired(&timeout)) { err_status = -ETIMEDOUT; @@ -348,7 +348,7 @@ static int __do_xve_set_speed_gp106(struct gk20a *g, u32 next_link_speed) (xp_pl_link_config_ltssm_directive_f(pl_link_config) == xp_pl_link_config_ltssm_directive_normal_operations_v())) break; - } while (!nvgpu_timeout_expired(&timeout)); + } while (nvgpu_timeout_expired(&timeout) == 0); if (nvgpu_timeout_peek_expired(&timeout)) { err_status = -ETIMEDOUT; -- cgit v1.2.2