diff mbox

dma: mv_xor: Silence a bunch of LPAE-related warnings

Message ID 1391476403-26099-1-git-send-email-olof@lixom.net (mailing list archive)
State Accepted
Commit 31fd8f5b89f2
Delegated to: Vinod Koul
Headers show

Commit Message

Olof Johansson Feb. 4, 2014, 1:13 a.m. UTC
Enabling some of the mvebu platforms in the multiplatform config for ARM
enabled these drivers, which also triggered a bunch of warnings when LPAE
is enabled (thus making phys_addr_t 64-bit).

Most changes are switching printk formats, but also a bit of changes to what
used to be array-based pointer arithmetic that could just be done with the
address types instead.

The warnings were:

drivers/dma/mv_xor.c: In function 'mv_xor_tx_submit':
drivers/dma/mv_xor.c:500:3: warning: format '%x' expects argument of type
    'unsigned int', but argument 4 has type 'dma_addr_t' [-Wformat]
drivers/dma/mv_xor.c: In function 'mv_xor_alloc_chan_resources':
drivers/dma/mv_xor.c:553:13: warning: cast to pointer from integer of
    different size [-Wint-to-pointer-cast]
drivers/dma/mv_xor.c:555:4: warning: cast from pointer to integer of
    different size [-Wpointer-to-int-cast]
drivers/dma/mv_xor.c: In function 'mv_xor_prep_dma_memcpy':
drivers/dma/mv_xor.c:584:2: warning: format '%x' expects argument of type
    'unsigned int', but argument 5 has type 'dma_addr_t' [-Wformat]
drivers/dma/mv_xor.c:584:2: warning: format '%x' expects argument of type
    'unsigned int', but argument 6 has type 'dma_addr_t' [-Wformat]
drivers/dma/mv_xor.c: In function 'mv_xor_prep_dma_xor':
drivers/dma/mv_xor.c:628:2: warning: format '%u' expects argument of type
    'unsigned int', but argument 7 has type 'dma_addr_t' [-Wformat]

Signed-off-by: Olof Johansson <olof@lixom.net>
---
 drivers/dma/mv_xor.c | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

Comments

Vinod Koul Feb. 4, 2014, 5:23 a.m. UTC | #1
On Mon, Feb 03, 2014 at 05:13:23PM -0800, Olof Johansson wrote:
> Enabling some of the mvebu platforms in the multiplatform config for ARM
> enabled these drivers, which also triggered a bunch of warnings when LPAE
> is enabled (thus making phys_addr_t 64-bit).
> 
> Most changes are switching printk formats, but also a bit of changes to what
> used to be array-based pointer arithmetic that could just be done with the
> address types instead.
> 
> The warnings were:
> 
> drivers/dma/mv_xor.c: In function 'mv_xor_tx_submit':
> drivers/dma/mv_xor.c:500:3: warning: format '%x' expects argument of type
>     'unsigned int', but argument 4 has type 'dma_addr_t' [-Wformat]
> drivers/dma/mv_xor.c: In function 'mv_xor_alloc_chan_resources':
> drivers/dma/mv_xor.c:553:13: warning: cast to pointer from integer of
>     different size [-Wint-to-pointer-cast]
> drivers/dma/mv_xor.c:555:4: warning: cast from pointer to integer of
>     different size [-Wpointer-to-int-cast]
> drivers/dma/mv_xor.c: In function 'mv_xor_prep_dma_memcpy':
> drivers/dma/mv_xor.c:584:2: warning: format '%x' expects argument of type
>     'unsigned int', but argument 5 has type 'dma_addr_t' [-Wformat]
> drivers/dma/mv_xor.c:584:2: warning: format '%x' expects argument of type
>     'unsigned int', but argument 6 has type 'dma_addr_t' [-Wformat]
> drivers/dma/mv_xor.c: In function 'mv_xor_prep_dma_xor':
> drivers/dma/mv_xor.c:628:2: warning: format '%u' expects argument of type
>     'unsigned int', but argument 7 has type 'dma_addr_t' [-Wformat]
> 
> Signed-off-by: Olof Johansson <olof@lixom.net>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Jason Cooper Feb. 4, 2014, 5 p.m. UTC | #2
On Tue, Feb 04, 2014 at 10:53:29AM +0530, Vinod Koul wrote:
> On Mon, Feb 03, 2014 at 05:13:23PM -0800, Olof Johansson wrote:
> > Enabling some of the mvebu platforms in the multiplatform config for ARM
> > enabled these drivers, which also triggered a bunch of warnings when LPAE
> > is enabled (thus making phys_addr_t 64-bit).
> > 
> > Most changes are switching printk formats, but also a bit of changes to what
> > used to be array-based pointer arithmetic that could just be done with the
> > address types instead.
> > 
> > The warnings were:
> > 
> > drivers/dma/mv_xor.c: In function 'mv_xor_tx_submit':
> > drivers/dma/mv_xor.c:500:3: warning: format '%x' expects argument of type
> >     'unsigned int', but argument 4 has type 'dma_addr_t' [-Wformat]
> > drivers/dma/mv_xor.c: In function 'mv_xor_alloc_chan_resources':
> > drivers/dma/mv_xor.c:553:13: warning: cast to pointer from integer of
> >     different size [-Wint-to-pointer-cast]
> > drivers/dma/mv_xor.c:555:4: warning: cast from pointer to integer of
> >     different size [-Wpointer-to-int-cast]
> > drivers/dma/mv_xor.c: In function 'mv_xor_prep_dma_memcpy':
> > drivers/dma/mv_xor.c:584:2: warning: format '%x' expects argument of type
> >     'unsigned int', but argument 5 has type 'dma_addr_t' [-Wformat]
> > drivers/dma/mv_xor.c:584:2: warning: format '%x' expects argument of type
> >     'unsigned int', but argument 6 has type 'dma_addr_t' [-Wformat]
> > drivers/dma/mv_xor.c: In function 'mv_xor_prep_dma_xor':
> > drivers/dma/mv_xor.c:628:2: warning: format '%u' expects argument of type
> >     'unsigned int', but argument 7 has type 'dma_addr_t' [-Wformat]
> > 
> > Signed-off-by: Olof Johansson <olof@lixom.net>
> Acked-by: Vinod Koul <vinod.koul@intel.com>

Olof, would you like me to queue it up?  Or do you want to take it
directly?

Acked-by: Jason Cooper <jason@lakedaemon.net>

thx,

Jason.

> > ---
> >  drivers/dma/mv_xor.c | 24 ++++++++++++------------
> >  1 file changed, 12 insertions(+), 12 deletions(-)
> > 
> > diff --git a/drivers/dma/mv_xor.c b/drivers/dma/mv_xor.c
> > index 53fb0c8365b0..766b68ed505c 100644
> > --- a/drivers/dma/mv_xor.c
> > +++ b/drivers/dma/mv_xor.c
> > @@ -497,8 +497,8 @@ mv_xor_tx_submit(struct dma_async_tx_descriptor *tx)
> >  		if (!mv_can_chain(grp_start))
> >  			goto submit_done;
> >  
> > -		dev_dbg(mv_chan_to_devp(mv_chan), "Append to last desc %x\n",
> > -			old_chain_tail->async_tx.phys);
> > +		dev_dbg(mv_chan_to_devp(mv_chan), "Append to last desc %pa\n",
> > +			&old_chain_tail->async_tx.phys);
> >  
> >  		/* fix up the hardware chain */
> >  		mv_desc_set_next_desc(old_chain_tail, grp_start->async_tx.phys);
> > @@ -527,7 +527,8 @@ submit_done:
> >  /* returns the number of allocated descriptors */
> >  static int mv_xor_alloc_chan_resources(struct dma_chan *chan)
> >  {
> > -	char *hw_desc;
> > +	void *virt_desc;
> > +	dma_addr_t dma_desc;
> >  	int idx;
> >  	struct mv_xor_chan *mv_chan = to_mv_xor_chan(chan);
> >  	struct mv_xor_desc_slot *slot = NULL;
> > @@ -542,17 +543,16 @@ static int mv_xor_alloc_chan_resources(struct dma_chan *chan)
> >  				" %d descriptor slots", idx);
> >  			break;
> >  		}
> > -		hw_desc = (char *) mv_chan->dma_desc_pool_virt;
> > -		slot->hw_desc = (void *) &hw_desc[idx * MV_XOR_SLOT_SIZE];
> > +		virt_desc = mv_chan->dma_desc_pool_virt;
> > +		slot->hw_desc = virt_desc + idx * MV_XOR_SLOT_SIZE;
> >  
> >  		dma_async_tx_descriptor_init(&slot->async_tx, chan);
> >  		slot->async_tx.tx_submit = mv_xor_tx_submit;
> >  		INIT_LIST_HEAD(&slot->chain_node);
> >  		INIT_LIST_HEAD(&slot->slot_node);
> >  		INIT_LIST_HEAD(&slot->tx_list);
> > -		hw_desc = (char *) mv_chan->dma_desc_pool;
> > -		slot->async_tx.phys =
> > -			(dma_addr_t) &hw_desc[idx * MV_XOR_SLOT_SIZE];
> > +		dma_desc = mv_chan->dma_desc_pool;
> > +		slot->async_tx.phys = dma_desc + idx * MV_XOR_SLOT_SIZE;
> >  		slot->idx = idx++;
> >  
> >  		spin_lock_bh(&mv_chan->lock);
> > @@ -582,8 +582,8 @@ mv_xor_prep_dma_memcpy(struct dma_chan *chan, dma_addr_t dest, dma_addr_t src,
> >  	int slot_cnt;
> >  
> >  	dev_dbg(mv_chan_to_devp(mv_chan),
> > -		"%s dest: %x src %x len: %u flags: %ld\n",
> > -		__func__, dest, src, len, flags);
> > +		"%s dest: %pad src %pad len: %u flags: %ld\n",
> > +		__func__, &dest, &src, len, flags);
> >  	if (unlikely(len < MV_XOR_MIN_BYTE_COUNT))
> >  		return NULL;
> >  
> > @@ -626,8 +626,8 @@ mv_xor_prep_dma_xor(struct dma_chan *chan, dma_addr_t dest, dma_addr_t *src,
> >  	BUG_ON(len > MV_XOR_MAX_BYTE_COUNT);
> >  
> >  	dev_dbg(mv_chan_to_devp(mv_chan),
> > -		"%s src_cnt: %d len: dest %x %u flags: %ld\n",
> > -		__func__, src_cnt, len, dest, flags);
> > +		"%s src_cnt: %d len: %u dest %pad flags: %ld\n",
> > +		__func__, src_cnt, len, &dest, flags);
> >  
> >  	spin_lock_bh(&mv_chan->lock);
> >  	slot_cnt = mv_chan_xor_slot_count(len, src_cnt);
> > -- 
> > 1.8.4.1.601.g02b3b1d
> > 
> > --
> > To unsubscribe from this list: send the line "unsubscribe dmaengine" in
> > the body of a message to majordomo@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> -- 
> 
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
--
To unsubscribe from this list: send the line "unsubscribe dmaengine" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Olof Johansson Feb. 4, 2014, 6:30 p.m. UTC | #3
On Tue, Feb 4, 2014 at 9:00 AM, Jason Cooper <jason@lakedaemon.net> wrote:
> On Tue, Feb 04, 2014 at 10:53:29AM +0530, Vinod Koul wrote:
>> On Mon, Feb 03, 2014 at 05:13:23PM -0800, Olof Johansson wrote:
>> > Enabling some of the mvebu platforms in the multiplatform config for ARM
>> > enabled these drivers, which also triggered a bunch of warnings when LPAE
>> > is enabled (thus making phys_addr_t 64-bit).
>> >
>> > Most changes are switching printk formats, but also a bit of changes to what
>> > used to be array-based pointer arithmetic that could just be done with the
>> > address types instead.
>> >
>> > The warnings were:
>> >
>> > drivers/dma/mv_xor.c: In function 'mv_xor_tx_submit':
>> > drivers/dma/mv_xor.c:500:3: warning: format '%x' expects argument of type
>> >     'unsigned int', but argument 4 has type 'dma_addr_t' [-Wformat]
>> > drivers/dma/mv_xor.c: In function 'mv_xor_alloc_chan_resources':
>> > drivers/dma/mv_xor.c:553:13: warning: cast to pointer from integer of
>> >     different size [-Wint-to-pointer-cast]
>> > drivers/dma/mv_xor.c:555:4: warning: cast from pointer to integer of
>> >     different size [-Wpointer-to-int-cast]
>> > drivers/dma/mv_xor.c: In function 'mv_xor_prep_dma_memcpy':
>> > drivers/dma/mv_xor.c:584:2: warning: format '%x' expects argument of type
>> >     'unsigned int', but argument 5 has type 'dma_addr_t' [-Wformat]
>> > drivers/dma/mv_xor.c:584:2: warning: format '%x' expects argument of type
>> >     'unsigned int', but argument 6 has type 'dma_addr_t' [-Wformat]
>> > drivers/dma/mv_xor.c: In function 'mv_xor_prep_dma_xor':
>> > drivers/dma/mv_xor.c:628:2: warning: format '%u' expects argument of type
>> >     'unsigned int', but argument 7 has type 'dma_addr_t' [-Wformat]
>> >
>> > Signed-off-by: Olof Johansson <olof@lixom.net>
>> Acked-by: Vinod Koul <vinod.koul@intel.com>
>
> Olof, would you like me to queue it up?  Or do you want to take it
> directly?
>
> Acked-by: Jason Cooper <jason@lakedaemon.net>

I'm confused. I sent the patch to the drivers/dma maintainers and they
just acked it without asking me to pick it up myself.

Vinod, did you ack it for me to pick it up, or for some other reason?
If you don't want to take it through your tree I'll be happy to take
it through arm-soc, just looking to clarify.

(Jason, I can apply it directly)


-Olof
--
To unsubscribe from this list: send the line "unsubscribe dmaengine" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Dan Williams Feb. 4, 2014, 6:57 p.m. UTC | #4
On Tue, Feb 4, 2014 at 10:30 AM, Olof Johansson <olof@lixom.net> wrote:
> On Tue, Feb 4, 2014 at 9:00 AM, Jason Cooper <jason@lakedaemon.net> wrote:
>> On Tue, Feb 04, 2014 at 10:53:29AM +0530, Vinod Koul wrote:
>>> On Mon, Feb 03, 2014 at 05:13:23PM -0800, Olof Johansson wrote:
>>> > Enabling some of the mvebu platforms in the multiplatform config for ARM
>>> > enabled these drivers, which also triggered a bunch of warnings when LPAE
>>> > is enabled (thus making phys_addr_t 64-bit).
>>> >
>>> > Most changes are switching printk formats, but also a bit of changes to what
>>> > used to be array-based pointer arithmetic that could just be done with the
>>> > address types instead.
>>> >
>>> > The warnings were:
>>> >
>>> > drivers/dma/mv_xor.c: In function 'mv_xor_tx_submit':
>>> > drivers/dma/mv_xor.c:500:3: warning: format '%x' expects argument of type
>>> >     'unsigned int', but argument 4 has type 'dma_addr_t' [-Wformat]
>>> > drivers/dma/mv_xor.c: In function 'mv_xor_alloc_chan_resources':
>>> > drivers/dma/mv_xor.c:553:13: warning: cast to pointer from integer of
>>> >     different size [-Wint-to-pointer-cast]
>>> > drivers/dma/mv_xor.c:555:4: warning: cast from pointer to integer of
>>> >     different size [-Wpointer-to-int-cast]
>>> > drivers/dma/mv_xor.c: In function 'mv_xor_prep_dma_memcpy':
>>> > drivers/dma/mv_xor.c:584:2: warning: format '%x' expects argument of type
>>> >     'unsigned int', but argument 5 has type 'dma_addr_t' [-Wformat]
>>> > drivers/dma/mv_xor.c:584:2: warning: format '%x' expects argument of type
>>> >     'unsigned int', but argument 6 has type 'dma_addr_t' [-Wformat]
>>> > drivers/dma/mv_xor.c: In function 'mv_xor_prep_dma_xor':
>>> > drivers/dma/mv_xor.c:628:2: warning: format '%u' expects argument of type
>>> >     'unsigned int', but argument 7 has type 'dma_addr_t' [-Wformat]
>>> >
>>> > Signed-off-by: Olof Johansson <olof@lixom.net>
>>> Acked-by: Vinod Koul <vinod.koul@intel.com>
>>
>> Olof, would you like me to queue it up?  Or do you want to take it
>> directly?
>>
>> Acked-by: Jason Cooper <jason@lakedaemon.net>
>
> I'm confused. I sent the patch to the drivers/dma maintainers and they
> just acked it without asking me to pick it up myself.
>
> Vinod, did you ack it for me to pick it up, or for some other reason?
> If you don't want to take it through your tree I'll be happy to take
> it through arm-soc, just looking to clarify.
>
> (Jason, I can apply it directly)

Vinod will correct me if I am wrong, but I take his acks to mean "yup,
take it through your tree".  For this specific problem I thought we
had a comprehensive fix pending from Joe Perches to add a new %pX
format specifier for dma addresses?
--
To unsubscribe from this list: send the line "unsubscribe dmaengine" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Dan Williams Feb. 4, 2014, 6:58 p.m. UTC | #5
On Tue, Feb 4, 2014 at 10:57 AM, Dan Williams <dan.j.williams@intel.com> wrote:
> On Tue, Feb 4, 2014 at 10:30 AM, Olof Johansson <olof@lixom.net> wrote:
>> On Tue, Feb 4, 2014 at 9:00 AM, Jason Cooper <jason@lakedaemon.net> wrote:
>>> On Tue, Feb 04, 2014 at 10:53:29AM +0530, Vinod Koul wrote:
>>>> On Mon, Feb 03, 2014 at 05:13:23PM -0800, Olof Johansson wrote:
>>>> > Enabling some of the mvebu platforms in the multiplatform config for ARM
>>>> > enabled these drivers, which also triggered a bunch of warnings when LPAE
>>>> > is enabled (thus making phys_addr_t 64-bit).
>>>> >
>>>> > Most changes are switching printk formats, but also a bit of changes to what
>>>> > used to be array-based pointer arithmetic that could just be done with the
>>>> > address types instead.
>>>> >
>>>> > The warnings were:
>>>> >
>>>> > drivers/dma/mv_xor.c: In function 'mv_xor_tx_submit':
>>>> > drivers/dma/mv_xor.c:500:3: warning: format '%x' expects argument of type
>>>> >     'unsigned int', but argument 4 has type 'dma_addr_t' [-Wformat]
>>>> > drivers/dma/mv_xor.c: In function 'mv_xor_alloc_chan_resources':
>>>> > drivers/dma/mv_xor.c:553:13: warning: cast to pointer from integer of
>>>> >     different size [-Wint-to-pointer-cast]
>>>> > drivers/dma/mv_xor.c:555:4: warning: cast from pointer to integer of
>>>> >     different size [-Wpointer-to-int-cast]
>>>> > drivers/dma/mv_xor.c: In function 'mv_xor_prep_dma_memcpy':
>>>> > drivers/dma/mv_xor.c:584:2: warning: format '%x' expects argument of type
>>>> >     'unsigned int', but argument 5 has type 'dma_addr_t' [-Wformat]
>>>> > drivers/dma/mv_xor.c:584:2: warning: format '%x' expects argument of type
>>>> >     'unsigned int', but argument 6 has type 'dma_addr_t' [-Wformat]
>>>> > drivers/dma/mv_xor.c: In function 'mv_xor_prep_dma_xor':
>>>> > drivers/dma/mv_xor.c:628:2: warning: format '%u' expects argument of type
>>>> >     'unsigned int', but argument 7 has type 'dma_addr_t' [-Wformat]
>>>> >
>>>> > Signed-off-by: Olof Johansson <olof@lixom.net>
>>>> Acked-by: Vinod Koul <vinod.koul@intel.com>
>>>
>>> Olof, would you like me to queue it up?  Or do you want to take it
>>> directly?
>>>
>>> Acked-by: Jason Cooper <jason@lakedaemon.net>
>>
>> I'm confused. I sent the patch to the drivers/dma maintainers and they
>> just acked it without asking me to pick it up myself.
>>
>> Vinod, did you ack it for me to pick it up, or for some other reason?
>> If you don't want to take it through your tree I'll be happy to take
>> it through arm-soc, just looking to clarify.
>>
>> (Jason, I can apply it directly)
>
> Vinod will correct me if I am wrong, but I take his acks to mean "yup,
> take it through your tree".  For this specific problem I thought we
> had a comprehensive fix pending from Joe Perches to add a new %pX
> format specifier for dma addresses?

Never mind... that's what you are using.  Sorry for the noise.
--
To unsubscribe from this list: send the line "unsubscribe dmaengine" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Olof Johansson Feb. 4, 2014, 9:56 p.m. UTC | #6
On Tue, Feb 4, 2014 at 10:57 AM, Dan Williams <dan.j.williams@intel.com> wrote:
> On Tue, Feb 4, 2014 at 10:30 AM, Olof Johansson <olof@lixom.net> wrote:
>> On Tue, Feb 4, 2014 at 9:00 AM, Jason Cooper <jason@lakedaemon.net> wrote:
>>> On Tue, Feb 04, 2014 at 10:53:29AM +0530, Vinod Koul wrote:
>>>> On Mon, Feb 03, 2014 at 05:13:23PM -0800, Olof Johansson wrote:
>>>> > Enabling some of the mvebu platforms in the multiplatform config for ARM
>>>> > enabled these drivers, which also triggered a bunch of warnings when LPAE
>>>> > is enabled (thus making phys_addr_t 64-bit).
>>>> >
>>>> > Most changes are switching printk formats, but also a bit of changes to what
>>>> > used to be array-based pointer arithmetic that could just be done with the
>>>> > address types instead.
>>>> >
>>>> > The warnings were:
>>>> >
>>>> > drivers/dma/mv_xor.c: In function 'mv_xor_tx_submit':
>>>> > drivers/dma/mv_xor.c:500:3: warning: format '%x' expects argument of type
>>>> >     'unsigned int', but argument 4 has type 'dma_addr_t' [-Wformat]
>>>> > drivers/dma/mv_xor.c: In function 'mv_xor_alloc_chan_resources':
>>>> > drivers/dma/mv_xor.c:553:13: warning: cast to pointer from integer of
>>>> >     different size [-Wint-to-pointer-cast]
>>>> > drivers/dma/mv_xor.c:555:4: warning: cast from pointer to integer of
>>>> >     different size [-Wpointer-to-int-cast]
>>>> > drivers/dma/mv_xor.c: In function 'mv_xor_prep_dma_memcpy':
>>>> > drivers/dma/mv_xor.c:584:2: warning: format '%x' expects argument of type
>>>> >     'unsigned int', but argument 5 has type 'dma_addr_t' [-Wformat]
>>>> > drivers/dma/mv_xor.c:584:2: warning: format '%x' expects argument of type
>>>> >     'unsigned int', but argument 6 has type 'dma_addr_t' [-Wformat]
>>>> > drivers/dma/mv_xor.c: In function 'mv_xor_prep_dma_xor':
>>>> > drivers/dma/mv_xor.c:628:2: warning: format '%u' expects argument of type
>>>> >     'unsigned int', but argument 7 has type 'dma_addr_t' [-Wformat]
>>>> >
>>>> > Signed-off-by: Olof Johansson <olof@lixom.net>
>>>> Acked-by: Vinod Koul <vinod.koul@intel.com>
>>>
>>> Olof, would you like me to queue it up?  Or do you want to take it
>>> directly?
>>>
>>> Acked-by: Jason Cooper <jason@lakedaemon.net>
>>
>> I'm confused. I sent the patch to the drivers/dma maintainers and they
>> just acked it without asking me to pick it up myself.
>>
>> Vinod, did you ack it for me to pick it up, or for some other reason?
>> If you don't want to take it through your tree I'll be happy to take
>> it through arm-soc, just looking to clarify.
>>
>> (Jason, I can apply it directly)
>
> Vinod will correct me if I am wrong, but I take his acks to mean "yup,
> take it through your tree".

Ok, thanks, we'll do that then.


-Olof
--
To unsubscribe from this list: send the line "unsubscribe dmaengine" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Olof Johansson Feb. 12, 2014, 9:58 p.m. UTC | #7
On Tue, Feb 04, 2014 at 10:58:31AM -0800, Dan Williams wrote:
> On Tue, Feb 4, 2014 at 10:57 AM, Dan Williams <dan.j.williams@intel.com> wrote:
> > On Tue, Feb 4, 2014 at 10:30 AM, Olof Johansson <olof@lixom.net> wrote:
> >> On Tue, Feb 4, 2014 at 9:00 AM, Jason Cooper <jason@lakedaemon.net> wrote:
> >>> On Tue, Feb 04, 2014 at 10:53:29AM +0530, Vinod Koul wrote:
> >>>> On Mon, Feb 03, 2014 at 05:13:23PM -0800, Olof Johansson wrote:
> >>>> > Enabling some of the mvebu platforms in the multiplatform config for ARM
> >>>> > enabled these drivers, which also triggered a bunch of warnings when LPAE
> >>>> > is enabled (thus making phys_addr_t 64-bit).
> >>>> >
> >>>> > Most changes are switching printk formats, but also a bit of changes to what
> >>>> > used to be array-based pointer arithmetic that could just be done with the
> >>>> > address types instead.
> >>>> >
> >>>> > The warnings were:
> >>>> >
> >>>> > drivers/dma/mv_xor.c: In function 'mv_xor_tx_submit':
> >>>> > drivers/dma/mv_xor.c:500:3: warning: format '%x' expects argument of type
> >>>> >     'unsigned int', but argument 4 has type 'dma_addr_t' [-Wformat]
> >>>> > drivers/dma/mv_xor.c: In function 'mv_xor_alloc_chan_resources':
> >>>> > drivers/dma/mv_xor.c:553:13: warning: cast to pointer from integer of
> >>>> >     different size [-Wint-to-pointer-cast]
> >>>> > drivers/dma/mv_xor.c:555:4: warning: cast from pointer to integer of
> >>>> >     different size [-Wpointer-to-int-cast]
> >>>> > drivers/dma/mv_xor.c: In function 'mv_xor_prep_dma_memcpy':
> >>>> > drivers/dma/mv_xor.c:584:2: warning: format '%x' expects argument of type
> >>>> >     'unsigned int', but argument 5 has type 'dma_addr_t' [-Wformat]
> >>>> > drivers/dma/mv_xor.c:584:2: warning: format '%x' expects argument of type
> >>>> >     'unsigned int', but argument 6 has type 'dma_addr_t' [-Wformat]
> >>>> > drivers/dma/mv_xor.c: In function 'mv_xor_prep_dma_xor':
> >>>> > drivers/dma/mv_xor.c:628:2: warning: format '%u' expects argument of type
> >>>> >     'unsigned int', but argument 7 has type 'dma_addr_t' [-Wformat]
> >>>> >
> >>>> > Signed-off-by: Olof Johansson <olof@lixom.net>
> >>>> Acked-by: Vinod Koul <vinod.koul@intel.com>
> >>>
> >>> Olof, would you like me to queue it up?  Or do you want to take it
> >>> directly?
> >>>
> >>> Acked-by: Jason Cooper <jason@lakedaemon.net>
> >>
> >> I'm confused. I sent the patch to the drivers/dma maintainers and they
> >> just acked it without asking me to pick it up myself.
> >>
> >> Vinod, did you ack it for me to pick it up, or for some other reason?
> >> If you don't want to take it through your tree I'll be happy to take
> >> it through arm-soc, just looking to clarify.
> >>
> >> (Jason, I can apply it directly)
> >
> > Vinod will correct me if I am wrong, but I take his acks to mean "yup,
> > take it through your tree".  For this specific problem I thought we
> > had a comprehensive fix pending from Joe Perches to add a new %pX
> > format specifier for dma addresses?
> 
> Never mind... that's what you are using.  Sorry for the noise.

Yep. Applied now, btw.


-Olof
--
To unsubscribe from this list: send the line "unsubscribe dmaengine" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/dma/mv_xor.c b/drivers/dma/mv_xor.c
index 53fb0c8365b0..766b68ed505c 100644
--- a/drivers/dma/mv_xor.c
+++ b/drivers/dma/mv_xor.c
@@ -497,8 +497,8 @@  mv_xor_tx_submit(struct dma_async_tx_descriptor *tx)
 		if (!mv_can_chain(grp_start))
 			goto submit_done;
 
-		dev_dbg(mv_chan_to_devp(mv_chan), "Append to last desc %x\n",
-			old_chain_tail->async_tx.phys);
+		dev_dbg(mv_chan_to_devp(mv_chan), "Append to last desc %pa\n",
+			&old_chain_tail->async_tx.phys);
 
 		/* fix up the hardware chain */
 		mv_desc_set_next_desc(old_chain_tail, grp_start->async_tx.phys);
@@ -527,7 +527,8 @@  submit_done:
 /* returns the number of allocated descriptors */
 static int mv_xor_alloc_chan_resources(struct dma_chan *chan)
 {
-	char *hw_desc;
+	void *virt_desc;
+	dma_addr_t dma_desc;
 	int idx;
 	struct mv_xor_chan *mv_chan = to_mv_xor_chan(chan);
 	struct mv_xor_desc_slot *slot = NULL;
@@ -542,17 +543,16 @@  static int mv_xor_alloc_chan_resources(struct dma_chan *chan)
 				" %d descriptor slots", idx);
 			break;
 		}
-		hw_desc = (char *) mv_chan->dma_desc_pool_virt;
-		slot->hw_desc = (void *) &hw_desc[idx * MV_XOR_SLOT_SIZE];
+		virt_desc = mv_chan->dma_desc_pool_virt;
+		slot->hw_desc = virt_desc + idx * MV_XOR_SLOT_SIZE;
 
 		dma_async_tx_descriptor_init(&slot->async_tx, chan);
 		slot->async_tx.tx_submit = mv_xor_tx_submit;
 		INIT_LIST_HEAD(&slot->chain_node);
 		INIT_LIST_HEAD(&slot->slot_node);
 		INIT_LIST_HEAD(&slot->tx_list);
-		hw_desc = (char *) mv_chan->dma_desc_pool;
-		slot->async_tx.phys =
-			(dma_addr_t) &hw_desc[idx * MV_XOR_SLOT_SIZE];
+		dma_desc = mv_chan->dma_desc_pool;
+		slot->async_tx.phys = dma_desc + idx * MV_XOR_SLOT_SIZE;
 		slot->idx = idx++;
 
 		spin_lock_bh(&mv_chan->lock);
@@ -582,8 +582,8 @@  mv_xor_prep_dma_memcpy(struct dma_chan *chan, dma_addr_t dest, dma_addr_t src,
 	int slot_cnt;
 
 	dev_dbg(mv_chan_to_devp(mv_chan),
-		"%s dest: %x src %x len: %u flags: %ld\n",
-		__func__, dest, src, len, flags);
+		"%s dest: %pad src %pad len: %u flags: %ld\n",
+		__func__, &dest, &src, len, flags);
 	if (unlikely(len < MV_XOR_MIN_BYTE_COUNT))
 		return NULL;
 
@@ -626,8 +626,8 @@  mv_xor_prep_dma_xor(struct dma_chan *chan, dma_addr_t dest, dma_addr_t *src,
 	BUG_ON(len > MV_XOR_MAX_BYTE_COUNT);
 
 	dev_dbg(mv_chan_to_devp(mv_chan),
-		"%s src_cnt: %d len: dest %x %u flags: %ld\n",
-		__func__, src_cnt, len, dest, flags);
+		"%s src_cnt: %d len: %u dest %pad flags: %ld\n",
+		__func__, src_cnt, len, &dest, flags);
 
 	spin_lock_bh(&mv_chan->lock);
 	slot_cnt = mv_chan_xor_slot_count(len, src_cnt);