From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48806) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YECj9-0008BO-8L for qemu-devel@nongnu.org; Thu, 22 Jan 2015 03:02:56 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YECj2-0005Xc-LK for qemu-devel@nongnu.org; Thu, 22 Jan 2015 03:02:55 -0500 Received: from mail-pa0-x22f.google.com ([2607:f8b0:400e:c03::22f]:34344) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YECj2-0005XW-EA for qemu-devel@nongnu.org; Thu, 22 Jan 2015 03:02:48 -0500 Received: by mail-pa0-f47.google.com with SMTP id lj1so247304pab.6 for ; Thu, 22 Jan 2015 00:02:47 -0800 (PST) From: sfeldma@gmail.com Date: Thu, 22 Jan 2015 00:03:51 -0800 Message-Id: <1421913839-22448-3-git-send-email-sfeldma@gmail.com> In-Reply-To: <1421913839-22448-1-git-send-email-sfeldma@gmail.com> References: <1421913839-22448-1-git-send-email-sfeldma@gmail.com> Subject: [Qemu-devel] [PATCH v5 02/10] virtio-net: use qemu_mac_strdup_printf List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, jiri@resnulli.us, roopa@cumulusnetworks.com, john.fastabend@gmail.com, eblake@redhat.com, pbonzini@redhat.com, stefanha@gmail.com, dsahern@gmail.com, jasowang@redhat.com From: Scott Feldman Signed-off-by: Scott Feldman --- hw/net/virtio-net.c | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c index 45da34a..698156f 100644 --- a/hw/net/virtio-net.c +++ b/hw/net/virtio-net.c @@ -226,12 +226,6 @@ static void rxfilter_notify(NetClientState *nc) } } -static char *mac_strdup_printf(const uint8_t *mac) -{ - return g_strdup_printf("%.2x:%.2x:%.2x:%.2x:%.2x:%.2x", mac[0], - mac[1], mac[2], mac[3], mac[4], mac[5]); -} - static intList *get_vlan_table(VirtIONet *n) { intList *list, *entry; @@ -284,12 +278,12 @@ static RxFilterInfo *virtio_net_query_rxfilter(NetClientState *nc) info->multicast_overflow = n->mac_table.multi_overflow; info->unicast_overflow = n->mac_table.uni_overflow; - info->main_mac = mac_strdup_printf(n->mac); + info->main_mac = qemu_mac_strdup_printf(n->mac); str_list = NULL; for (i = 0; i < n->mac_table.first_multi; i++) { entry = g_malloc0(sizeof(*entry)); - entry->value = mac_strdup_printf(n->mac_table.macs + i * ETH_ALEN); + entry->value = qemu_mac_strdup_printf(n->mac_table.macs + i * ETH_ALEN); entry->next = str_list; str_list = entry; } @@ -298,7 +292,7 @@ static RxFilterInfo *virtio_net_query_rxfilter(NetClientState *nc) str_list = NULL; for (i = n->mac_table.first_multi; i < n->mac_table.in_use; i++) { entry = g_malloc0(sizeof(*entry)); - entry->value = mac_strdup_printf(n->mac_table.macs + i * ETH_ALEN); + entry->value = qemu_mac_strdup_printf(n->mac_table.macs + i * ETH_ALEN); entry->next = str_list; str_list = entry; } -- 1.7.10.4