mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-06 19:07:52 +00:00
qlcnic: Use list_for_each_entry() to simplify code in qlcnic_main.c
Convert list_for_each() to list_for_each_entry() where applicable. This simplifies the code. Reported-by: Hulk Robot <hulkci@huawei.com> Signed-off-by: Wang Hai <wanghai38@huawei.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
4d1fb7cde0
commit
56b57b809f
1 changed files with 1 additions and 3 deletions
|
@ -319,10 +319,8 @@ int qlcnic_read_mac_addr(struct qlcnic_adapter *adapter)
|
||||||
static void qlcnic_delete_adapter_mac(struct qlcnic_adapter *adapter)
|
static void qlcnic_delete_adapter_mac(struct qlcnic_adapter *adapter)
|
||||||
{
|
{
|
||||||
struct qlcnic_mac_vlan_list *cur;
|
struct qlcnic_mac_vlan_list *cur;
|
||||||
struct list_head *head;
|
|
||||||
|
|
||||||
list_for_each(head, &adapter->mac_list) {
|
list_for_each_entry(cur, &adapter->mac_list, list) {
|
||||||
cur = list_entry(head, struct qlcnic_mac_vlan_list, list);
|
|
||||||
if (ether_addr_equal_unaligned(adapter->mac_addr, cur->mac_addr)) {
|
if (ether_addr_equal_unaligned(adapter->mac_addr, cur->mac_addr)) {
|
||||||
qlcnic_sre_macaddr_change(adapter, cur->mac_addr,
|
qlcnic_sre_macaddr_change(adapter, cur->mac_addr,
|
||||||
0, QLCNIC_MAC_DEL);
|
0, QLCNIC_MAC_DEL);
|
||||||
|
|
Loading…
Reference in a new issue