From: Greg KH <gregkh@linuxfoundation.org>
To: Sergio Paracuellos <sergio.paracuellos@gmail.com>
Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org,
liodot@gmail.com
Subject: Re: [PATCH v2] staging: slicoss: fix different address space warnings
Date: Wed, 16 Nov 2016 08:05:43 +0100 [thread overview]
Message-ID: <20161116070543.GA11164@kroah.com> (raw)
In-Reply-To: <1479269257-5913-1-git-send-email-sergio.paracuellos@gmail.com>
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
next prev parent reply other threads:[~2016-11-16 7:05 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-16 4:07 [PATCH v2] staging: slicoss: fix different address space warnings Sergio Paracuellos
2016-11-16 7:05 ` Greg KH [this message]
2016-11-16 8:33 ` Sergio Paracuellos
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20161116070543.GA11164@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=devel@driverdev.osuosl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=liodot@gmail.com \
--cc=sergio.paracuellos@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.