From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: Tushar Dave <tushar.n.dave@oracle.com>,
martin.petersen@oracle.com, linux-scsi@vger.kernel.org,
thomas.tai@oracle.com, sparclinux@vger.kernel.org
Subject: Re: [PATCH] qlogicpti: Fix compiler warnings
Date: Wed, 23 Nov 2016 14:57:39 -0800 [thread overview]
Message-ID: <1479941859.2417.28.camel@HansenPartnership.com> (raw)
In-Reply-To: <1479936597-29061-1-git-send-email-tushar.n.dave@oracle.com>
On Wed, 2016-11-23 at 13:29 -0800, Tushar Dave wrote:
> qlogicpti uses '__u32' for dma handle while invoking kernel DMA APIs,
> instead of using dma_addr_t. This hasn't caused any 'incompatible
> pointer type' warning on SPARC because until now dma_addr_t is of
> type u32. However, recent changes in SPARC ATU (iommu) enabled 64bit
> DMA and therefore dma_addr_t became of type u64. This makes
> 'incompatible pointer type' warnings inevitable.
>
> e.g.
> drivers/scsi/qlogicpti.c: In function ‘qpti_map_queues’:
> drivers/scsi/qlogicpti.c:813: warning: passing argument 3 of
> ‘dma_alloc_coherent’ from incompatible pointer type
> ./include/linux/dma-mapping.h:445: note: expected ‘dma_addr_t *’ but
> argument is of type ‘__u32 *’
> drivers/scsi/qlogicpti.c:822: warning: passing argument 3 of
> ‘dma_alloc_coherent’ from incompatible pointer type
> ./include/linux/dma-mapping.h:445: note: expected ‘dma_addr_t *’ but
> argument is of type ‘__u32 *’
>
> This patch resolves above compiler warnings.
There appears to be no point to the first three hunks of this diff:
(ushort)(x << 16)
(ushort)(x & 0xffff)
return the same thing whether the type of x is u32 or u64, so there was
no need to alter the original code.
What's the guarantee, since the device descriptors only cope with 32
bits of physical address, that this driver never gets any dma address
beyond its addressable range? Is it that the sbus can never be
attached to this ATU type IOMMU? If so, saying that in the log would
be useful.
James
WARNING: multiple messages have this Message-ID (diff)
From: James Bottomley <James.Bottomley@HansenPartnership.com>
To: Tushar Dave <tushar.n.dave@oracle.com>,
martin.petersen@oracle.com, linux-scsi@vger.kernel.org,
thomas.tai@oracle.com, sparclinux@vger.kernel.org
Subject: Re: [PATCH] qlogicpti: Fix compiler warnings
Date: Wed, 23 Nov 2016 22:57:39 +0000 [thread overview]
Message-ID: <1479941859.2417.28.camel@HansenPartnership.com> (raw)
In-Reply-To: <1479936597-29061-1-git-send-email-tushar.n.dave@oracle.com>
On Wed, 2016-11-23 at 13:29 -0800, Tushar Dave wrote:
> qlogicpti uses '__u32' for dma handle while invoking kernel DMA APIs,
> instead of using dma_addr_t. This hasn't caused any 'incompatible
> pointer type' warning on SPARC because until now dma_addr_t is of
> type u32. However, recent changes in SPARC ATU (iommu) enabled 64bit
> DMA and therefore dma_addr_t became of type u64. This makes
> 'incompatible pointer type' warnings inevitable.
>
> e.g.
> drivers/scsi/qlogicpti.c: In function ‘qpti_map_queues’:
> drivers/scsi/qlogicpti.c:813: warning: passing argument 3 of
> ‘dma_alloc_coherent’ from incompatible pointer type
> ./include/linux/dma-mapping.h:445: note: expected ‘dma_addr_t *’ but
> argument is of type ‘__u32 *’
> drivers/scsi/qlogicpti.c:822: warning: passing argument 3 of
> ‘dma_alloc_coherent’ from incompatible pointer type
> ./include/linux/dma-mapping.h:445: note: expected ‘dma_addr_t *’ but
> argument is of type ‘__u32 *’
>
> This patch resolves above compiler warnings.
There appears to be no point to the first three hunks of this diff:
(ushort)(x << 16)
(ushort)(x & 0xffff)
return the same thing whether the type of x is u32 or u64, so there was
no need to alter the original code.
What's the guarantee, since the device descriptors only cope with 32
bits of physical address, that this driver never gets any dma address
beyond its addressable range? Is it that the sbus can never be
attached to this ATU type IOMMU? If so, saying that in the log would
be useful.
James
next prev parent reply other threads:[~2016-11-23 22:57 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-11-23 21:29 [PATCH] qlogicpti: Fix compiler warnings Tushar Dave
2016-11-23 21:29 ` Tushar Dave
2016-11-23 22:57 ` James Bottomley [this message]
2016-11-23 22:57 ` James Bottomley
2016-11-24 1:08 ` tndave
2016-11-24 1:08 ` tndave
2016-11-24 1:25 ` David Miller
2016-11-24 1:25 ` David Miller
2016-11-24 1:44 ` tndave
2016-11-24 1:44 ` tndave
2016-11-24 1:24 ` David Miller
2016-11-24 1:24 ` David Miller
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=1479941859.2417.28.camel@HansenPartnership.com \
--to=james.bottomley@hansenpartnership.com \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
--cc=sparclinux@vger.kernel.org \
--cc=thomas.tai@oracle.com \
--cc=tushar.n.dave@oracle.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.