From: "Leizhen (ThunderTown)" <thunder.leizhen@huawei.com>
To: One Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Marek Szyprowski <m.szyprowski@samsung.com>,
Will Deacon <will.deacon@arm.com>,
linux-kernel <linux-kernel@vger.kernel.org>,
Zefan Li <lizefan@huawei.com>, Xinwei Hu <huxinwei@huawei.com>,
Tianhong Ding <dingtianhong@huawei.com>,
Hanjun Guo <guohanjun@huawei.com>
Subject: Re: [PATCH 1/1] dma-mapping: to avoid exception when cpu_addr is NULL
Date: Mon, 7 Mar 2016 20:22:00 +0800 [thread overview]
Message-ID: <56DD7268.6030503@huawei.com> (raw)
In-Reply-To: <20160307114116.54160865@lxorguk.ukuu.org.uk>
On 2016/3/7 19:41, One Thousand Gnomes wrote:
> On Mon, 7 Mar 2016 17:21:25 +0800
> Zhen Lei <thunder.leizhen@huawei.com> wrote:
>
>> Do this to keep consistent with kfree, which tolerate ptr is NULL.
>>
>> Signed-off-by: Zhen Lei <thunder.leizhen@huawei.com>
>
> This is inlined code so you are adding extra logic to every single
> instance of a call to the function. What is it's total effect on kernel
> size ?
This a simple if statement, I think it will only generates two instructions.
Maybe I need move it into function dma_free_attrs, as below:
if (!ops->free || !cpu_addr)
return;
So that, it only generates one instruction. And dma_free_noncoherent can also be impacted.
Or I changed it to BUG_ON(!cpu_addr)?
Otherwise, I move it into ops->free, but that maybe more ARCHs.
>
> Alan
>
> .
>
prev parent reply other threads:[~2016-03-07 12:26 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-07 9:21 [PATCH 1/1] dma-mapping: to avoid exception when cpu_addr is NULL Zhen Lei
2016-03-07 10:43 ` Leizhen (ThunderTown)
2016-03-07 22:59 ` Andrew Morton
2016-03-08 1:32 ` Leizhen (ThunderTown)
2016-03-07 11:41 ` One Thousand Gnomes
2016-03-07 12:22 ` Leizhen (ThunderTown) [this message]
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=56DD7268.6030503@huawei.com \
--to=thunder.leizhen@huawei.com \
--cc=akpm@linux-foundation.org \
--cc=dingtianhong@huawei.com \
--cc=gnomes@lxorguk.ukuu.org.uk \
--cc=guohanjun@huawei.com \
--cc=huxinwei@huawei.com \
--cc=linux-kernel@vger.kernel.org \
--cc=lizefan@huawei.com \
--cc=m.szyprowski@samsung.com \
--cc=will.deacon@arm.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