Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2277517ybl; Sat, 7 Dec 2019 11:52:14 -0800 (PST) X-Google-Smtp-Source: APXvYqwg2L4AL9KoAobrjMR0diOf73KnqCCqm+eKIoxl+3G9ZTmumyU4qDazbsY5wUFNr4Zy+i+E X-Received: by 2002:a9d:6745:: with SMTP id w5mr15509637otm.221.1575748334052; Sat, 07 Dec 2019 11:52:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575748334; cv=none; d=google.com; s=arc-20160816; b=iNvQjxJaljY0GstakN+u/emU1K7S5LXfBUeQzg2RJOP0lex7GuUtuXUgJKqit4FT1z 3/XVJjT3AsIONthYKKS2m8uj0JddLwlbY7El3n0RlQurg6DVpPRa23qxSN4yew2kfj0m 4CPEmu/4xFWXtMw4iqKSC5qibxUB9yeWEIvv/mxYkoSzGt908OAHPpkTkmEXaJyzJKYY ZpksE00ydpjOvnWAVNqUviviaAOuOGjp9FGFZRbsMA37HXuJWLxd90A4+OMuwFgdmVWT OlIHqkhyx+edA1ytlhsZ/g4Ay3XZhRDm4JHN1UaH3CpMNrQF6JNs0+odObL0bfnO1wGc iIIA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:from:subject:cc:to:message-id:date; bh=lWlmQvIWzTR3Dw3S4s+V6meDHixkilbDxedxeHcvkps=; b=oNQNOloaL1hVUQIIzdNzceZ9B4f33rAAdeyxYEVazOig/PknaoJbRhN7gmHMgvXPbT OVUeP+UWA3U/XvtVO4uDyQr8FyiCdRF5tk92JqubxDnlNeE+mouuUnuILAOF9NELMxku dr3rNNbVPLaeCSsf6simgSV46Yf4jmrPNfqWQJaRS/msSnaO1lJ57/m+zX6VixpUGmQk 7zZXPd/5NL2pCluEO76Zc96mMVRLhwlca8+GoiumdJEuVWif/eW9v0lPNO+R0nWOjHq3 OUgLwGYcMgyi9GcgXL9aJDn4bEbpNhG+hfacBs7wLRcmaTdrjHtcJ4IS8tt3PDzfU1Mf PyLg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id p124si9464540oib.57.2019.12.07.11.52.01; Sat, 07 Dec 2019 11:52:14 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726794AbfLGTuj (ORCPT + 99 others); Sat, 7 Dec 2019 14:50:39 -0500 Received: from shards.monkeyblade.net ([23.128.96.9]:42728 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726489AbfLGTui (ORCPT ); Sat, 7 Dec 2019 14:50:38 -0500 Received: from localhost (unknown [IPv6:2601:601:9f00:1c3::3d5]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id DD65515413555; Sat, 7 Dec 2019 11:50:37 -0800 (PST) Date: Sat, 07 Dec 2019 11:50:34 -0800 (PST) Message-Id: <20191207.115034.1743579700466281633.davem@davemloft.net> To: ivan.khoronzhuk@linaro.org Cc: grygorii.strashko@ti.com, netdev@vger.kernel.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" From: David Miller In-Reply-To: <20191207120238.GB2798@khorivan> References: <0c6b88b2-31b1-11f0-7baa-1ecd5f4b6644@ti.com> <20191207114419.GA2798@khorivan> <20191207120238.GB2798@khorivan> X-Mailer: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Sat, 07 Dec 2019 11:50:38 -0800 (PST) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ivan Khoronzhuk 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....