Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S938503AbcKPIde (ORCPT ); Wed, 16 Nov 2016 03:33:34 -0500 Received: from mail-yw0-f194.google.com ([209.85.161.194]:33183 "EHLO mail-yw0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936556AbcKPId2 (ORCPT ); Wed, 16 Nov 2016 03:33:28 -0500 MIME-Version: 1.0 In-Reply-To: <20161116070543.GA11164@kroah.com> References: <1479269257-5913-1-git-send-email-sergio.paracuellos@gmail.com> <20161116070543.GA11164@kroah.com> From: Sergio Paracuellos Date: Wed, 16 Nov 2016 09:33:26 +0100 Message-ID: Subject: Re: [PATCH v2] staging: slicoss: fix different address space warnings To: Greg KH Cc: devel@driverdev.osuosl.org, linux-kernel , Lior Dotan Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1717 Lines: 57 On Wed, Nov 16, 2016 at 8:05 AM, Greg KH wrote: > 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 >> --- >> 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 thank you for your clarification, Greg. I'll send a v3 patchset with the two patches. Cheers, Sergio Paracuellos