From fbbc5dacbf551deaa338ac4330dc39e27ea1ee15 Mon Sep 17 00:00:00 2001 From: TomAwezome Date: Tue, 25 Oct 2022 14:52:30 -0400 Subject: [PATCH] Fix PCI bit-test function unnecessary parens warnings. --- src/Kernel/PCI.ZC | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/Kernel/PCI.ZC b/src/Kernel/PCI.ZC index a9005fd7..8d7c5d87 100755 --- a/src/Kernel/PCI.ZC +++ b/src/Kernel/PCI.ZC @@ -131,29 +131,27 @@ Bool PCIBt(U8 reg RBX *bit_field, I64 reg RDX bit) { // MOV-based Bt for use in PCI device memory-mapped IO areas. See $LK+PU,"Bt()",A="FF:::/Kernel/KernelB.HH,Bt("$. bit_field += bit / 8; bit &= 7; - return (*bit_field & (1 << bit)) >> bit; + return (*bit_field & 1 << bit) >> bit; } Bool PCIBtr(U8 reg RDX *bit_field, I64 reg RBX bit) { // MOV-based Btr for use in PCI device memory-mapped IO areas. See $LK+PU,"Btr()",A="FF:::/Kernel/KernelB.HH,Btr("$. - U64 reg R9 chunk_mod = (bit & 31); - U64 chunk_bit = 1 << chunk_mod; + U64 reg R9 chunk_mod = bit & 31, chunk_bit = 1 << chunk_mod; bit_field(U32 *) += bit / 32; - Bool reg R8 result = (*(bit_field(U32 *)) & chunk_bit) >> chunk_mod; + Bool reg R8 result = (*bit_field(U32 *) & chunk_bit) >> chunk_mod; - *(bit_field(U32 *)) &= ~(chunk_bit); + *bit_field(U32 *) &= ~chunk_bit; return result; } Bool PCIBts(U8 reg RDX *bit_field, I64 reg RBX bit) { // MOV-based Bts for use in PCI device memory-mapped IO areas. See $LK+PU,"Bts()",A="FF:::/Kernel/KernelB.HH,Bts("$. - U64 reg R9 chunk_mod = (bit & 31); - U64 chunk_bit = 1 << chunk_mod; + U64 reg R9 chunk_mod = bit & 31, chunk_bit = 1 << chunk_mod; bit_field(U32 *) += bit / 32; - Bool reg R8 result = (*(bit_field(U32 *)) & chunk_bit) >> chunk_mod; + Bool reg R8 result = (*bit_field(U32 *) & chunk_bit) >> chunk_mod; - *(bit_field(U32 *)) |= chunk_bit; + *bit_field(U32 *) |= chunk_bit; return result; }