mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Mark Lord <lkml@rtr.ca>
Cc: "linux-os (Dick Johnson)" <linux-os@analogic.com>,
	Andrew Morton <akpm@osdl.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Add cast to __iomem pointer in scsi drivers
Date: Tue, 14 Feb 2006 21:59:05 +0100	[thread overview]
Message-ID: <s5hslqlac86.wl%tiwai@suse.de> (raw)
In-Reply-To: <43F2419E.9060308@rtr.ca>

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

  reply	other threads:[~2006-02-14 20:59 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-14 20:13 Takashi Iwai
2006-02-14 20:35 ` linux-os (Dick Johnson)
2006-02-14 20:40   ` Takashi Iwai
2006-02-14 20:46     ` Mark Lord
2006-02-14 20:59       ` Takashi Iwai [this message]
2006-02-14 21:03         ` Russell King
2006-02-14 21:05         ` Al Viro
2006-02-14 21:14           ` Takashi Iwai
2006-02-14 21:17             ` Al Viro
2006-02-14 20:40 ` Al Viro

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=s5hslqlac86.wl%tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-os@analogic.com \
    --cc=lkml@rtr.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome