Staging: vt6656: using is_broadcast_ether_addr() to simplify the code
authorWei Yongjun <yongjun_wei@trendmicro.com.cn>
Sun, 26 Aug 2012 01:03:04 +0000 (09:03 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 4 Sep 2012 21:01:42 +0000 (14:01 -0700)
Using is_broadcast_ether_addr() to simplify the code.

Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/vt6656/hostap.c

index 610604032960dfa4ddc45145b285ea47bdd4e27b..0a73d4060ee19348122a1e036d2c604374f75d41 100644 (file)
@@ -439,9 +439,7 @@ static int hostap_set_encryption(PSDevice pDevice,
                return -EINVAL;
        }
 
-       if (param->sta_addr[0] == 0xff && param->sta_addr[1] == 0xff &&
-           param->sta_addr[2] == 0xff && param->sta_addr[3] == 0xff &&
-           param->sta_addr[4] == 0xff && param->sta_addr[5] == 0xff) {
+       if (is_broadcast_ether_addr(param->sta_addr)) {
                if (param->u.crypt.idx >= MAX_GROUP_KEY)
                        return -EINVAL;
         iNodeIndex = 0;
@@ -663,9 +661,7 @@ static int hostap_get_encryption(PSDevice pDevice,
 
        param->u.crypt.err = 0;
 
-       if (param->sta_addr[0] == 0xff && param->sta_addr[1] == 0xff &&
-           param->sta_addr[2] == 0xff && param->sta_addr[3] == 0xff &&
-           param->sta_addr[4] == 0xff && param->sta_addr[5] == 0xff) {
+       if (is_broadcast_ether_addr(param->sta_addr)) {
         iNodeIndex = 0;
        } else {
            if (BSSbIsSTAInNodeDB(pDevice, param->sta_addr, &iNodeIndex) == FALSE) {