Staging: bcm: PHSModule.c: Rewrote ValidatePHSRuleComplete()
authorMatthias Beyer <mail@beyermatthias.de>
Tue, 15 Jul 2014 07:43:07 +0000 (09:43 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 15 Jul 2014 15:09:48 +0000 (08:09 -0700)
Signed-off-by: Matthias Beyer <mail@beyermatthias.de>
Reviewed-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/bcm/PHSModule.c

index c2901788cc0adb216e8dbf79ab87cdabcffa5cca..9a248454a70a6e60c6861c8464207e94cf9b2c42 100644 (file)
@@ -948,24 +948,10 @@ out:
 
 static bool ValidatePHSRuleComplete(IN struct bcm_phs_rule *psPhsRule)
 {
-       if (psPhsRule) {
-               if (!psPhsRule->u8PHSI) {
-                       /* PHSI is not valid */
-                       return false;
-               }
-
-               if (!psPhsRule->u8PHSS) {
-                       /* PHSS Is Undefined */
-                       return false;
-               }
-
-               /* Check if PHSF is defines for the PHS Rule */
-               if (!psPhsRule->u8PHSFLength) /* If any part of PHSF is valid then Rule contains valid PHSF */
-                       return false;
-
-               return TRUE;
-       } else
-               return false;
+       return (psPhsRule &&
+               psPhsRule->u8PHSI &&
+               psPhsRule->u8PHSS &&
+               psPhsRule->u8PHSFLength);
 }
 
 UINT GetServiceFlowEntry(IN struct bcm_phs_table *psServiceFlowTable,