2020-07-13 13:24:49

by Saheed O. Bolarinwa

[permalink] [raw]
Subject: [RFC PATCH 29/35] mips: Tidy Success/Failure checks

Remove unnecessary check for 0.

Signed-off-by: "Saheed O. Bolarinwa" <[email protected]>
---
This patch depends on PATCH 28/35

arch/mips/pci/ops-bcm63xx.c | 2 +-
arch/mips/pci/pci-ar2315.c | 5 ++---
arch/mips/txx9/generic/pci.c | 3 +--
3 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/arch/mips/pci/ops-bcm63xx.c b/arch/mips/pci/ops-bcm63xx.c
index 3e88e4869f37..f2810af4fa24 100644
--- a/arch/mips/pci/ops-bcm63xx.c
+++ b/arch/mips/pci/ops-bcm63xx.c
@@ -295,7 +295,7 @@ static int fake_cb_bridge_write(int where, int size, u32 val)
int ret;

ret = fake_cb_bridge_read((where & ~0x3), 4, &data);
- if (ret != 0)
+ if (ret)
return ret;

data = preprocess_write(data, val, where, size);
diff --git a/arch/mips/pci/pci-ar2315.c b/arch/mips/pci/pci-ar2315.c
index 2268b63d20e8..c2b9e62fbc18 100644
--- a/arch/mips/pci/pci-ar2315.c
+++ b/arch/mips/pci/pci-ar2315.c
@@ -259,8 +259,7 @@ static int ar2315_pci_cfg_access(struct ar2315_pci_ctrl *apc, unsigned devfn,
ar2315_pci_reg_mask(apc, AR2315_PCI_MISC_CONFIG, AR2315_PCIMISC_CFG_SEL,
0);

- return isr & AR2315_PCI_INT_ABORT ? PCIBIOS_DEVICE_NOT_FOUND :
- 0;
+ return isr & AR2315_PCI_INT_ABORT ? PCIBIOS_DEVICE_NOT_FOUND : 0;
}

static inline int ar2315_pci_local_cfg_rd(struct ar2315_pci_ctrl *apc,
@@ -311,7 +310,7 @@ static int ar2315_pci_host_setup(struct ar2315_pci_ctrl *apc)
u32 id;

res = ar2315_pci_local_cfg_rd(apc, devfn, PCI_VENDOR_ID, &id);
- if (res != 0 || id != AR2315_PCI_HOST_DEVID)
+ if (res || id != AR2315_PCI_HOST_DEVID)
return -ENODEV;

/* Program MBARs */
diff --git a/arch/mips/txx9/generic/pci.c b/arch/mips/txx9/generic/pci.c
index bdff45b6b57d..9da38f8fa036 100644
--- a/arch/mips/txx9/generic/pci.c
+++ b/arch/mips/txx9/generic/pci.c
@@ -61,8 +61,7 @@ int __init txx9_pci66_check(struct pci_controller *hose, int top_bus,
if (PCI_FUNC(pci_devfn))
continue;
if (early_read_config_word(hose, top_bus, current_bus,
- pci_devfn, PCI_VENDOR_ID, &vid) !=
- 0)
+ pci_devfn, PCI_VENDOR_ID, &vid))
continue;
if (vid == 0xffff)
continue;
--
2.18.2