From: Matthias Beyer Date: Tue, 15 Jul 2014 07:43:07 +0000 (+0200) Subject: Staging: bcm: PHSModule.c: Rewrote ValidatePHSRuleComplete() X-Git-Tag: v3.17-rc1~123^2~760 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=cc872f80709326283bd6d21324be54374d8bde8f;p=karo-tx-linux.git Staging: bcm: PHSModule.c: Rewrote ValidatePHSRuleComplete() Signed-off-by: Matthias Beyer Reviewed-by: Dan Carpenter Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/bcm/PHSModule.c b/drivers/staging/bcm/PHSModule.c index c2901788cc0a..9a248454a70a 100644 --- a/drivers/staging/bcm/PHSModule.c +++ b/drivers/staging/bcm/PHSModule.c @@ -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,