Staging: bcm: PHSModule.c: Reduced indentation level by using jump label

This change “Staging: bcm: PHSModule.c: Reduced indentation level by using jump label” (commit 525afdd) in Linux kernel is authored by Matthias Beyer <mail [at] beyermatthias.de> on Tue Jul 15 09:42:59 2014 +0200.

Description of "Staging: bcm: PHSModule.c: Reduced indentation level by using jump label"

The change “Staging: bcm: PHSModule.c: Reduced indentation level by using jump label” introduces changes as follows.

Staging: bcm: PHSModule.c: Reduced indentation level by using jump label

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

Linux kernel releases containing commit 525afdd

The Linux kernel releases containing this commit are as follows.

Linux kernel code changes from "Staging: bcm: PHSModule.c: Reduced indentation level by using jump label"

There are 65 lines of Linux source code added/deleted in this change. Code changes to Linux kernel are as follows.

 drivers/staging/bcm/PHSModule.c | 65 +++++++++++++++++----------------
 1 file changed, 34 insertions(+), 31 deletions(-)
 
diff --git a/drivers/staging/bcm/PHSModule.c b/drivers/staging/bcm/PHSModule.c
index 89cc90c4bfbe..a11474c51fa9 100644
--- a/drivers/staging/bcm/PHSModule.c
+++ b/drivers/staging/bcm/PHSModule.c
@@ -564,44 +564,47 @@ ULONG PhsDeleteClassifierRule(IN void *pvContext, IN B_UINT16 uiVcid, IN B_UINT1
 	struct bcm_phs_extension *pDeviceExtension =
 		(struct bcm_phs_extension *)pvContext;
 
-	if (pDeviceExtension) {
-		/* Retrieve the SFID Entry Index for requested Service Flow */
-		nSFIndex = GetServiceFlowEntry(pDeviceExtension->pstServiceFlowPhsRulesTable,
-					       uiVcid, &pstServiceFlowEntry);
-		if (nSFIndex == PHS_INVALID_TABLE_INDEX) {
-			BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, PHS_DISPATCH,
-					DBG_LVL_ALL, "SFID Match Failed\n");
-			return ERR_SF_MATCH_FAIL;
-		}
+	if (!pDeviceExtension)
+		goto out;
+
+	/* Retrieve the SFID Entry Index for requested Service Flow */
+	nSFIndex = GetServiceFlowEntry(pDeviceExtension->pstServiceFlowPhsRulesTable,
+				       uiVcid, &pstServiceFlowEntry);
+	if (nSFIndex == PHS_INVALID_TABLE_INDEX) {
+		BCM_DEBUG_PRINT(Adapter, DBG_TYPE_OTHERS, PHS_DISPATCH,
+				DBG_LVL_ALL, "SFID Match Failed\n");
+		return ERR_SF_MATCH_FAIL;
+	}
 
-		nClsidIndex = GetClassifierEntry(pstServiceFlowEntry->pstClassifierTable,
-						 uiClsId,
-						 eActiveClassifierRuleContext,
-						 &pstClassifierEntry);
+	nClsidIndex = GetClassifierEntry(pstServiceFlowEntry->pstClassifierTable,
+					 uiClsId,
+					 eActiveClassifierRuleContext,
+					 &pstClassifierEntry);
 
-		if ((nClsidIndex != PHS_INVALID_TABLE_INDEX) && (!pstClassifierEntry->bUnclassifiedPHSRule)) {
-			if (pstClassifierEntry->pstPhsRule) {
-				if (pstClassifierEntry->pstPhsRule->u8RefCnt)
-					pstClassifierEntry->pstPhsRule->u8RefCnt--;
+	if ((nClsidIndex != PHS_INVALID_TABLE_INDEX) && (!pstClassifierEntry->bUnclassifiedPHSRule)) {
+		if (pstClassifierEntry->pstPhsRule) {
+			if (pstClassifierEntry->pstPhsRule->u8RefCnt)
+				pstClassifierEntry->pstPhsRule->u8RefCnt--;
 
-				if (0 == pstClassifierEntry->pstPhsRule->u8RefCnt)
-					kfree(pstClassifierEntry->pstPhsRule);
-			}
-			memset(pstClassifierEntry, 0,
-			       sizeof(struct bcm_phs_classifier_entry));
+			if (0 == pstClassifierEntry->pstPhsRule->u8RefCnt)
+				kfree(pstClassifierEntry->pstPhsRule);
 		}
+		memset(pstClassifierEntry, 0,
+		       sizeof(struct bcm_phs_classifier_entry));
+	}
 
-		nClsidIndex = GetClassifierEntry(pstServiceFlowEntry->pstClassifierTable,
-						 uiClsId,
-						 eOldClassifierRuleContext,
-						 &pstClassifierEntry);
+	nClsidIndex = GetClassifierEntry(pstServiceFlowEntry->pstClassifierTable,
+					 uiClsId,
+					 eOldClassifierRuleContext,
+					 &pstClassifierEntry);
 
-		if ((nClsidIndex != PHS_INVALID_TABLE_INDEX) && (!pstClassifierEntry->bUnclassifiedPHSRule)) {
-			kfree(pstClassifierEntry->pstPhsRule);
-			memset(pstClassifierEntry, 0,
-			       sizeof(struct bcm_phs_classifier_entry));
-		}
+	if ((nClsidIndex != PHS_INVALID_TABLE_INDEX) && (!pstClassifierEntry->bUnclassifiedPHSRule)) {
+		kfree(pstClassifierEntry->pstPhsRule);
+		memset(pstClassifierEntry, 0,
+		       sizeof(struct bcm_phs_classifier_entry));
 	}
+
+out:
 	return 0;
 }
 

The commit for this change in Linux stable tree is 525afdd (patch).

Last modified: 2020/02/10