ARM: iop13xx: Simplify iop13xx_atu{e,x}_pci_status checks
Subsystems (2)
PATCH 1/1 ARM: iop13xx: Simplify iop13xx_atu{e,x}_pci_status checks
clang warns:
arch/arm/mach-iop13xx/pci.c:292:7: warning: logical not is only applied to the left hand side of this comparison [-Wlogical-not-parentheses]
if (!iop13xx_atux_pci_status(1) == 0)
^ ~~
arch/arm/mach-iop13xx/pci.c:439:7: warning: logical not is only applied
to the left hand side of this comparison [-Wlogical-not-parentheses]
if (!iop13xx_atue_pci_status(1) == 0)
^ ~~!func() == 0 is equivalent to func(), which clears up this warning and makes the code more readable.
Reported-by Nick Desaulniers <[email protected]>
Signed-off-by Nathan Chancellor <[email protected]>
--- arch/arm/mach-iop13xx/pci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-iop13xx/pci.c +2 -2
@@ -289,7 +289,7 @@ iop13xx_atux_write_config(struct pci_bus *bus, unsigned int devfn, int where,if (size !=4 ) { val =iop13xx_atux_read (addr); -if (!iop13xx_atux_pci_status (1 ) ==0 ) +if (iop13xx_atux_pci_status (1 ))return PCIBIOS_SUCCESSFUL ; where = (where &3 ) *8 ;
@@ -436,7 +436,7 @@ iop13xx_atue_write_config(struct pci_bus *bus, unsigned int devfn, int where,if (size !=4 ) { val =iop13xx_atue_read (addr); -if (!iop13xx_atue_pci_status (1 ) ==0 ) +if (iop13xx_atue_pci_status (1 ))return PCIBIOS_SUCCESSFUL ; where = (where &3 ) *8 ;
Signature · 1 line
2.22.0
Quoted 12 lines · Nathan Chancellor
clang warns:
arch/arm/mach-iop13xx/pci.c:292:7: warning: logical not is only applied to the left hand side of this comparison [-Wlogical-not-parentheses]if (!iop13xx_atux_pci_status(1) == 0) ^ ~~ arch/arm/mach-iop13xx/pci.c:439:7: warning: logical not is only applied to the left hand side of this comparison [-Wlogical-not-parentheses] if (!iop13xx_atue_pci_status(1) == 0) ^ ~~
Quoted 2 lines
!func() == 0 is equivalent to
func(), which clears up this warning and makes the code more readable.
Yep, this is more concise, thanks for the patch.
Reviewed-by Nick Desaulniers <[email protected]>
please submit this to:
https://www.armlinux.org.uk/developer/patches/add.php
Quoted 33 lines
Reported-by Nick Desaulniers <[email protected]>Signed-off-by Nathan Chancellor <[email protected]>--- arch/arm/mach-iop13xx/pci.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)arch/arm/mach-iop13xx/pci.c +2
-3@@ -289,7 +289,7 @@ iop13xx_atux_write_config(struct pci_bus *bus, unsigned int devfn, int where,if (size !=4 ) { val =iop13xx_atux_read (addr); -if (!iop13xx_atux_pci_status (1 ) ==0 ) +if (iop13xx_atux_pci_status (1 ))return PCIBIOS_SUCCESSFUL ; where = (where &3 ) *8 ;@@ -436,7 +436,7 @@ iop13xx_atue_write_config(struct pci_bus *bus, unsigned int devfn, int where,if (size !=4 ) { val =iop13xx_atue_read (addr); -if (!iop13xx_atue_pci_status (1 ) ==0 ) +if (iop13xx_atue_pci_status (1 ))return PCIBIOS_SUCCESSFUL ; where = (where &3 ) *8 ; --2.22.0
Signature · 2 lines
Thanks, ~Nick Desaulniers