On 7/24/2019 2:16 PM, Andrew Rybchenko wrote: > Substitute driver-defined P2ROUNDUP() h with EFX_P2ROUNDUP() > defined in libefx. > > Cast value and alignment to one specified type to guarantee result > correctness. > > Fixes: e1b944598579 ("net/sfc: build libefx") > Cc: sta...@dpdk.org > > Signed-off-by: Andrew Rybchenko <arybche...@solarflare.com>
<...> > @@ -29,6 +29,10 @@ extern "C" { > /* The macro expands divider twice */ > #define EFX_DIV_ROUND_UP(_n, _d) (((_n) + (_d) - 1) / > (_d)) > > +/* Round value up to the nearest power of two. */ > +#define EFX_P2ROUNDUP(_type, _value, _align) \ > + (-(-(_type)(_value) & -(_type)(_align))) > + I trust you it does what it says J Just a high level comment, should we have some kind of tools/utilities file in one of the libraries so everyone can use/share them?