aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthias Beyer <mail@beyermatthias.de>2014-07-29 10:52:18 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2014-07-30 20:14:22 -0400
commitb8ab70b046a9baf02f5e02412c265578b1b24953 (patch)
treed574e41452ec659460f7bd14d8513621f206738d
parent81797eaf798ca6e2dd62c636de43739289515917 (diff)
Staging: bcm: Qos.c: Replaced do-while(0) breaks with continue
This patch replaces the do-while(0); loop which is used for breaking if a check fails by using the `continue` statement. This saves one indentation level. Signed-off-by: Matthias Beyer <mail@beyermatthias.de> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--drivers/staging/bcm/Qos.c95
1 files changed, 46 insertions, 49 deletions
diff --git a/drivers/staging/bcm/Qos.c b/drivers/staging/bcm/Qos.c
index e59abe42cf94..2cc87b576415 100644
--- a/drivers/staging/bcm/Qos.c
+++ b/drivers/staging/bcm/Qos.c
@@ -501,70 +501,67 @@ USHORT ClassifyPacket(struct bcm_mini_adapter *Adapter, struct sk_buff *skb)
501 * Iterate through all classifiers which are already in order of priority 501 * Iterate through all classifiers which are already in order of priority
502 * to classify the packet until match found 502 * to classify the packet until match found
503 */ 503 */
504 do { 504 if (false == Adapter->astClassifierTable[uiLoopIndex].bUsed) {
505 if (false == Adapter->astClassifierTable[uiLoopIndex].bUsed) { 505 bClassificationSucceed = false;
506 bClassificationSucceed = false; 506 continue;
507 break; 507 }
508 } 508 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, IPV4_DBG, DBG_LVL_ALL, "Adapter->PackInfo[%d].bvalid=True\n", uiLoopIndex);
509 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, IPV4_DBG, DBG_LVL_ALL, "Adapter->PackInfo[%d].bvalid=True\n", uiLoopIndex);
510 509
511 if (0 == Adapter->astClassifierTable[uiLoopIndex].ucDirection) { 510 if (0 == Adapter->astClassifierTable[uiLoopIndex].ucDirection) {
512 bClassificationSucceed = false; /* cannot be processed for classification. */ 511 bClassificationSucceed = false; /* cannot be processed for classification. */
513 break; /* it is a down link connection */ 512 continue; /* it is a down link connection */
514 } 513 }
515 514
516 pstClassifierRule = &Adapter->astClassifierTable[uiLoopIndex]; 515 pstClassifierRule = &Adapter->astClassifierTable[uiLoopIndex];
517 516
518 uiSfIndex = SearchSfid(Adapter, pstClassifierRule->ulSFID); 517 uiSfIndex = SearchSfid(Adapter, pstClassifierRule->ulSFID);
519 if (uiSfIndex >= NO_OF_QUEUES) { 518 if (uiSfIndex >= NO_OF_QUEUES) {
520 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, IPV4_DBG, DBG_LVL_ALL, "Queue Not Valid. SearchSfid for this classifier Failed\n"); 519 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, IPV4_DBG, DBG_LVL_ALL, "Queue Not Valid. SearchSfid for this classifier Failed\n");
521 break; 520 continue;
522 } 521 }
523 522
524 if (Adapter->PackInfo[uiSfIndex].bEthCSSupport) { 523 if (Adapter->PackInfo[uiSfIndex].bEthCSSupport) {
525 524
526 if (eEthUnsupportedFrame == stEthCsPktInfo.eNwpktEthFrameType) { 525 if (eEthUnsupportedFrame == stEthCsPktInfo.eNwpktEthFrameType) {
527 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, IPV4_DBG, DBG_LVL_ALL, " ClassifyPacket : Packet Not a Valid Supported Ethernet Frame\n"); 526 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, IPV4_DBG, DBG_LVL_ALL, " ClassifyPacket : Packet Not a Valid Supported Ethernet Frame\n");
528 bClassificationSucceed = false; 527 bClassificationSucceed = false;
529 break; 528 continue;
530 } 529 }
531 530
532 531
533 532
534 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, IPV4_DBG, DBG_LVL_ALL, "Performing ETH CS Classification on Classifier Rule ID : %x Service Flow ID : %lx\n", pstClassifierRule->uiClassifierRuleIndex, Adapter->PackInfo[uiSfIndex].ulSFID); 533 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, IPV4_DBG, DBG_LVL_ALL, "Performing ETH CS Classification on Classifier Rule ID : %x Service Flow ID : %lx\n", pstClassifierRule->uiClassifierRuleIndex, Adapter->PackInfo[uiSfIndex].ulSFID);
535 bClassificationSucceed = EThCSClassifyPkt(Adapter, skb, &stEthCsPktInfo, pstClassifierRule, Adapter->PackInfo[uiSfIndex].bEthCSSupport); 534 bClassificationSucceed = EThCSClassifyPkt(Adapter, skb, &stEthCsPktInfo, pstClassifierRule, Adapter->PackInfo[uiSfIndex].bEthCSSupport);
536 535
537 if (!bClassificationSucceed) { 536 if (!bClassificationSucceed) {
538 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, IPV4_DBG, DBG_LVL_ALL, "ClassifyPacket : Ethernet CS Classification Failed\n"); 537 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, IPV4_DBG, DBG_LVL_ALL, "ClassifyPacket : Ethernet CS Classification Failed\n");
539 break; 538 continue;
540 }
541 } else { /* No ETH Supported on this SF */
542 if (eEthOtherFrame != stEthCsPktInfo.eNwpktEthFrameType) {
543 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, IPV4_DBG, DBG_LVL_ALL, " ClassifyPacket : Packet Not a 802.3 Ethernet Frame... hence not allowed over non-ETH CS SF\n");
544 bClassificationSucceed = false;
545 break;
546 }
547 } 539 }
540 } else { /* No ETH Supported on this SF */
541 if (eEthOtherFrame != stEthCsPktInfo.eNwpktEthFrameType) {
542 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, IPV4_DBG, DBG_LVL_ALL, " ClassifyPacket : Packet Not a 802.3 Ethernet Frame... hence not allowed over non-ETH CS SF\n");
543 bClassificationSucceed = false;
544 continue;
545 }
546 }
548 547
549 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, IPV4_DBG, DBG_LVL_ALL, "Proceeding to IP CS Clasification"); 548 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, IPV4_DBG, DBG_LVL_ALL, "Proceeding to IP CS Clasification");
550
551 if (Adapter->PackInfo[uiSfIndex].bIPCSSupport) {
552 549
553 if (stEthCsPktInfo.eNwpktIPFrameType == eNonIPPacket) { 550 if (Adapter->PackInfo[uiSfIndex].bIPCSSupport) {
554 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, IPV4_DBG, DBG_LVL_ALL, " ClassifyPacket : Packet is Not an IP Packet\n");
555 bClassificationSucceed = false;
556 break;
557 }
558 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, IPV4_DBG, DBG_LVL_ALL, "Dump IP Header :\n");
559 DumpFullPacket((PUCHAR)pIpHeader, 20);
560 551
561 if (stEthCsPktInfo.eNwpktIPFrameType == eIPv4Packet) 552 if (stEthCsPktInfo.eNwpktIPFrameType == eNonIPPacket) {
562 bClassificationSucceed = IpVersion4(Adapter, pIpHeader, pstClassifierRule); 553 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, IPV4_DBG, DBG_LVL_ALL, " ClassifyPacket : Packet is Not an IP Packet\n");
563 else if (stEthCsPktInfo.eNwpktIPFrameType == eIPv6Packet) 554 bClassificationSucceed = false;
564 bClassificationSucceed = IpVersion6(Adapter, pIpHeader, pstClassifierRule); 555 continue;
565 } 556 }
557 BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, IPV4_DBG, DBG_LVL_ALL, "Dump IP Header :\n");
558 DumpFullPacket((PUCHAR)pIpHeader, 20);
566 559
567 } while (0); 560 if (stEthCsPktInfo.eNwpktIPFrameType == eIPv4Packet)
561 bClassificationSucceed = IpVersion4(Adapter, pIpHeader, pstClassifierRule);
562 else if (stEthCsPktInfo.eNwpktIPFrameType == eIPv6Packet)
563 bClassificationSucceed = IpVersion6(Adapter, pIpHeader, pstClassifierRule);
564 }
568 } 565 }
569 566
570 if (bClassificationSucceed == TRUE) { 567 if (bClassificationSucceed == TRUE) {