From: Russell King <rmk+lkml@arm.linux.org.uk>
To: Stefan Roas <sroas@roath.org>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH]: Fix compiler warning in drivers/scsi/dpt_i2o.c
Date: Mon, 14 Mar 2005 23:26:53 +0000 [thread overview]
Message-ID: <20050314232653.B4705@flint.arm.linux.org.uk> (raw)
In-Reply-To: <20050314200626.GD1733@roath.org>; from sroas@roath.org on Mon, Mar 14, 2005 at 09:06:26PM +0100
On Mon, Mar 14, 2005 at 09:06:26PM +0100, Stefan Roas wrote:
> On Mon Mar 14, 2005 at 18:24:44, Ben Dooks wrote:
>
> > This patch looks suspiciously like it is sweeping the problem
> > `under the carpet`. Does bus_to_virt() return an `void __iomem *`?
> >
> > reply should really be an `void __iomem *`
>
> bus_to_virt returns void *.
>
> adpt_isr casts the return value to ulong though and adpt_i2o_to_scsi
> takes an ulong as its first argument and passes it to readl without a
> cast then.
>
> But I agree, the patch just silences the compiler warning. Maybe it
> would be a better solution to change the types of reply and msg in
> adpt_isr as well as the first argument to adpt_i2o_to_scsi to void
> __iomem *.
However, bus_to_virt() can only be used on addresses which correspond
with system RAM. readl and friends should not be used on such a memory
space. So, this driver is doing lots of bogus stuff.
The warnings are perfectly valid and should therefore stay.
If "reply" is actually referring to some system memory, the readl/writel
shouldn't be there, and we should be accessing system memory directly
via a bona-fide structure. If it isn't, then the bus_to_virt() is
completely bogus and unportable, and that's where we _must_ raise a
warning.
However, I do agree with changing "msg" to be void __iomem *, and
removing the (ulong) cast, since pHba->msg_addr_virt is already
void __iomem *.
(note: I'm just taking a passing interest in this thread, from the
point of view of an architecture maintainer who wants these types of
things to be Correct(tm)...)
--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of: 2.6 Serial core
prev parent reply other threads:[~2005-03-14 23:27 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-03-13 22:43 [PATCH]: Fix compiler warning in drivers/scsi/dpt_i2o.c Stefan Roas
2005-03-14 18:24 ` Ben Dooks
2005-03-14 20:06 ` Stefan Roas
2005-03-14 23:26 ` Russell King [this message]
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=20050314232653.B4705@flint.arm.linux.org.uk \
--to=rmk+lkml@arm.linux.org.uk \
--cc=linux-kernel@vger.kernel.org \
--cc=sroas@roath.org \
/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