diff options
author | Amulya <Amurthyreddy@nvidia.com> | 2018-08-29 07:09:46 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2018-09-05 23:40:03 -0400 |
commit | cf7850ee33a5a9ffc32f584c7c3beefe286ceed2 (patch) | |
tree | eaa6af1806dd3242857d41efe427f0240d7e5310 /drivers/gpu/nvgpu/common/vbios/bios.c | |
parent | 2eface802a4aea417206bcdda689a65cf47d300b (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/vbios/bios.c')
-rw-r--r-- | drivers/gpu/nvgpu/common/vbios/bios.c | 6 |
1 files changed, 3 insertions, 3 deletions
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) | |||
291 | bool found = false; | 291 | bool found = false; |
292 | unsigned int i; | 292 | unsigned int i; |
293 | 293 | ||
294 | while (!last) { | 294 | while (last == 0) { |
295 | struct pci_exp_rom *pci_rom; | 295 | struct pci_exp_rom *pci_rom; |
296 | struct pci_data_struct *pci_data; | 296 | struct pci_data_struct *pci_data; |
297 | struct pci_ext_data_struct *pci_ext_data; | 297 | struct pci_ext_data_struct *pci_ext_data; |
@@ -790,7 +790,7 @@ s8 nvgpu_bios_read_s8(struct gk20a *g, u32 offset) | |||
790 | { | 790 | { |
791 | u32 val; | 791 | u32 val; |
792 | val = __nvgpu_bios_readbyte(g, offset); | 792 | val = __nvgpu_bios_readbyte(g, offset); |
793 | val = val & 0x80U ? (val | ~0xffU) : val; | 793 | val = ((val & 0x80U) != 0U) ? (val | ~0xffU) : val; |
794 | 794 | ||
795 | return (s8) val; | 795 | return (s8) val; |
796 | } | 796 | } |
@@ -827,7 +827,7 @@ static void nvgpu_bios_init_xmemsel_zm_nv_reg_array(struct gk20a *g, bool *condi | |||
827 | 827 | ||
828 | strap = gk20a_readl(g, gc6_sci_strap_r()) & 0xfU; | 828 | strap = gk20a_readl(g, gc6_sci_strap_r()) & 0xfU; |
829 | 829 | ||
830 | index = g->bios.mem_strap_xlat_tbl_ptr ? | 830 | index = (g->bios.mem_strap_xlat_tbl_ptr != 0U) ? |
831 | nvgpu_bios_read_u8(g, g->bios.mem_strap_xlat_tbl_ptr + | 831 | nvgpu_bios_read_u8(g, g->bios.mem_strap_xlat_tbl_ptr + |
832 | strap) : strap; | 832 | strap) : strap; |
833 | 833 | ||