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 B5EA5A0542; Wed, 26 Oct 2022 11:05:03 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id A26E040E28; Wed, 26 Oct 2022 11:05:03 +0200 (CEST) Received: from smartserver.smartsharesystems.com (smartserver.smartsharesystems.com [77.243.40.215]) by mails.dpdk.org (Postfix) with ESMTP id 0B29540041 for ; Wed, 26 Oct 2022 11:05:03 +0200 (CEST) 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 v6 08/27] eal: deprecate RTE_FUNC_PTR_* macros Date: Wed, 26 Oct 2022 11:04:53 +0200 Message-ID: <98CBD80474FA8B44BF855DF32C47DC35D87442@smartserver.smartshare.dk> In-Reply-To: <20220914075841.51555-9-david.marchand@redhat.com> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PATCH v6 08/27] eal: deprecate RTE_FUNC_PTR_* macros Thread-Index: AdjID/1sAoa/abBdRaGUFSuMEBVWNAhCCbqQ References: <20220628144643.1213026-1-david.marchand@redhat.com> <20220914075841.51555-1-david.marchand@redhat.com> <20220914075841.51555-9-david.marchand@redhat.com> From: =?iso-8859-1?Q?Morten_Br=F8rup?= To: "David Marchand" , Cc: , , "Ray Kinsella" , "Fan Zhang" , "Ashish Gupta" , "Qiming Yang" , "Wenjun Wu" , "Shijith Thotton" , "Srisivasubramanian Srinivasan" , "Rosen Xu" , "Tianfei zhang" , "Sachin Saxena" , "Hemant Agrawal" , "Akhil Goyal" , "Chengwen Feng" , "Kevin Laatz" , "Ferruh Yigit" , "Andrew Rybchenko" , "Abhinandan Gujjar" , "Jerin Jacob" , "Jay Jayatheerthan" , "Olivier Matz" , "Ori Kam" , "Maxime Coquelin" , "Chenbo Xia" 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: David Marchand [mailto:david.marchand@redhat.com] > Sent: Wednesday, 14 September 2022 09.58 >=20 > Those macros have no real value and are easily replaced with a simple > if() block. >=20 > Existing users have been converted using a new cocci script. > Deprecate them. >=20 > Signed-off-by: David Marchand > --- [...] > /* Macros to check for invalid function pointers */ > -#define RTE_FUNC_PTR_OR_ERR_RET(func, retval) do { \ > +#define RTE_FUNC_PTR_OR_ERR_RET(func, retval) > RTE_DEPRECATED(RTE_FUNC_PTR_OR_ERR_RET) \ > +do { \ > if ((func) =3D=3D NULL) \ > return retval; \ > } while (0) >=20 > -#define RTE_FUNC_PTR_OR_RET(func) do { \ > +#define RTE_FUNC_PTR_OR_RET(func) RTE_DEPRECATED(RTE_FUNC_PTR_OR_RET) > \ > +do { \ > if ((func) =3D=3D NULL) \ > return; \ > } while (0) rte_ethdev.h has somewhat similar macros [1]: /* Macros to check for valid port */ #define RTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, retval) do { \ if (!rte_eth_dev_is_valid_port(port_id)) { \ RTE_ETHDEV_LOG(ERR, "Invalid port_id=3D%u\n", port_id); \ return retval; \ } \ } while (0) #define RTE_ETH_VALID_PORTID_OR_RET(port_id) do { \ if (!rte_eth_dev_is_valid_port(port_id)) { \ RTE_ETHDEV_LOG(ERR, "Invalid port_id=3D%u\n", port_id); \ return; \ } \ } while (0) However, these log an error message. It makes me wonder about = consistency... Are the RTE_FUNC_PTR_OR_* macros a special case, or should similar = macros, such as RTE_ETH_VALID_PORTID_OR_*, also be deprecated? Or should the RTE_FUNC_PTR_OR_* macros be modified to log an error = message instead of being deprecated? [1]: = https://elixir.bootlin.com/dpdk/v22.11-rc1/source/lib/ethdev/rte_ethdev.h= #L1909