s390/qeth: extract qeth_l2_remove_mac()
authorJulian Wiedmann <jwi@linux.vnet.ibm.com>
Thu, 12 Jan 2017 14:48:40 +0000 (15:48 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 12 Jan 2017 15:02:43 +0000 (10:02 -0500)
This matches qeth_l2_write_mac().

Signed-off-by: Julian Wiedmann <jwi@linux.vnet.ibm.com>
Reviewed-by: Thomas Richter <tmricht@linux.vnet.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/s390/net/qeth_l2_main.c

index 074fc62649e2ece77cd98d8ad02addc547291dbb..d456740904ef27f8f157fe545356531ba85750bf 100644 (file)
@@ -200,16 +200,22 @@ static inline u32 qeth_l2_mac_hash(const u8 *addr)
 
 static int qeth_l2_write_mac(struct qeth_card *card, struct qeth_mac *mac)
 {
-
-       int rc;
-
        if (mac->is_uc) {
-               rc = qeth_l2_send_setdelmac(card, mac->mac_addr,
+               return qeth_l2_send_setdelmac(card, mac->mac_addr,
                                                IPA_CMD_SETVMAC);
        } else {
-               rc = qeth_l2_send_setgroupmac(card, mac->mac_addr);
+               return qeth_l2_send_setgroupmac(card, mac->mac_addr);
+       }
+}
+
+static int qeth_l2_remove_mac(struct qeth_card *card, struct qeth_mac *mac)
+{
+       if (mac->is_uc) {
+               return qeth_l2_send_setdelmac(card, mac->mac_addr,
+                                               IPA_CMD_DELVMAC);
+       } else {
+               return qeth_l2_send_delgroupmac(card, mac->mac_addr);
        }
-       return rc;
 }
 
 static void qeth_l2_del_all_macs(struct qeth_card *card)
@@ -782,14 +788,7 @@ static void qeth_l2_set_rx_mode(struct net_device *dev)
 
        hash_for_each_safe(card->mac_htable, i, tmp, mac, hnode) {
                if (mac->disp_flag == QETH_DISP_ADDR_DELETE) {
-                       if (!mac->is_uc)
-                               rc = qeth_l2_send_delgroupmac(card,
-                                               mac->mac_addr);
-                       else {
-                               rc = qeth_l2_send_setdelmac(card, mac->mac_addr,
-                                               IPA_CMD_DELVMAC);
-                       }
-
+                       qeth_l2_remove_mac(card, mac);
                        hash_del(&mac->hnode);
                        kfree(mac);