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 35CEB42633; Mon, 25 Sep 2023 08:25:04 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id EFCD8402CC; Mon, 25 Sep 2023 08:25:03 +0200 (CEST) Received: from dkmailrelay1.smartsharesystems.com (smartserver.smartsharesystems.com [77.243.40.215]) by mails.dpdk.org (Postfix) with ESMTP id EC6EB402CC for ; Mon, 25 Sep 2023 08:25:02 +0200 (CEST) Received: from smartserver.smartsharesystems.com (smartserver.smartsharesys.local [192.168.4.10]) by dkmailrelay1.smartsharesystems.com (Postfix) with ESMTP id C822B20895; Mon, 25 Sep 2023 08:25:00 +0200 (CEST) Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: RE: [PATCH v11 14/16] log: use standard ternary operator instead of GCC extension Date: Mon, 25 Sep 2023 08:24:58 +0200 X-MimeOLE: Produced By Microsoft Exchange V6.5 Message-ID: <98CBD80474FA8B44BF855DF32C47DC35D87C02@smartserver.smartshare.dk> In-Reply-To: <1691781658-32520-15-git-send-email-roretzla@linux.microsoft.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PATCH v11 14/16] log: use standard ternary operator instead of GCC extension Thread-Index: AdnMiP4OCo0tLB9gQ8aee5KgnG94IQi77PXg References: <1680558751-17931-1-git-send-email-roretzla@linux.microsoft.com> <1691781658-32520-1-git-send-email-roretzla@linux.microsoft.com> <1691781658-32520-15-git-send-email-roretzla@linux.microsoft.com> From: =?iso-8859-1?Q?Morten_Br=F8rup?= To: "Tyler Retzlaff" , Cc: "Bruce Richardson" , "Konstantin Ananyev" , "Ciara Power" , , 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 > From: Tyler Retzlaff [mailto:roretzla@linux.microsoft.com] > Sent: Friday, 11 August 2023 21.21 >=20 > 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. >=20 > While here update the condition to compare default_log_stream > directly against NULL. >=20 > Signed-off-by: Tyler Retzlaff > --- > lib/log/log.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) >=20 > diff --git a/lib/log/log.c b/lib/log/log.c > index 52c771f..b80725a 100644 > --- a/lib/log/log.c > +++ b/lib/log/log.c > @@ -93,7 +93,7 @@ struct log_cur_msg { > * of stderr, even if the application closes and > * reopens it. > */ > - return default_log_stream ? : stderr; I didn't know this GCC extension. Someone please consider disallowing this in checkpatches. > + return default_log_stream !=3D NULL ? default_log_stream : stderr; > } > return f; > } > -- > 1.8.3.1 Reviewed-by: Morten Br=F8rup