Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S938617AbcJRTWU (ORCPT ); Tue, 18 Oct 2016 15:22:20 -0400 Received: from mout.gmx.net ([212.227.17.21]:61664 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751476AbcJRTWT (ORCPT ); Tue, 18 Oct 2016 15:22:19 -0400 Subject: Re: [PATCH] staging: slicoss.ko: slicoss.c: Fixed incorrect argument type To: Ryan Swan , devel@driverdev.osuosl.org References: <1476813811-22988-1-git-send-email-ryan@ryanswan.com> Cc: liodot@gmail.com, charrer@alacritech.com, gregkh@linuxfoundation.org, bmarsh94@gmail.com, amarjargal.gundjalam@gmail.com, aquannie@gmail.com, janani.rvchndrn@gmail.com, kevin.m.wern@gmail.com, linux-kernel@vger.kernel.org From: Lino Sanfilippo Message-ID: <2d4bd18f-1e31-e62e-6ae4-d544bae933cd@gmx.de> Date: Tue, 18 Oct 2016 21:22:07 +0200 User-Agent: Mozilla/5.0 (X11; Linux i686; rv:45.0) Gecko/20100101 Thunderbird/45.3.0 MIME-Version: 1.0 In-Reply-To: <1476813811-22988-1-git-send-email-ryan@ryanswan.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:jW5xtyrJdsvLTQysdVz44Ftncq5BVZxHDyezobgA9RDKKqowaPW HospKAHYbyp/JO9+Z8RVIgpwWIDM4q0Vb30PoWBmy01DKhL3LJ9s7UuGJ8vlhOBXaZMn+0u 8YwuIt5ShS2XoWx3UKdq4AByiWleKzJIB6OxfSTA+VYQ4KPkEwXOhjxJBqFWY6eRWN2PYCq QvVyDJZaxT7t6g7GvqnMQ== X-UI-Out-Filterresults: notjunk:1;V01:K0:Wpg92+gio94=:5G95ewySTjM7Kwej9TWREA I15C11cyrqzIhJARq2jI34D5xmz4jBUKh5Nj0GmTF0pz1RlypnyGLffvSH/So+e/4upE8bA9l G7Gsx+FQfajv9Zd5U5997eye8yU72VBVoDZkEuqvnMC779yR5ZapfGJulxl/Bmq4Yo2hRPn0w vZvf2T2iPJE73WJNUgbzN2L2pPTC++o7xJx3JOnRJBJx1Fy4BGP9HLDbdFrk4Jwd3wOvdi+0v N+Ra6cOZUHaKlOtgXibsAf2OtPakZ3Qbe8kOqkoaRKsQqwhcQ4cGH57LnY9LiJ6FRBMfiCUDF o3QhusBC61wjf/EBnWbOBDjj+/kGO/22BaM/XHF7cYr9c+RedWqGQ4gkLPC+MB3+445bRZ6wa yEhYSUbAU6kQqkDqkp3sKQNzPPmRx7e6YNk+u90a6+xoOaOPTGIGvZyC+Vg9d0T/T72MLmRho 0o7Ovrtzvo0Wcc4p3rfPsjufk45LKVcbMRlee+R0cmoTkRYhhPZYnYDRhpvdVd6NTnXNs5NPX GTl5yqtxw0E7lMHO8JyZNRoXdgguBdIVHa1xWIn5S81gfSBxiJRlH66gx+lIgDzzsSjqXf4av R+WWwDHsvWM3UiFU0W/092MiQCTvqGayJHmbu71nVw+RJUGlJvVbkCxYyXXyR6KDj6Fvu+EyW GKBRC5LlSDkgUmlfWDkGmeC5pI3ihZGXV8awR1qk6iWbH5880R7PwbIQV7xypJb37H7FQBb4l ck+E9Lftl/a7iFvA/8D9ruzr+jaEioSXXn7yFmZoD6uULOe87B5+jvDJhh1xHAH9n2U/DJNo3 sMxgt3T Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1145 Lines: 35 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] *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)); > 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