[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2d4bd18f-1e31-e62e-6ae4-d544bae933cd@gmx.de>
Date: Tue, 18 Oct 2016 21:22:07 +0200
From: Lino Sanfilippo <LinoSanfilippo@....de>
To: Ryan Swan <ryan@...nswan.com>, devel@...verdev.osuosl.org
Cc: liodot@...il.com, charrer@...critech.com,
gregkh@...uxfoundation.org, bmarsh94@...il.com,
amarjargal.gundjalam@...il.com, aquannie@...il.com,
janani.rvchndrn@...il.com, kevin.m.wern@...il.com,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] staging: slicoss.ko: slicoss.c: Fixed incorrect argument
type
Hi Ryan,
On 18.10.2016 20:03, Ryan Swan wrote:
> sparse produced
> warning: incorrect type in argument 2 (different address spaces)
> expected void const volatile [noderef] <asn:2>*src
> got struct slic_stats *stats
>
> casting argument 2 to what is expected by memcpy_fromio() fixed this
>
> Signed-off-by: Ryan Swan <ryan@...nswan.com>
> ---
> drivers/staging/slicoss/slicoss.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/slicoss/slicoss.c b/drivers/staging/slicoss/slicoss.c
> index 2802b90..7c6feb1 100644
> --- a/drivers/staging/slicoss/slicoss.c
> +++ b/drivers/staging/slicoss/slicoss.c
> @@ -1057,7 +1057,7 @@ static void slic_upr_request_complete(struct adapter *adapter, u32 isr)
> if (stats->rcv_drops > old->rcv_drops)
> adapter->rcv_drops += (stats->rcv_drops -
> old->rcv_drops);
> - memcpy_fromio(old, stats, sizeof(*stats));
> + memcpy_fromio(old, (void __iomem *)stats, sizeof(*stats));
> break;
> }
> case SLIC_UPR_RLSR:
>
The issue here is the use of memcpy_fromio() while it actually is not io but dma
memory that we copy from.
Regards,
Lino
Powered by blists - more mailing lists