15/06/2020 21:33, Gaëtan Rivet: > 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 <pa...@mellanox.com> > > --- [...] > > --- /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 > > 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?
If we want to reuse an existing file, it could be lib/librte_eal/include/rte_bitops.h