Re: [PATCH v2] net: ethernet: ti: davinci_cpdma: fix warning "device driver frees DMA memory with different size"
From: David Miller
Date: Sat Dec 07 2019 - 14:50:43 EST
From: Ivan Khoronzhuk <ivan.khoronzhuk@xxxxxxxxxx>
Date: Sat, 7 Dec 2019 14:02:39 +0200
> @@ -1046,7 +1045,6 @@ static int cpdma_chan_submit_si(struct
> submit_info *si)
> if (si->data_dma) {
> buffer = si->data_dma;
> dma_sync_single_for_device(ctlr->dev, buffer, len, chan->dir);
> - swlen |= CPDMA_DMA_EXT_MAP;
> } else {
> buffer = dma_map_single(ctlr->dev, si->data_virt, len, chan->dir);
> ret = dma_mapping_error(ctlr->dev, buffer);
> @@ -1065,7 +1063,7 @@ static int cpdma_chan_submit_si(struct
> submit_info *si)
> writel_relaxed(mode | len, &desc->hw_mode);
> writel_relaxed((uintptr_t)si->token, &desc->sw_token);
> writel_relaxed(buffer, &desc->sw_buffer);
> - writel_relaxed(swlen, &desc->sw_len);
> + writel_relaxed(si->data_dma ? len | CPDMA_DMA_EXT_MAP : len,
> &desc->sw_len);
> desc_read(desc, sw_len);
>
> __cpdma_chan_submit(chan, desc);
>
> But it's branched twice then.
It's a conditional move rather than a branch....