Staging: bcm: IPv6Protocol.c: Removed unnecessary if-else blocks
authorMatthias Beyer <mail@beyermatthias.de>
Tue, 29 Jul 2014 12:48:30 +0000 (14:48 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 31 Jul 2014 00:13:24 +0000 (17:13 -0700)
This patch simplifies

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

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

Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/bcm/IPv6Protocol.c

index 44021da1dc2baf727ccaa4af97a435e8f0f2339b..5bcdaf949e979ef194a475163ee80232ab2fc0be 100644 (file)
@@ -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;