diff options
author | Matthias Beyer <mail@beyermatthias.de> | 2014-07-29 14:52:18 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-07-31 00:14:22 (GMT) |
commit | b8ab70b046a9baf02f5e02412c265578b1b24953 (patch) | |
tree | d574e41452ec659460f7bd14d8513621f206738d /drivers | |
parent | 81797eaf798ca6e2dd62c636de43739289515917 (diff) | |
download | linux-b8ab70b046a9baf02f5e02412c265578b1b24953.tar.xz |
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>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/bcm/Qos.c | 95 |
1 files changed, 46 insertions, 49 deletions
diff --git a/drivers/staging/bcm/Qos.c b/drivers/staging/bcm/Qos.c index e59abe4..2cc87b5 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) * Iterate through all classifiers which are already in order of priority * to classify the packet until match found */ - do { - if (false == Adapter->astClassifierTable[uiLoopIndex].bUsed) { - bClassificationSucceed = false; - break; - } - BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, IPV4_DBG, DBG_LVL_ALL, "Adapter->PackInfo[%d].bvalid=True\n", uiLoopIndex); + if (false == Adapter->astClassifierTable[uiLoopIndex].bUsed) { + bClassificationSucceed = false; + continue; + } + BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, IPV4_DBG, DBG_LVL_ALL, "Adapter->PackInfo[%d].bvalid=True\n", uiLoopIndex); - if (0 == Adapter->astClassifierTable[uiLoopIndex].ucDirection) { - bClassificationSucceed = false; /* cannot be processed for classification. */ - break; /* it is a down link connection */ - } + if (0 == Adapter->astClassifierTable[uiLoopIndex].ucDirection) { + bClassificationSucceed = false; /* cannot be processed for classification. */ + continue; /* it is a down link connection */ + } - pstClassifierRule = &Adapter->astClassifierTable[uiLoopIndex]; + pstClassifierRule = &Adapter->astClassifierTable[uiLoopIndex]; - uiSfIndex = SearchSfid(Adapter, pstClassifierRule->ulSFID); - if (uiSfIndex >= NO_OF_QUEUES) { - BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, IPV4_DBG, DBG_LVL_ALL, "Queue Not Valid. SearchSfid for this classifier Failed\n"); - break; - } + uiSfIndex = SearchSfid(Adapter, pstClassifierRule->ulSFID); + if (uiSfIndex >= NO_OF_QUEUES) { + BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, IPV4_DBG, DBG_LVL_ALL, "Queue Not Valid. SearchSfid for this classifier Failed\n"); + continue; + } - if (Adapter->PackInfo[uiSfIndex].bEthCSSupport) { + if (Adapter->PackInfo[uiSfIndex].bEthCSSupport) { - if (eEthUnsupportedFrame == stEthCsPktInfo.eNwpktEthFrameType) { - BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, IPV4_DBG, DBG_LVL_ALL, " ClassifyPacket : Packet Not a Valid Supported Ethernet Frame\n"); - bClassificationSucceed = false; - break; - } + if (eEthUnsupportedFrame == stEthCsPktInfo.eNwpktEthFrameType) { + BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, IPV4_DBG, DBG_LVL_ALL, " ClassifyPacket : Packet Not a Valid Supported Ethernet Frame\n"); + bClassificationSucceed = false; + continue; + } - 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); - bClassificationSucceed = EThCSClassifyPkt(Adapter, skb, &stEthCsPktInfo, pstClassifierRule, Adapter->PackInfo[uiSfIndex].bEthCSSupport); + 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); + bClassificationSucceed = EThCSClassifyPkt(Adapter, skb, &stEthCsPktInfo, pstClassifierRule, Adapter->PackInfo[uiSfIndex].bEthCSSupport); - if (!bClassificationSucceed) { - BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, IPV4_DBG, DBG_LVL_ALL, "ClassifyPacket : Ethernet CS Classification Failed\n"); - break; - } - } else { /* No ETH Supported on this SF */ - if (eEthOtherFrame != stEthCsPktInfo.eNwpktEthFrameType) { - 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"); - bClassificationSucceed = false; - break; - } + if (!bClassificationSucceed) { + BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, IPV4_DBG, DBG_LVL_ALL, "ClassifyPacket : Ethernet CS Classification Failed\n"); + continue; } + } else { /* No ETH Supported on this SF */ + if (eEthOtherFrame != stEthCsPktInfo.eNwpktEthFrameType) { + 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"); + bClassificationSucceed = false; + continue; + } + } - BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, IPV4_DBG, DBG_LVL_ALL, "Proceeding to IP CS Clasification"); - - if (Adapter->PackInfo[uiSfIndex].bIPCSSupport) { + BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, IPV4_DBG, DBG_LVL_ALL, "Proceeding to IP CS Clasification"); - if (stEthCsPktInfo.eNwpktIPFrameType == eNonIPPacket) { - BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, IPV4_DBG, DBG_LVL_ALL, " ClassifyPacket : Packet is Not an IP Packet\n"); - bClassificationSucceed = false; - break; - } - BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, IPV4_DBG, DBG_LVL_ALL, "Dump IP Header :\n"); - DumpFullPacket((PUCHAR)pIpHeader, 20); + if (Adapter->PackInfo[uiSfIndex].bIPCSSupport) { - if (stEthCsPktInfo.eNwpktIPFrameType == eIPv4Packet) - bClassificationSucceed = IpVersion4(Adapter, pIpHeader, pstClassifierRule); - else if (stEthCsPktInfo.eNwpktIPFrameType == eIPv6Packet) - bClassificationSucceed = IpVersion6(Adapter, pIpHeader, pstClassifierRule); + if (stEthCsPktInfo.eNwpktIPFrameType == eNonIPPacket) { + BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, IPV4_DBG, DBG_LVL_ALL, " ClassifyPacket : Packet is Not an IP Packet\n"); + bClassificationSucceed = false; + continue; } + BCM_DEBUG_PRINT(Adapter, DBG_TYPE_TX, IPV4_DBG, DBG_LVL_ALL, "Dump IP Header :\n"); + DumpFullPacket((PUCHAR)pIpHeader, 20); - } while (0); + if (stEthCsPktInfo.eNwpktIPFrameType == eIPv4Packet) + bClassificationSucceed = IpVersion4(Adapter, pIpHeader, pstClassifierRule); + else if (stEthCsPktInfo.eNwpktIPFrameType == eIPv6Packet) + bClassificationSucceed = IpVersion6(Adapter, pIpHeader, pstClassifierRule); + } } if (bClassificationSucceed == TRUE) { |