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 DB1D0A0548; Thu, 2 Dec 2021 13:34:02 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 71F2B40692; Thu, 2 Dec 2021 13:34:02 +0100 (CET) Received: from smartserver.smartsharesystems.com (smartserver.smartsharesystems.com [77.243.40.215]) by mails.dpdk.org (Postfix) with ESMTP id B475C4067B; Thu, 2 Dec 2021 13:34:00 +0100 (CET) X-MimeOLE: Produced By Microsoft Exchange V6.5 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 v1] gpudev: return EINVAL if invalid input pointer for free and unregister Date: Thu, 2 Dec 2021 13:33:53 +0100 Message-ID: <98CBD80474FA8B44BF855DF32C47DC35D86D33@smartserver.smartshare.dk> In-Reply-To: <3625450.hdfAi7Kttb@thomas> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PATCH v1] gpudev: return EINVAL if invalid input pointer for free and unregister Thread-Index: AdfnTONT8KbAPntnS6OatjpyXD3GgQAKrLZQ References: <20211118192802.23955-1-eagostini@nvidia.com> <20211201213749.GA5097@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> <3625450.hdfAi7Kttb@thomas> From: =?iso-8859-1?Q?Morten_Br=F8rup?= To: "Thomas Monjalon" , "Tyler Retzlaff" , "Bruce Richardson" Cc: , , "Andrew Rybchenko" , "David Marchand" , "Ferruh Yigit" 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: Thomas Monjalon [mailto:thomas@monjalon.net] > Sent: Thursday, 2 December 2021 08.19 >=20 > 01/12/2021 22:37, Tyler Retzlaff: > > On Wed, Nov 24, 2021 at 06:04:56PM +0000, Bruce Richardson wrote: > > > if (ret < 0 && rte_errno =3D=3D EAGAIN) > > > > i only urge that this be explicit as opposed to a range i.e. ret = =3D=3D - > 1 > > preferred over ret < 0 >=20 > I don't understand why you think it is important to limit return value > to -1. > Why "if (ret =3D=3D -1)" is better than "if (ret < 0)" ? Speaking for myself: For clarity. It leaves no doubt that "it failed" is represented by the = return value -1, and that the function does not return errno values such = as -EINVAL. -Morten