[Linux-kernel-mentees] [RFC PATCH 21/35] atm: Fix Style ERROR- assignment in if condition

Saheed O. Bolarinwa refactormyself at gmail.com
Mon Jul 13 12:22:33 UTC 2020


Move assignment out of the if condition
Fix style issues in the for-loop

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

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

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;  
 }  
-- 
2.18.2



More information about the Linux-kernel-mentees mailing list