X-Git-Url: http://git.cascardo.eti.br/?a=blobdiff_plain;f=drivers%2Fnet%2Fethernet%2Fbrocade%2Fbna%2Fbna.h;h=dc845b2571dafe37230bba7bd313c5c5c75216e4;hb=16712c5311fe688ce3b3a2ea0ab185074353bcd6;hp=66e6e0939fd2427326d4116f7bcc92d9af93af70;hpb=2b26fb9567eece71c33d147af238f8325ee50b69;p=cascardo%2Flinux.git diff --git a/drivers/net/ethernet/brocade/bna/bna.h b/drivers/net/ethernet/brocade/bna/bna.h index 66e6e0939fd2..dc845b2571da 100644 --- a/drivers/net/ethernet/brocade/bna/bna.h +++ b/drivers/net/ethernet/brocade/bna/bna.h @@ -208,28 +208,24 @@ do { \ #define bna_rx_rid_mask(_bna) ((_bna)->rx_mod.rid_mask) #define bna_tx_from_rid(_bna, _rid, _tx) \ -do { \ - struct bna_tx_mod *__tx_mod = &(_bna)->tx_mod; \ - struct bna_tx *__tx; \ - struct list_head *qe; \ - _tx = NULL; \ - list_for_each(qe, &__tx_mod->tx_active_q) { \ - __tx = (struct bna_tx *)qe; \ - if (__tx->rid == (_rid)) { \ - (_tx) = __tx; \ - break; \ - } \ - } \ +do { \ + struct bna_tx_mod *__tx_mod = &(_bna)->tx_mod; \ + struct bna_tx *__tx; \ + _tx = NULL; \ + list_for_each_entry(__tx, &__tx_mod->tx_active_q, qe) { \ + if (__tx->rid == (_rid)) { \ + (_tx) = __tx; \ + break; \ + } \ + } \ } while (0) #define bna_rx_from_rid(_bna, _rid, _rx) \ do { \ struct bna_rx_mod *__rx_mod = &(_bna)->rx_mod; \ struct bna_rx *__rx; \ - struct list_head *qe; \ _rx = NULL; \ - list_for_each(qe, &__rx_mod->rx_active_q) { \ - __rx = (struct bna_rx *)qe; \ + list_for_each_entry(__rx, &__rx_mod->rx_active_q, qe) { \ if (__rx->rid == (_rid)) { \ (_rx) = __rx; \ break; \ @@ -249,15 +245,12 @@ do { \ static inline struct bna_mac *bna_mac_find(struct list_head *q, u8 *addr) { - struct bna_mac *mac = NULL; - struct list_head *qe; - list_for_each(qe, q) { - if (ether_addr_equal(((struct bna_mac *)qe)->addr, addr)) { - mac = (struct bna_mac *)qe; - break; - } - } - return mac; + struct bna_mac *mac; + + list_for_each_entry(mac, q, qe) + if (ether_addr_equal(mac->addr, addr)) + return mac; + return NULL; } #define bna_attr(_bna) (&(_bna)->ioceth.attr)