Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1522992

Re: [PATCH] staging: slicoss: fix different address space warnings

From Greg KH <gregkh@linuxfoundation.org>
Newsgroups linux.kernel
Subject Re: [PATCH] staging: slicoss: fix different address space warnings
Date 2016-11-15 19:30 +0100
Message-ID <sDQEx-5I-7@gated-at.bofh.it> (permalink)
References <sDPyO-7Pe-15@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, Nov 15, 2016 at 06:19:37PM +0100, Sergio Paracuellos wrote:
> This patch fix the following sparse warnings in slicoss driver:
> warning: incorrect type in assignment (different address spaces)
> 
> Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
> ---
>  drivers/staging/slicoss/slic.h    |  7 ++++
>  drivers/staging/slicoss/slicoss.c | 83 ++++++++++++++++++++++-----------------
>  2 files changed, 55 insertions(+), 35 deletions(-)
> 
> diff --git a/drivers/staging/slicoss/slic.h b/drivers/staging/slicoss/slic.h
> index 420546d..f76c0cd 100644
> --- a/drivers/staging/slicoss/slic.h
> +++ b/drivers/staging/slicoss/slic.h
> @@ -540,6 +540,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;						\
> +})

Really?  Why?  Shouldn't you be marking base as __iomem all the time?
That way you don't need this mess of a cast.

thanks,

greg k-h

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] staging: slicoss: fix different address space warnings Sergio Paracuellos <sergio.paracuellos@gmail.com> - 2016-11-15 18:20 +0100
  Re: [PATCH] staging: slicoss: fix different address space warnings Greg KH <gregkh@linuxfoundation.org> - 2016-11-15 19:30 +0100
  Re: [PATCH] staging: slicoss: fix different address space warnings Dan Carpenter <dan.carpenter@oracle.com> - 2016-11-16 11:40 +0100

csiph-web