From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 506F5C28CBC for ; Sun, 3 May 2020 20:33:21 +0000 (UTC) Received: from dpdk.org (dpdk.org [92.243.14.124]) by mail.kernel.org (Postfix) with ESMTP id 05EAD2071C for ; Sun, 3 May 2020 20:33:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Kr5PwDFx" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 05EAD2071C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dev-bounces@dpdk.org 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