[PATCH 05/22] Staging: bcm: PHSModule.c: Replaced nested if statements with logical AND concatenation of the conditions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Signed-off-by: Matthias Beyer <mail@xxxxxxxxxxxxxxxx>
---
 drivers/staging/bcm/PHSModule.c | 20 ++++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/drivers/staging/bcm/PHSModule.c b/drivers/staging/bcm/PHSModule.c
index 55421ef..89cc90c 100644
--- a/drivers/staging/bcm/PHSModule.c
+++ b/drivers/staging/bcm/PHSModule.c
@@ -519,19 +519,19 @@ ULONG PhsDeletePHSRule(IN void *pvContext,
 		if (pstClassifierRulesTable) {
 			for (nClsidIndex = 0; nClsidIndex < MAX_PHSRULE_PER_SF; nClsidIndex++) {
 				curr_entry = &pstClassifierRulesTable->stActivePhsRulesList[nClsidIndex];
-				if (curr_entry->bUsed && curr_entry->pstPhsRule) {
-					if (curr_entry->pstPhsRule->u8PHSI == u8PHSI) {
+				if (curr_entry->bUsed &&
+				    curr_entry->pstPhsRule &&
+				    (curr_entry->pstPhsRule->u8PHSI == u8PHSI)) {
 
-						if (curr_entry->pstPhsRule->u8RefCnt)
-							curr_entry->pstPhsRule->u8RefCnt--;
+					if (curr_entry->pstPhsRule->u8RefCnt)
+						curr_entry->pstPhsRule->u8RefCnt--;
 
-						if (0 == curr_entry->pstPhsRule->u8RefCnt)
-							kfree(curr_entry->pstPhsRule);
+					if (0 == curr_entry->pstPhsRule->u8RefCnt)
+						kfree(curr_entry->pstPhsRule);
 
-						memset(curr_entry,
-						       0,
-						       sizeof(struct bcm_phs_classifier_entry));
-					}
+					memset(curr_entry,
+					       0,
+					       sizeof(struct bcm_phs_classifier_entry));
 				}
 			}
 		}
-- 
2.0.1

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel




[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux