[PATCH v2 2/6] Staging: bcm: IPv6Protocol.c: Removed unnecessary if-else blocks

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

 



This patch simplifies

    if (a) {
        x = false;
    } else {
        if (b) {
            x = false;
        }
    }

to
    if (a || b) {
        x = false;
    }

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

diff --git a/drivers/staging/bcm/IPv6Protocol.c b/drivers/staging/bcm/IPv6Protocol.c
index 44021da..5bcdaf9 100644
--- a/drivers/staging/bcm/IPv6Protocol.c
+++ b/drivers/staging/bcm/IPv6Protocol.c
@@ -272,12 +272,9 @@ USHORT	IpVersion6(struct bcm_mini_adapter *Adapter, PVOID pcIpHeader,
 		INT iMatchedSFQueueIndex = 0;
 
 		iMatchedSFQueueIndex = SearchSfid(Adapter, pstClassifierRule->ulSFID);
-		if (iMatchedSFQueueIndex >= NO_OF_QUEUES) {
+		if ((iMatchedSFQueueIndex >= NO_OF_QUEUES) ||
+		    (Adapter->PackInfo[iMatchedSFQueueIndex].bActive == false))
 			bClassificationSucceed = false;
-		} else {
-			if (Adapter->PackInfo[iMatchedSFQueueIndex].bActive == false)
-				bClassificationSucceed = false;
-		}
 	}
 
 	return bClassificationSucceed;
-- 
2.0.3

_______________________________________________
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