Pablo Neira Ayuso <pablo@xxxxxxxxxxxxx> wrote: > +static inline void *nft_elem_priv_cast(const struct nft_elem_priv *priv) > +{ > + return (void *)priv; > +} I'm fine with this, alternative would be to make this per-set backend: #define nft_elem_priv_to_bitmap_elem(ptr) container_of_const(ptr, struct nft_bitmap_elem, priv) I'll leave it up to you. The only advantage of the latter is that priv doesn't have to be the first member.