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 D6DA1A0524; Mon, 12 Apr 2021 23:18:19 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id BD4FA141296; Mon, 12 Apr 2021 23:18:19 +0200 (CEST) Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by mails.dpdk.org (Postfix) with ESMTP id D6317141258 for ; Mon, 12 Apr 2021 23:18:18 +0200 (CEST) Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 87BA45C01E1; Mon, 12 Apr 2021 17:18:18 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Mon, 12 Apr 2021 17:18:18 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=fm3; bh= Aj7c7eoS4eGf4aKluffig0bJ42/ZserEipZLh2pL/lI=; b=L8E6HVJ6DPGdgRsd wsgbJ18XlRxP2nAQHoHwQSZ9ycGoYonIuI46fDyLjpfw6ZMeLYC0PaCIpvammMNI W4ThY8Ykspw1RFYt0JeWXWCfbLNJGa7IeOh1xh7PYQTI09bLSpgK5m7l/g/E+phw L42w261Q6zReBcf4ldOKyIXDoRQ67KnKZytBvWJDmetkN3oGVu3UPqnYu1GrMwf8 YIaSdqZpbdC4QoX1JILxO6XMybe1/5qepWe1QudFQ3QR0o+ha7FQr4Yu2bYNfm/2 LWi7reVZdVng3cXS3R4k/SnCGM0uFxpin7wgSHrT3PrnyoB36ZI/NSIbtfTdmcPf vIs6AQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=Aj7c7eoS4eGf4aKluffig0bJ42/ZserEipZLh2pL/ lI=; b=E79ds+/qwmAesMwGH8DD5PQULzlhzB3yJQakyVNuh3+L+YerPhg0ImzaZ VHIuWJII6Z4qrGVL5xRL51NX+gRik2fOYy2gtkKpdZtQz/Fekf4fFdObcwSSOVcE OEJLy4bN3SpP4H6AloVY6CIG6C7RRqSn0ZrHu5p5f+O6a4kcqh45RJyZEpkD5k2C jEkDKbRosOMXbHmEv/Ww68WjCyuqqf86DGhNPYGbuuomZESmkLOdujambNN4EgMs +RyybYW8fTLMRaNkpaH9pa8jyVc1MlwF+KZbfTlD6lWmruBPWceklPR25EtvJ6Ux gFhQZIQs6JJXhn4IHkA9ZfHDqwc6w== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudekjedgudeiudcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvffufffkjghfggfgtgesthfuredttddtvdenucfhrhhomhepvfhhohhm rghsucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenuc ggtffrrghtthgvrhhnpedugefgvdefudfftdefgeelgffhueekgfffhfeujedtteeutdej ueeiiedvffegheenucfkphepjeejrddufeegrddvtdefrddukeegnecuvehluhhsthgvrh fuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepthhhohhmrghssehmohhnjhgr lhhonhdrnhgvth X-ME-Proxy: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 08CE71080057; Mon, 12 Apr 2021 17:18:16 -0400 (EDT) From: Thomas Monjalon To: "Xueming(Steven) Li" Cc: Olivier Matz , dev@dpdk.org, Gaetan Rivet , Asaf Penso , Ray Kinsella Date: Mon, 12 Apr 2021 23:18:15 +0200 Message-ID: <9808842.As9T5Sgxch@thomas> In-Reply-To: References: <1608304614-13908-2-git-send-email-xuemingl@nvidia.com> <20210412065253.GD1650@platinum> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v4 3/5] kvargs: add get by key function 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 Sender: "dev" 12/04/2021 14:07, Xueming(Steven) Li: > From: Olivier Matz > > > + if (!kvlist) > > > + return NULL; > > > + for (i = 0; i < kvlist->count; ++i) { > > > + /* Allows key to be NULL. */ > > > + if (!key && !kvlist->pairs[i].key) > > > + return kvlist->pairs[i].value; > > > > Is it possible that kvlist->pairs[i].key == NULL? In which case? > > Impossible, will remove this in next version, thanks. Please do explicit checks against NULL to make clear that they are pointers, not booleans.