Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6ff4d010 authored by Matthias Beyer's avatar Matthias Beyer Committed by Greg Kroah-Hartman
Browse files

Staging: bcm: Qos.c: Replaced do-while(0) jumps with goto and label, removes...


Staging: bcm: Qos.c: Replaced do-while(0) jumps with goto and label, removes one level of indentation

Signed-off-by: default avatarMatthias Beyer <mail@beyermatthias.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent e6afae38
Loading
Loading
Loading
Loading
+57 −58
Original line number Diff line number Diff line
@@ -219,37 +219,36 @@ static USHORT IpVersion4(struct bcm_mini_adapter *Adapter,

	xprt_hdr = (struct bcm_transport_header *)((PUCHAR)iphd + sizeof(struct iphdr));

	do {
	BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, IPV4_DBG, DBG_LVL_ALL, "Trying to see Direction = %d %d",
		pstClassifierRule->ucDirection,
		pstClassifierRule->usVCID_Value);

	/* Checking classifier validity */
	if (!pstClassifierRule->bUsed || pstClassifierRule->ucDirection == DOWNLINK_DIR)
			break;
		goto out;

	BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, IPV4_DBG, DBG_LVL_ALL, "is IPv6 check!");
	if (pstClassifierRule->bIpv6Protocol)
			break;
		goto out;

	/* Checking IP header parameter */
	BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, IPV4_DBG, DBG_LVL_ALL, "Trying to match Source IP Address");
	if (!MatchSrcIpAddress(pstClassifierRule, iphd->saddr))
			break;
		goto out;
	BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, IPV4_DBG, DBG_LVL_ALL, "Source IP Address Matched");

	if (!MatchDestIpAddress(pstClassifierRule, iphd->daddr))
			break;
		goto out;
	BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, IPV4_DBG, DBG_LVL_ALL, "Destination IP Address Matched");

	if (!MatchTos(pstClassifierRule, iphd->tos)) {
		BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, IPV4_DBG, DBG_LVL_ALL, "TOS Match failed\n");
			break;
		goto out;
	}
	BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, IPV4_DBG, DBG_LVL_ALL, "TOS Matched");

	if (!MatchProtocol(pstClassifierRule, iphd->protocol))
			break;
		goto out;
	BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, IPV4_DBG, DBG_LVL_ALL, "Protocol Matched");

	/*
@@ -258,7 +257,7 @@ static USHORT IpVersion4(struct bcm_mini_adapter *Adapter,
	 */
	if (iphd->protocol != TCP && iphd->protocol != UDP) {
		bClassificationSucceed = TRUE;
			break;
		goto out;
	}
	/* Checking Transport Layer Header field if present */
	BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, IPV4_DBG, DBG_LVL_ALL, "Source Port %04x",
@@ -267,7 +266,7 @@ static USHORT IpVersion4(struct bcm_mini_adapter *Adapter,
	if (!MatchSrcPort(pstClassifierRule,
			  ntohs((iphd->protocol == UDP) ?
			  xprt_hdr->uhdr.source : xprt_hdr->thdr.source)))
			break;
		goto out;
	BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, IPV4_DBG, DBG_LVL_ALL, "Src Port Matched");

	BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, IPV4_DBG, DBG_LVL_ALL, "Destination Port %04x",
@@ -276,10 +275,10 @@ static USHORT IpVersion4(struct bcm_mini_adapter *Adapter,
	if (!MatchDestPort(pstClassifierRule,
			   ntohs((iphd->protocol == UDP) ?
			   xprt_hdr->uhdr.dest : xprt_hdr->thdr.dest)))
			break;
		goto out;
	bClassificationSucceed = TRUE;
	} while (0);

out:
	if (TRUE == bClassificationSucceed) {
		INT iMatchedSFQueueIndex = 0;