Skip to content

Commit

Permalink
Staging: vt6656: using is_broadcast_ether_addr() to simplify the code
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Wei Yongjun authored and Greg Kroah-Hartman committed Sep 4, 2012
1 parent 4148aa2 commit 70a1fb1
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions drivers/staging/vt6656/hostap.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down

0 comments on commit 70a1fb1

Please sign in to comment.