[PATCH 4/5] Staging: bcm: nvm.c: Removed indentation level by concatenating nested if statements

Matthias Beyer mail at beyermatthias.de
Sun Jul 20 13:14:12 UTC 2014


Signed-off-by: Matthias Beyer <mail at beyermatthias.de>
---
 drivers/staging/bcm/nvm.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/bcm/nvm.c b/drivers/staging/bcm/nvm.c
index edbd0f9..c38c803 100644
--- a/drivers/staging/bcm/nvm.c
+++ b/drivers/staging/bcm/nvm.c
@@ -1054,17 +1054,15 @@ static int bulk_read_complete_sector(struct bcm_mini_adapter *ad,
 
 		if (ad->ulFlashWriteSize == 1) {
 			for (j = 0; j < 16; j++) {
-				if (read_bk[j] != tmpbuff[i+j]) {
-					if (STATUS_SUCCESS != (*ad->fpFlashWriteWithStatusCheck)(ad, partoff + i + j, &tmpbuff[i+j])) {
-						return STATUS_FAILURE;
-					}
+				if ((read_bk[j] != tmpbuff[i+j]) &&
+				    (STATUS_SUCCESS != (*ad->fpFlashWriteWithStatusCheck)(ad, partoff + i + j, &tmpbuff[i+j]))) {
+					return STATUS_FAILURE;
 				}
 			}
 		} else {
-			if (memcmp(read_bk, &tmpbuff[i], MAX_RW_SIZE)) {
-				if (STATUS_SUCCESS != (*ad->fpFlashWriteWithStatusCheck)(ad, partoff + i, &tmpbuff[i])) {
-					return STATUS_FAILURE;
-				}
+			if ((memcmp(read_bk, &tmpbuff[i], MAX_RW_SIZE)) &&
+			    ((STATUS_SUCCESS != (*ad->fpFlashWriteWithStatusCheck)(ad, partoff + i, &tmpbuff[i])))) {
+				return STATUS_FAILURE;
 			}
 		}
 	}
-- 
2.0.2



More information about the devel mailing list