From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id BA61DA0487 for ; Fri, 5 Jul 2019 19:18:12 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id D13981BE73; Fri, 5 Jul 2019 19:16:57 +0200 (CEST) Received: from mail-pl1-f194.google.com (mail-pl1-f194.google.com [209.85.214.194]) by dpdk.org (Postfix) with ESMTP id 60A281BE31 for ; Fri, 5 Jul 2019 19:16:47 +0200 (CEST) Received: by mail-pl1-f194.google.com with SMTP id i2so4891619plt.1 for ; Fri, 05 Jul 2019 10:16:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=zyCcY6Qyygvs3/n6ca08O0iKQEaNDeyO+DvEEksV450=; b=IoRpJeaXQvcY9jE/DmR+NlDhCByOX6ts+m68i4Vz+IlH2gQkOoJnIp/sMzNy8Z8KsW MLEv1nd6za+8L2Qcg0PPgGaett7gzhXRgHvZBG6KwEKpJdse6VqBtj08Uh2POL8W58b+ uVdD2NHb7OH8wimLmJy23N+g9inIODwq9upxmfG4ayo/lBpXNvde8Kzrf4MgyEkvJ5fU tDKBpD7H9FAc8F5mAY7iXR18JkbS++yY469GSs1FIaXiwSMC+ADD+wzeuJBYerGpKrKP il3OREjZ3OCGH181OVc1Xi4q32BIT3+aM7qejX7HPonfXf6pvbFpM7dKnnOpsxyyvuv4 iuGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=zyCcY6Qyygvs3/n6ca08O0iKQEaNDeyO+DvEEksV450=; b=E6GObVLYsthQ2oArCX7PodxxmCh1EBFE5RHx95eTqHjXD08I4L5l5WgYahfllvdvby we5k/I4O5pP9GoUoY0MeQO4R5grIQuCaCkpVcKIzyuWFVpvuVsmxTpK/bcyjfExo5RqI YjLYI2k0XdmZ2BSCgB+p8LvuoWI5pIFyVMb931qAl5xoSiXJbMuvSh6yf5Q767Cmeb1K mWqehZVVMLQR58weJPe1zrEgBeetIzv9MSEYlobCcZ5tks0Gja/F2i276Yc/X1nJKSNX QCuOfh2Yqz4XVZtKXjx5OuBnHZmgzkPhyEoNTSdVtpuP3yiaWUd0jDsDm9tCJ5K6Zp2Z gkcg== X-Gm-Message-State: APjAAAWsXmdGUbDQm6yVk4U/1v5dUiXBw1UIMZeTYXeBOB3mxgWkIU8L 3gncltEMfiuQqTL6hG7f46nrsBDiKlM= X-Google-Smtp-Source: APXvYqzNRqnhlSYT2YWWGFpbkcO1PAUblC9fERzzuerLLk6KVSs1MC5s6LrK8w+jy/75WPdHLrgFfw== X-Received: by 2002:a17:902:2a27:: with SMTP id i36mr6734640plb.161.1562347006392; Fri, 05 Jul 2019 10:16:46 -0700 (PDT) Received: from hermes.lan (204-195-22-127.wavecable.com. [204.195.22.127]) by smtp.gmail.com with ESMTPSA id 21sm8991014pjh.25.2019.07.05.10.16.45 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 05 Jul 2019 10:16:45 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger , Matan Azrad Date: Fri, 5 Jul 2019 10:16:25 -0700 Message-Id: <20190705171626.13448-11-stephen@networkplumber.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190705171626.13448-1-stephen@networkplumber.org> References: <20190516180427.17270-1-stephen@networkplumber.org> <20190705171626.13448-1-stephen@networkplumber.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [dpdk-dev] [PATCH v8 10/11] net/vdev_netvsc: use common ethernet address parsing X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Use rte_ether_unformat_addr rather than sscanf. Signed-off-by: Stephen Hemminger Acked-by: Matan Azrad --- drivers/net/vdev_netvsc/vdev_netvsc.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/drivers/net/vdev_netvsc/vdev_netvsc.c b/drivers/net/vdev_netvsc/vdev_netvsc.c index 1fcf90d7bc02..be8f19c0c63e 100644 --- a/drivers/net/vdev_netvsc/vdev_netvsc.c +++ b/drivers/net/vdev_netvsc/vdev_netvsc.c @@ -529,15 +529,7 @@ vdev_netvsc_netvsc_probe(const struct if_nameindex *iface, } else if (!strcmp(pair->key, VDEV_NETVSC_ARG_MAC)) { struct rte_ether_addr tmp; - if (sscanf(pair->value, - "%" SCNx8 ":%" SCNx8 ":%" SCNx8 ":" - "%" SCNx8 ":%" SCNx8 ":%" SCNx8, - &tmp.addr_bytes[0], - &tmp.addr_bytes[1], - &tmp.addr_bytes[2], - &tmp.addr_bytes[3], - &tmp.addr_bytes[4], - &tmp.addr_bytes[5]) != 6) { + if (rte_ether_unformat_addr(pair->value, &tmp) != 0) { DRV_LOG(ERR, "invalid MAC address format" " \"%s\"", -- 2.20.1