Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754351AbcKOSV4 (ORCPT ); Tue, 15 Nov 2016 13:21:56 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:56036 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750928AbcKOSVz (ORCPT ); Tue, 15 Nov 2016 13:21:55 -0500 Date: Tue, 15 Nov 2016 19:22:05 +0100 From: Greg KH To: Sergio Paracuellos Cc: devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, liodot@gmail.com, charrer@alacritech.com Subject: Re: [PATCH] staging: slicoss: fix different address space warnings Message-ID: <20161115182205.GA11024@kroah.com> References: <1479230377-22861-1-git-send-email-sergio.paracuellos@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1479230377-22861-1-git-send-email-sergio.paracuellos@gmail.com> User-Agent: Mutt/1.7.1 (2016-10-04) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1135 Lines: 31 On Tue, Nov 15, 2016 at 06:19:37PM +0100, Sergio Paracuellos wrote: > This patch fix the following sparse warnings in slicoss driver: > warning: incorrect type in assignment (different address spaces) > > Signed-off-by: Sergio Paracuellos > --- > drivers/staging/slicoss/slic.h | 7 ++++ > drivers/staging/slicoss/slicoss.c | 83 ++++++++++++++++++++++----------------- > 2 files changed, 55 insertions(+), 35 deletions(-) > > diff --git a/drivers/staging/slicoss/slic.h b/drivers/staging/slicoss/slic.h > index 420546d..f76c0cd 100644 > --- a/drivers/staging/slicoss/slic.h > +++ b/drivers/staging/slicoss/slic.h > @@ -540,6 +540,13 @@ static inline void slic_flush_write(struct adapter *adapter) > ioread32(adapter->regs + SLIC_REG_HOSTID); > } > > +#define IOMEM_GET_FIELDADDR(base, member) \ > +({ \ > + char __iomem *_base = (char __iomem *)base; \ > + _base += offsetof(typeof(*base), member); \ > + (void __iomem *)_base; \ > +}) Really? Why? Shouldn't you be marking base as __iomem all the time? That way you don't need this mess of a cast. thanks, greg k-h