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 D5EA3A055A; Thu, 27 Feb 2020 09:25:18 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 923F61BFCD; Thu, 27 Feb 2020 09:25:17 +0100 (CET) Received: from mx0b-0016f401.pphosted.com (mx0a-0016f401.pphosted.com [67.231.148.174]) by dpdk.org (Postfix) with ESMTP id 85A4F37AF; Thu, 27 Feb 2020 09:25:16 +0100 (CET) Received: from pps.filterd (m0045849.ppops.net [127.0.0.1]) by mx0a-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 01R8LW1B016773; Thu, 27 Feb 2020 00:25:14 -0800 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : mime-version : content-type : content-transfer-encoding; s=pfpt0818; bh=cNLmvpDNlc1rdTMil81+hwtJZQnG2nuDbhUYzbuXid4=; b=y1zFCLMq//zIfVmqc9gud682cCjnuHnEAh6OrpZQaIWr5JBejDFA3cL/Ell53Xka2+sV B1qx3Mfxd2jjY1NGdqKcG8QKBl8JNW5K2vyEOk9d9ND6iP87Z6Q41ziQ4SVfGimHm3vx G4AfxO2cfRYX2SegJCYFmN1StYDukx6QEi2MtesYZrR/6p3nLJn4NFXemODdvOw8QrP2 6K+KHERKvCZuvkTYk5bg/a3w8ZrC5ArTQcqBZ/kEmYL8DPe5pUNgpFF0I04g7JGPw39R CUVPSlNfEk80L1rgd3hariiVMTnuPLz5BgIlFhzMXCO3+oLZkdkgWieVPxEeiUBKbSyw IQ== Received: from sc-exch02.marvell.com ([199.233.58.182]) by mx0a-0016f401.pphosted.com with ESMTP id 2ydcm17h6y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Thu, 27 Feb 2020 00:25:14 -0800 Received: from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 27 Feb 2020 00:25:13 -0800 Received: from maili.marvell.com (10.93.176.43) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Thu, 27 Feb 2020 00:25:13 -0800 Received: from localhost.localdomain (unknown [10.28.34.200]) by maili.marvell.com (Postfix) with ESMTP id 8AEC13F7040; Thu, 27 Feb 2020 00:25:11 -0800 (PST) From: Sunil Kumar Kori To: , , CC: , , Sunil Kumar Kori Date: Thu, 27 Feb 2020 13:55:06 +0530 Message-ID: <20200227082506.25349-1-skori@marvell.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.572 definitions=2020-02-27_02:2020-02-26, 2020-02-27 signatures=0 Subject: [dpdk-dev] [PATCH] eal: fix log message print for regex 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" If user passes log-level eal parameter to enable log level based on regex then in case of error message is being printed for pattern match instead of regex. Following is the warning message thrown: Compiling C object 'lib/76b5a35@@rte_eal@sta/librte_eal_common_eal_common_options.c.o'. In function ‘eal_parse_log_level’, inlined from ‘eal_parse_common_option’ at ../lib/librte_eal/common/eal_common_options.c:1418:7: ../lib/librte_eal/common/eal_common_options.c:1053:4: warning: ‘%s’ directive argument is null [-Wformat-overflow=] 1053 | fprintf(stderr, "cannot set log level %s,%d\n", | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 1054 | pattern, priority); | ~~~~~~~~~~~~~~~~~~ Fixes: 7f0bb634a140 ("log: add ability to match log type with globbing") Signed-off-by: Sunil Kumar Kori --- lib/librte_eal/common/eal_common_options.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/librte_eal/common/eal_common_options.c b/lib/librte_eal/common/eal_common_options.c index 75974dd5b..525e51e7d 100644 --- a/lib/librte_eal/common/eal_common_options.c +++ b/lib/librte_eal/common/eal_common_options.c @@ -1046,7 +1046,7 @@ eal_parse_log_level(const char *arg) if (regex) { if (rte_log_set_level_regexp(regex, priority) < 0) { fprintf(stderr, "cannot set log level %s,%d\n", - pattern, priority); + regex, priority); goto fail; } if (rte_log_save_regexp(regex, priority) < 0) -- 2.17.1