diff mbox series

[RFC,21/35] atm: Fix Style ERROR- assignment in if condition

Message ID 20200713122247.10985-22-refactormyself@gmail.com
State New
Headers show
Series [RFC,01/35] xen-pciback: Change PCIBIOS_SUCCESSFUL to 0 | expand

Commit Message

Saheed O. Bolarinwa July 13, 2020, 12:22 p.m. UTC
Move assignment out of the if condition
Fix style issues in the for-loop

Signed-off-by: "Saheed O. Bolarinwa" <refactormyself@gmail.com>
---
This patch depends on PATCH 20/35

 drivers/atm/iphase.c | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/drivers/atm/iphase.c b/drivers/atm/iphase.c
index 2c75b82b4e7f..584d9be5fa73 100644
--- a/drivers/atm/iphase.c
+++ b/drivers/atm/iphase.c
@@ -2294,13 +2294,19 @@  static int reset_sar(struct atm_dev *dev)
 	unsigned int pci[64];  
 	  
 	iadev = INPH_IA_DEV(dev);  
-	for(i=0; i<64; i++)  
-		if ((error = pci_read_config_dword(iadev->pci, i*4, &pci[i])))
+	for (i = 0; i < 64; i++) {
+		error = pci_read_config_dword(iadev->pci, i*4, &pci[i]);
+		if (error)
 			return error;
+	}
+
 	writel(0, iadev->reg+IPHASE5575_EXT_RESET);  
-	for(i=0; i<64; i++)  
-		if ((error = pci_write_config_dword(iadev->pci, i*4, pci[i])))
+	for (i = 0; i < 64; i++) {
+		error = pci_write_config_dword(iadev->pci, i*4, pci[i]);
+		if (error)
 			return error;
+	}
+
 	udelay(5);  
 	return 0;  
 }