From: Stefan Roese <s...@denx.de> Date: Wed, 14 Aug 2019 13:18:25 +0200
> +static int txd_to_idx(struct mtk_tx_ring *ring, struct mtk_tx_dma *dma) > +{ > + return ((u32)dma - (u32)ring->dma) / sizeof(*dma); > +} This will definitely warn on 64-bit, and you should avoid that even if this driver can not possibly be built on 64-bit platforms. You cannot truncate a pointer to an integer which is potentially smaller in representation size than a pointer could potentially be. Just can avoid all of these issues by using real pointer arithmetic and casting to (char *), or even better, (void *).