Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1161089AbWBNU7I (ORCPT ); Tue, 14 Feb 2006 15:59:08 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1161099AbWBNU7I (ORCPT ); Tue, 14 Feb 2006 15:59:08 -0500 Received: from mail.suse.de ([195.135.220.2]:6022 "EHLO mx1.suse.de") by vger.kernel.org with ESMTP id S1161089AbWBNU7G (ORCPT ); Tue, 14 Feb 2006 15:59:06 -0500 Date: Tue, 14 Feb 2006 21:59:05 +0100 Message-ID: From: Takashi Iwai To: Mark Lord Cc: "linux-os (Dick Johnson)" , Andrew Morton , linux-kernel@vger.kernel.org Subject: Re: [PATCH] Add cast to __iomem pointer in scsi drivers In-Reply-To: <43F2419E.9060308@rtr.ca> References: <43F2419E.9060308@rtr.ca> User-Agent: Wanderlust/2.12.0 (Your Wildest Dreams) SEMI/1.14.6 (Maruoka) FLIM/1.14.7 (=?ISO-8859-4?Q?Sanj=F2?=) APEL/10.6 MULE XEmacs/21.5 (beta21) (corn) (+CVS-20050720) (i386-suse-linux) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1686 Lines: 43 At Tue, 14 Feb 2006 15:46:22 -0500, Mark Lord wrote: > > Takashi Iwai wrote: > > At Tue, 14 Feb 2006 15:35:29 -0500, > > linux-os (Dick Johnson) wrote: > >> > >> On Tue, 14 Feb 2006, Takashi Iwai wrote: > >> > >>> Add the missing cast to __iomem pointer in some scsi drivers. > .. > >>> -#define WROUTDOOR(adapter,value) writel(value, (adapter)->base + 0x2C) > ... > >>> +#define WROUTDOOR(adapter,value) writel(value, (void __iomem *)((adapter)->base + 0x2C)) > .. > >> With all these casts, doesn't it point out that something is wrong > >> with writel(), writew(), readl(), and readw() ??? The cast's to > >> volatile types should be within the macros, not scattered > >> throughout everyone's driver code! > > > > The patch is just for fixing compile warnings. > > > > readl(), writel() and co are inline functions, and they should be cast > > explicitly on the caller side. > > I think Linus's intent when he added the __iomem "feature", was that code > should change the underlying data declarations to match. So rather than > casting things left and right, and defeating compiler diagnostics by doing so, > perhaps the actual data type for "base" et al. should get changed to match. Yes, that'll be the best solution. But, in these drivers, the same struct fields are used for both inl() and writel() depending on the flag, so you cannot change the type. Hm, looks like I hit a dreadful case without a good solution. Takashi - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/