Re: [PATCH 01/10] staging: slicoss: slic.h: add a macro IOMEM_GET_FIELDADDR to fix sparse warnings

From: Greg KH
Date: Fri Sep 16 2016 - 03:53:05 EST


On Tue, Sep 13, 2016 at 07:59:50PM -0700, Peng Sun wrote:
> Signed-off-by: Peng Sun <sironhide0null@xxxxxxxxx>
> ---
> drivers/staging/slicoss/slic.h | 7 +++++++
> 1 file changed, 7 insertions(+)
>
> diff --git a/drivers/staging/slicoss/slic.h b/drivers/staging/slicoss/slic.h
> index fe1d2ce..7c23190 100644
> --- a/drivers/staging/slicoss/slic.h
> +++ b/drivers/staging/slicoss/slic.h
> @@ -539,6 +539,13 @@ static inline void slic_flush_write(struct adapter *adapter)
> ioread32(adapter->regs + SLIC_REG_HOSTID);
> }
>
> +#define IOMEM_GET_FIELDADDR(base, member) \
> +({ \
> + char __iomem *_base = (char __iomem *)base; \
> + _base += offsetof(typeof(*base), member); \
> + (void __iomem *)_base; \
> +})
> +
> #define UPDATE_STATS(largestat, newstat, oldstat) \
> { \
> if ((newstat) < (oldstat)) \
> --
> 2.7.4

Wait, what does this patch on its own do? Why create this macro?

greg k-h