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 DE47BA04AF; Sun, 3 May 2020 22:33:20 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id F2EF21D538; Sun, 3 May 2020 22:32:32 +0200 (CEST) Received: from us-smtp-delivery-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) by dpdk.org (Postfix) with ESMTP id B931C1D538 for ; Sun, 3 May 2020 22:32:31 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1588537951; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=QQVYtiqDrU7HTbfmYPboqT1hH4YkOAaLI6hAOv/G7GI=; b=Kr5PwDFxi0VdUWDJ+dz6PglLbGOVyfIMa/gCAnKjClnFeH8MenspwnpoJwfiqcHCq0fO+E Fiwo2orsK++Sha5HIphkfk8Tnt+HIhwpA25clchBpNBbad27JXOFv8LvvEgRqGF75DR2dL XHD2JRqUXi6EHulR31VboUy7dzGVdFE= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-48-PvYXs-D8MD6D9llhDqaubQ-1; Sun, 03 May 2020 16:32:27 -0400 X-MC-Unique: PvYXs-D8MD6D9llhDqaubQ-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id D0FFC800580; Sun, 3 May 2020 20:32:26 +0000 (UTC) Received: from dmarchan.remote.csb (unknown [10.40.192.236]) by smtp.corp.redhat.com (Postfix) with ESMTP id F1ECC5798D; Sun, 3 May 2020 20:32:24 +0000 (UTC) From: David Marchand To: dev@dpdk.org Cc: thomas@monjalon.net, Jerin Jacob , Sunil Kumar Kori Date: Sun, 3 May 2020 22:31:34 +0200 Message-Id: <20200503203135.6493-8-david.marchand@redhat.com> In-Reply-To: <20200503203135.6493-1-david.marchand@redhat.com> References: <20200503203135.6493-1-david.marchand@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Subject: [dpdk-dev] [PATCH 7/8] trace: remove string duplication 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" No need to duplicate an untouched string. Signed-off-by: David Marchand --- lib/librte_eal/common/eal_common_trace_utils.c | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/lib/librte_eal/common/eal_common_trace_utils.c b/lib/librte_ea= l/common/eal_common_trace_utils.c index 15384ce4f1..49cc8d7b1d 100644 --- a/lib/librte_eal/common/eal_common_trace_utils.c +++ b/lib/librte_eal/common/eal_common_trace_utils.c @@ -172,19 +172,11 @@ eal_trace_args_free(void) int trace_args_apply(const char *arg) { -=09char *str; - -=09str =3D strdup(arg); -=09if (str =3D=3D NULL) -=09=09return -1; - -=09if (rte_trace_regexp(str, true) < 0) { -=09=09trace_err("cannot enable trace for %s", str); -=09=09free(str); +=09if (rte_trace_regexp(arg, true) < 0) { +=09=09trace_err("cannot enable trace for %s", arg); =09=09return -1; =09} =20 -=09free(str); =09return 0; } =20 --=20 2.23.0