From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S268916AbUJKNQZ (ORCPT ); Mon, 11 Oct 2004 09:16:25 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S268915AbUJKNQY (ORCPT ); Mon, 11 Oct 2004 09:16:24 -0400 Received: from parcelfarce.linux.theplanet.co.uk ([195.92.249.252]:40583 "EHLO www.linux.org.uk") by vger.kernel.org with ESMTP id S268916AbUJKNQF (ORCPT ); Mon, 11 Oct 2004 09:16:05 -0400 Date: Mon, 11 Oct 2004 14:16:03 +0100 From: viro@parcelfarce.linux.theplanet.co.uk To: Cal Peake Cc: Jan Dittmer , Kernel Mailing List , NetDev Mailing List , proski@gnu.org, hermes@gibson.dropbear.id.au Subject: Re: [PATCH] Fix readw/writew warnings in drivers/net/wireless/hermes.h Message-ID: <20041011131603.GU23987@parcelfarce.linux.theplanet.co.uk> References: <416A7484.1030703@portrix.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.1i Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Oct 11, 2004 at 08:23:35AM -0400, Cal Peake wrote: > On Mon, 11 Oct 2004, Jan Dittmer wrote: > > > Cal Peake wrote: > > > > > inw((hw)->iobase + ( (off) << (hw)->reg_spacing )) : \ > > > - readw((hw)->iobase + ( (off) << (hw)->reg_spacing ))) > > > + readw((void __iomem *)(hw)->iobase + ( (off) << (hw)->reg_spacing ))) > > > #define hermes_write_reg(hw, off, val) do { \ > > > > Isn't the correct fix to declare iobase as (void __iomem *) ? > > iobase is an unsigned long, declaring it as a void pointer is prolly not > what we want to do here. The typecast seems proper. A lot of other drivers > do this as well thus it must be proper ;-) Typecast is not a proper solution here. Folks, there are cleanups underway for all that mess, but it's not _that_ simple. And adding casts to shut the warnings up is wrong in 99% of cases.