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/vbios/bios.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/gpu/nvgpu/common/vbios/bios.c') diff --git a/drivers/gpu/nvgpu/common/vbios/bios.c b/drivers/gpu/nvgpu/common/vbios/bios.c index fc82c2e9..4e851b39 100644 --- a/drivers/gpu/nvgpu/common/vbios/bios.c +++ b/drivers/gpu/nvgpu/common/vbios/bios.c @@ -291,7 +291,7 @@ int nvgpu_bios_parse_rom(struct gk20a *g) bool found = false; unsigned int i; - while (!last) { + while (last == 0) { struct pci_exp_rom *pci_rom; struct pci_data_struct *pci_data; struct pci_ext_data_struct *pci_ext_data; @@ -790,7 +790,7 @@ s8 nvgpu_bios_read_s8(struct gk20a *g, u32 offset) { u32 val; val = __nvgpu_bios_readbyte(g, offset); - val = val & 0x80U ? (val | ~0xffU) : val; + val = ((val & 0x80U) != 0U) ? (val | ~0xffU) : val; return (s8) val; } @@ -827,7 +827,7 @@ static void nvgpu_bios_init_xmemsel_zm_nv_reg_array(struct gk20a *g, bool *condi strap = gk20a_readl(g, gc6_sci_strap_r()) & 0xfU; - index = g->bios.mem_strap_xlat_tbl_ptr ? + index = (g->bios.mem_strap_xlat_tbl_ptr != 0U) ? nvgpu_bios_read_u8(g, g->bios.mem_strap_xlat_tbl_ptr + strap) : strap; -- cgit v1.2.2