Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S943403AbcJSOwV (ORCPT ); Wed, 19 Oct 2016 10:52:21 -0400 Received: from userp1050.oracle.com ([156.151.31.82]:16672 "EHLO userp1050.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S942364AbcJSOwS (ORCPT ); Wed, 19 Oct 2016 10:52:18 -0400 Date: Wed, 19 Oct 2016 11:32:24 +0300 From: Dan Carpenter To: Ryan Swan , LinoSanfilippo@gmx.de Cc: devel@driverdev.osuosl.org, amarjargal.gundjalam@gmail.com, janani.rvchndrn@gmail.com, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, liodot@gmail.com, kevin.m.wern@gmail.com, LinoSanfilippo@gmx.de, charrer@alacritech.com, aquannie@gmail.com Subject: Re: [PATCH] staging: slicoss.ko: slicoss.c: Fixed incorrect argument type Message-ID: <20161019083224.GE4469@mwanda> References: <1476813811-22988-1-git-send-email-ryan@ryanswan.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1476813811-22988-1-git-send-email-ryan@ryanswan.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Source-IP: userp1040.oracle.com [156.151.31.81] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1161 Lines: 29 On Tue, Oct 18, 2016 at 02:03:31PM -0400, Ryan Swan wrote: > sparse produced > warning: incorrect type in argument 2 (different address spaces) > expected void const volatile [noderef] *src > got struct slic_stats *stats > > casting argument 2 to what is expected by memcpy_fromio() fixed this > > Signed-off-by: Ryan Swan > --- > 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)); This should probably just be memcpy(). Introduced in commit fdb777751278 ("staging: slicoss: improve implementation concerning the shared memory"). regards, dan carpenter