All of lore.kernel.org
 help / color / mirror / Atom feed
From: michal.simek@xilinx.com (Michal Simek)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] net: ll_temac: Fix DMA map size bug
Date: Tue, 12 May 2015 08:06:31 +0200	[thread overview]
Message-ID: <55519867.2090205@xilinx.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1505120801390.2075@localhost6.localdomain6>

On 05/12/2015 08:03 AM, Julia Lawall wrote:
> On Tue, 12 May 2015, Michal Simek wrote:
> 
>> DMA allocates skb->len instead of headlen
>> which is used for DMA.
>>
>> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
>> ---
>>
>>  drivers/net/ethernet/xilinx/ll_temac_main.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/xilinx/ll_temac_main.c b/drivers/net/ethernet/xilinx/ll_temac_main.c
>> index ca640d04fd93..cfb6bdb37fdc 100644
>> --- a/drivers/net/ethernet/xilinx/ll_temac_main.c
>> +++ b/drivers/net/ethernet/xilinx/ll_temac_main.c
>> @@ -705,8 +705,8 @@ static int temac_start_xmit(struct sk_buff *skb, struct net_device *ndev)
>>  
>>  	cur_p->app0 |= STS_CTRL_APP0_SOP;
>>  	cur_p->len = skb_headlen(skb);
>> -	cur_p->phys = dma_map_single(ndev->dev.parent, skb->data, skb->len,
>> -				     DMA_TO_DEVICE);
>> +	cur_p->phys = dma_map_single(ndev->dev.parent, skb->data,
>> +				skb_headlen(skb), DMA_TO_DEVICE);
> 
> I think you could align the later arguments with the right side of the 
> parenthesis, as done in the original code.

Fixed and send v2.

Thanks,
Michal

WARNING: multiple messages have this Message-ID (diff)
From: Michal Simek <michal.simek@xilinx.com>
To: Julia Lawall <julia.lawall@lip6.fr>,
	Michal Simek <michal.simek@xilinx.com>
Cc: netdev@vger.kernel.org,
	"Sören Brinkmann" <soren.brinkmann@xilinx.com>,
	monstr@monstr.eu, "Fabian Frederick" <fabf@skynet.be>,
	linux-kernel@vger.kernel.org,
	"David S. Miller" <davem@davemloft.net>,
	"Manuel Schölling" <manuel.schoelling@gmx.de>,
	"Markus Elfring" <elfring@users.sourceforge.net>,
	"Subbaraya Sundeep Bhatta" <subbaraya.sundeep.bhatta@xilinx.com>,
	linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] net: ll_temac: Fix DMA map size bug
Date: Tue, 12 May 2015 08:06:31 +0200	[thread overview]
Message-ID: <55519867.2090205@xilinx.com> (raw)
In-Reply-To: <alpine.DEB.2.02.1505120801390.2075@localhost6.localdomain6>

On 05/12/2015 08:03 AM, Julia Lawall wrote:
> On Tue, 12 May 2015, Michal Simek wrote:
> 
>> DMA allocates skb->len instead of headlen
>> which is used for DMA.
>>
>> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
>> ---
>>
>>  drivers/net/ethernet/xilinx/ll_temac_main.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/net/ethernet/xilinx/ll_temac_main.c b/drivers/net/ethernet/xilinx/ll_temac_main.c
>> index ca640d04fd93..cfb6bdb37fdc 100644
>> --- a/drivers/net/ethernet/xilinx/ll_temac_main.c
>> +++ b/drivers/net/ethernet/xilinx/ll_temac_main.c
>> @@ -705,8 +705,8 @@ static int temac_start_xmit(struct sk_buff *skb, struct net_device *ndev)
>>  
>>  	cur_p->app0 |= STS_CTRL_APP0_SOP;
>>  	cur_p->len = skb_headlen(skb);
>> -	cur_p->phys = dma_map_single(ndev->dev.parent, skb->data, skb->len,
>> -				     DMA_TO_DEVICE);
>> +	cur_p->phys = dma_map_single(ndev->dev.parent, skb->data,
>> +				skb_headlen(skb), DMA_TO_DEVICE);
> 
> I think you could align the later arguments with the right side of the 
> parenthesis, as done in the original code.

Fixed and send v2.

Thanks,
Michal


  reply	other threads:[~2015-05-12  6:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-12  5:58 [PATCH] net: ll_temac: Fix DMA map size bug Michal Simek
2015-05-12  5:58 ` Michal Simek
2015-05-12  6:03 ` Julia Lawall
2015-05-12  6:03   ` Julia Lawall
2015-05-12  6:06   ` Michal Simek [this message]
2015-05-12  6:06     ` Michal Simek

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=55519867.2090205@xilinx.com \
    --to=michal.simek@xilinx.com \
    --cc=linux-arm-kernel@lists.infradead.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 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.