Skip to contentSkip to conversation

mips/pci: remove redundant ret variable

PATCH Applied [email protected] 2 participants 2 messages Jan 4, 2022 – Jan 5, 2022 MIPS

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mips/pci: remove redundant ret variable

From: Minghao Chi <[email protected]>

Return value from rt3883_pci_r32() directly instead of taking this in another redundant variable.

---
 arch/mips/pci/pci-rt3883.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
arch/mips/pci/pci-rt3883.c +1 -3
index d3c947fa2969..e07ae098bdd8 100644
@@ -102,14 +102,12 @@ static u32 rt3883_pci_read_cfg32(struct rt3883_pci_controller *rpc,
 			       unsigned func, unsigned reg)
 {
 	u32 address;
-	u32 ret;
 
 	address = rt3883_pci_get_cfgaddr(bus, slot, func, reg);
 
 	rt3883_pci_w32(rpc, address, RT3883_PCI_REG_CFGADDR);
-	ret = rt3883_pci_r32(rpc, RT3883_PCI_REG_CFGDATA);
 
-	return ret;
+	return rt3883_pci_r32(rpc, RT3883_PCI_REG_CFGDATA);
 }
 
 static void rt3883_pci_write_cfg32(struct rt3883_pci_controller *rpc,
Signature · 1 line
2.25.1
maintainer Applied
#1 lore raw
Quoted 34 lines · On Tue, Jan 04, 2022 at 11:20:24AM +0000, [email protected] wrote:

From: Minghao Chi <[email protected]>

Return value from rt3883_pci_r32() directly instead of taking this in another redundant variable.

---
 arch/mips/pci/pci-rt3883.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
arch/mips/pci/pci-rt3883.c +1 -3
index d3c947fa2969..e07ae098bdd8 100644
@@ -102,14 +102,12 @@ static u32 rt3883_pci_read_cfg32(struct rt3883_pci_controller *rpc,
 			       unsigned func, unsigned reg)
 {
 	u32 address;
-	u32 ret;
 
 	address = rt3883_pci_get_cfgaddr(bus, slot, func, reg);
 
 	rt3883_pci_w32(rpc, address, RT3883_PCI_REG_CFGADDR);
-	ret = rt3883_pci_r32(rpc, RT3883_PCI_REG_CFGDATA);
 
-	return ret;
+	return rt3883_pci_r32(rpc, RT3883_PCI_REG_CFGDATA);
 }
 
 static void rt3883_pci_write_cfg32(struct rt3883_pci_controller *rpc,
Signature · 1 line
2.25.1

applied to mips-next.

Thomas.

Signature · 2 lines
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea.                                                [ RFC1925, 2.3 ]