Commit 30ae835f89cac13156fdef84412870f3179f3f22
Committed by
Greg Kroah-Hartman
1 parent
5d372900aa
Exists in
master
and in
7 other branches
staging: slicoss Use compare_ether_addr.
Use compare_ether_addr. Signed-off-by: Denis Kirjanov <kirjanov@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Showing 2 changed files with 3 additions and 17 deletions Side-by-side Diff
drivers/staging/slicoss/slic.h
... | ... | @@ -527,15 +527,6 @@ |
527 | 527 | (largestat) += ((newstat) - (oldstat)); \ |
528 | 528 | } |
529 | 529 | |
530 | -#define ETHER_EQ_ADDR(_AddrA, _AddrB, _Result) \ | |
531 | -{ \ | |
532 | - _Result = true; \ | |
533 | - if (*(u32 *)(_AddrA) != *(u32 *)(_AddrB)) \ | |
534 | - _Result = false; \ | |
535 | - if (*(u16 *)(&((_AddrA)[4])) != *(u16 *)(&((_AddrB)[4]))) \ | |
536 | - _Result = false; \ | |
537 | -} | |
538 | - | |
539 | 530 | #if defined(CONFIG_X86_64) || defined(CONFIG_IA64) |
540 | 531 | #define SLIC_GET_ADDR_LOW(_addr) (u32)((u64)(_addr) & \ |
541 | 532 | 0x00000000FFFFFFFF) |
drivers/staging/slicoss/slicoss.c
... | ... | @@ -1249,13 +1249,11 @@ |
1249 | 1249 | static int slic_mcast_add_list(struct adapter *adapter, char *address) |
1250 | 1250 | { |
1251 | 1251 | struct mcast_address *mcaddr, *mlist; |
1252 | - bool equaladdr; | |
1253 | 1252 | |
1254 | 1253 | /* Check to see if it already exists */ |
1255 | 1254 | mlist = adapter->mcastaddrs; |
1256 | 1255 | while (mlist) { |
1257 | - ETHER_EQ_ADDR(mlist->address, address, equaladdr); | |
1258 | - if (equaladdr) | |
1256 | + if (!compare_ether_addr(mlist->address, address)) | |
1259 | 1257 | return STATUS_SUCCESS; |
1260 | 1258 | mlist = mlist->next; |
1261 | 1259 | } |
... | ... | @@ -2469,7 +2467,6 @@ |
2469 | 2467 | u32 opts = adapter->macopts; |
2470 | 2468 | u32 *dhost4 = (u32 *)ðer_frame->ether_dhost[0]; |
2471 | 2469 | u16 *dhost2 = (u16 *)ðer_frame->ether_dhost[4]; |
2472 | - bool equaladdr; | |
2473 | 2470 | |
2474 | 2471 | if (opts & MAC_PROMISC) |
2475 | 2472 | return true; |
... | ... | @@ -2493,10 +2490,8 @@ |
2493 | 2490 | struct mcast_address *mcaddr = adapter->mcastaddrs; |
2494 | 2491 | |
2495 | 2492 | while (mcaddr) { |
2496 | - ETHER_EQ_ADDR(mcaddr->address, | |
2497 | - ether_frame->ether_dhost, | |
2498 | - equaladdr); | |
2499 | - if (equaladdr) { | |
2493 | + if (!compare_ether_addr(mcaddr->address, | |
2494 | + ether_frame->ether_dhost)) { | |
2500 | 2495 | adapter->rcv_multicasts++; |
2501 | 2496 | adapter->stats.multicast++; |
2502 | 2497 | return true; |