From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 28B1DA04A3; Mon, 15 Jun 2020 21:33:51 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EBDEB2B94; Mon, 15 Jun 2020 21:33:49 +0200 (CEST) Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [217.70.183.196]) by dpdk.org (Postfix) with ESMTP id 69A2E2B87 for ; Mon, 15 Jun 2020 21:33:49 +0200 (CEST) X-Originating-IP: 86.246.31.132 Received: from u256.net (lfbn-idf2-1-566-132.w86-246.abo.wanadoo.fr [86.246.31.132]) (Authenticated sender: grive@u256.net) by relay4-d.mail.gandi.net (Postfix) with ESMTPSA id BDF3AE0004; Mon, 15 Jun 2020 19:33:47 +0000 (UTC) Date: Mon, 15 Jun 2020 21:33:42 +0200 From: =?utf-8?Q?Ga=C3=ABtan?= Rivet To: Parav Pandit Cc: dev@dpdk.org, ferruh.yigit@intel.com, thomasm@mellanox.com, orika@mellanox.com, matan@mellanox.com Message-ID: <20200615193342.7c42ctm7sdefdtjw@u256.net> References: <20200610171728.89-1-parav@mellanox.com> <20200610171728.89-2-parav@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20200610171728.89-2-parav@mellanox.com> Subject: Re: [dpdk-dev] [RFC PATCH 1/6] eal: introduce macros for getting value for bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 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" Hello Parav, On 10/06/20 17:17 +0000, Parav Pandit wrote: > There are several drivers which duplicate bit generation macro. > Introduce a generic bit macros so that such drivers avoid redefining > same in multiple drivers. > > Signed-off-by: Parav Pandit > --- > lib/librte_eal/include/rte_bits.h | 10 ++++++++++ > 1 file changed, 10 insertions(+) > create mode 100644 lib/librte_eal/include/rte_bits.h > > diff --git a/lib/librte_eal/include/rte_bits.h b/lib/librte_eal/include/rte_bits.h > new file mode 100644 > index 000000000..37f284971 > --- /dev/null > +++ b/lib/librte_eal/include/rte_bits.h > @@ -0,0 +1,10 @@ > +/* SPDX-License-Identifier: BSD-3-Clause > + * Copyright 2020 Mellanox Technologies, Ltd. > + */ > + > +#ifndef _RTE_BITS_H_ > +#define _RTE_BITS_H_ > + > +#define RTE_BIT(bit_num) (1UL << (bit_num)) ^ The tab here should be replaced by a space. > + > +#endif > -- > 2.25.4 > I'm not sure this kind of macro is needed, but if multiple drivers are using the patterns let's say ok. However I don't think it needs its own header. Would it be ok in lib/librte_eal/include/rte_common.h for example? -- Gaƫtan