linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Miller <davem@davemloft.net>
To: grygorii.strashko@ti.com
Cc: netdev@vger.kernel.org, ivan.khoronzhuk@linaro.org,
	nsekhar@ti.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] net: ethernet: ti: davinci_cpdma: fix warning "device driver frees DMA memory with different size"
Date: Wed, 04 Dec 2019 12:37:18 -0800 (PST)	[thread overview]
Message-ID: <20191204.123718.1152659362924451799.davem@davemloft.net> (raw)
In-Reply-To: <20191204165029.9264-1-grygorii.strashko@ti.com>

From: Grygorii Strashko <grygorii.strashko@ti.com>
Date: Wed, 4 Dec 2019 18:50:29 +0200

> @@ -1018,7 +1018,7 @@ static int cpdma_chan_submit_si(struct submit_info *si)
>  	struct cpdma_chan		*chan = si->chan;
>  	struct cpdma_ctlr		*ctlr = chan->ctlr;
>  	int				len = si->len;
> -	int				swlen = len;
> +	int				swlen;
>  	struct cpdma_desc __iomem	*desc;
>  	dma_addr_t			buffer;
>  	u32				mode;
> @@ -1040,6 +1040,7 @@ static int cpdma_chan_submit_si(struct submit_info *si)
>  		chan->stats.runt_transmit_buff++;
>  	}
>  
> +	swlen = len;
>  	mode = CPDMA_DESC_OWNER | CPDMA_DESC_SOP | CPDMA_DESC_EOP;
>  	cpdma_desc_to_port(chan, mode, si->directed);
>  
> -- 
> 2.17.1
> 

Now there is no reason to keep a separate swlen variable.

The integral value is always consumed as the length before the descriptor bits
are added to it.

Therefore you can just use 'len' everywhere in this function now.

  reply	other threads:[~2019-12-04 20:37 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-04 16:50 [PATCH v2] net: ethernet: ti: davinci_cpdma: fix warning "device driver frees DMA memory with different size" Grygorii Strashko
2019-12-04 20:37 ` David Miller [this message]
2019-12-05 10:48   ` Grygorii Strashko
2019-12-07 11:44     ` Ivan Khoronzhuk
2019-12-07 12:02       ` Ivan Khoronzhuk
2019-12-07 19:50         ` 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=20191204.123718.1152659362924451799.davem@davemloft.net \
    --to=davem@davemloft.net \
    --cc=grygorii.strashko@ti.com \
    --cc=ivan.khoronzhuk@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=nsekhar@ti.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).