Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1523257
| From | Greg KH <gregkh@linuxfoundation.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v2] staging: slicoss: fix different address space warnings |
| Date | 2016-11-16 08:10 +0100 |
| Message-ID | <sE2w1-89M-5@gated-at.bofh.it> (permalink) |
| References | <sDZHP-5XO-7@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
On Wed, Nov 16, 2016 at 05:07:37AM +0100, Sergio Paracuellos wrote:
> This patch fix the following sparse warnings in slicoss driver:
> warning: incorrect type in assignment (different address spaces)
>
> Changes in v2:
> * Remove IOMEM_GET_FIELDADDR macro
> * Add ioread64 and iowrite64 defines
>
> Signed-off-by: Sergio Paracuellos <sergio.paracuellos@gmail.com>
> ---
> drivers/staging/slicoss/slicoss.c | 111 ++++++++++++++++++++++++++------------
> 1 file changed, 76 insertions(+), 35 deletions(-)
>
> diff --git a/drivers/staging/slicoss/slicoss.c b/drivers/staging/slicoss/slicoss.c
> index d2929b9..d68a463 100644
> --- a/drivers/staging/slicoss/slicoss.c
> +++ b/drivers/staging/slicoss/slicoss.c
> @@ -128,6 +128,35 @@
>
> MODULE_DEVICE_TABLE(pci, slic_pci_tbl);
>
> +#ifndef ioread64
> +#ifdef readq
> +#define ioread64 readq
> +#else
> +#define ioread64 _ioread64
> +static inline u64 _ioread64(void __iomem *mmio)
> +{
> + u64 low, high;
> +
> + low = ioread32(mmio);
> + high = ioread32(mmio + sizeof(u32));
> + return low | (high << 32);
> +}
> +#endif
> +#endif
eek, no! Don't write common kernel functions in a driver just because
some configuration option was incorrect. That implies that you really
can't do that type of read/write for that platform, so maybe you
shouldn't be doing it!
Split this up into one patch that does the 32bit stuff, then worry
about the 64bit stuff in a separate patch please.
thanks,
greg k-h
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v2] staging: slicoss: fix different address space warnings Sergio Paracuellos <sergio.paracuellos@gmail.com> - 2016-11-16 05:10 +0100
Re: [PATCH v2] staging: slicoss: fix different address space warnings Greg KH <gregkh@linuxfoundation.org> - 2016-11-16 08:10 +0100
Re: [PATCH v2] staging: slicoss: fix different address space warnings Sergio Paracuellos <sergio.paracuellos@gmail.com> - 2016-11-16 09:40 +0100
csiph-web