From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id A9CAD43037; Fri, 11 Aug 2023 21:22:39 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 929CE432AB; Fri, 11 Aug 2023 21:21:21 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 6040A40E03 for ; Fri, 11 Aug 2023 21:21:02 +0200 (CEST) Received: by linux.microsoft.com (Postfix, from userid 1086) id E7B6F20FD0F1; Fri, 11 Aug 2023 12:21:00 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com E7B6F20FD0F1 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1691781660; bh=dp6ypKrA/PunpIYlx4Mnrv0Om7L4pKWJWZMO11im4Ls=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KbzEKgClGSsE3hgtjXyzhawWg450Hl0eMZid+A0vy8qGsVBdXh9MiHk/A7Ajkzd3w GD6qUJ6O6Ck2eWJsfDFhBkGhx15nfQX9himeYKBRVKVMZKaiNuL8RlUAgocH+Uade1 oykzOoh0jEEfqeFOJJRA+DKUYlPK+lu2OJtQKeaE= From: Tyler Retzlaff To: dev@dpdk.org Cc: Bruce Richardson , Konstantin Ananyev , Ciara Power , thomas@monjalon.net, david.marchand@redhat.com, mb@smartsharesystems.com, Tyler Retzlaff Subject: [PATCH v11 15/16] eal: use standard ternary operator instead of GCC extension Date: Fri, 11 Aug 2023 12:20:57 -0700 Message-Id: <1691781658-32520-16-git-send-email-roretzla@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1691781658-32520-1-git-send-email-roretzla@linux.microsoft.com> References: <1680558751-17931-1-git-send-email-roretzla@linux.microsoft.com> <1691781658-32520-1-git-send-email-roretzla@linux.microsoft.com> X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Use standard ternary operator instead of gcc extension. There is no concern of side-effects for this evaluation so allow the code to be portable. While here update the condition to compare default_log_stream directly against NULL. Signed-off-by: Tyler Retzlaff --- lib/eal/common/eal_common_hexdump.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/eal/common/eal_common_hexdump.c b/lib/eal/common/eal_common_hexdump.c index 63bbbdc..6fd6e21 100644 --- a/lib/eal/common/eal_common_hexdump.c +++ b/lib/eal/common/eal_common_hexdump.c @@ -15,7 +15,7 @@ char line[LINE_LEN]; /* space needed 8+16*3+3+16 == 75 */ fprintf(f, "%s at [%p], len=%u\n", - title ? : " Dump data", data, len); + title != NULL ? title : " Dump data", data, len); ofs = 0; while (ofs < len) { /* format the line in the buffer */ -- 1.8.3.1