lkml.org 
[lkml]   [2016]   [Mar]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 1/1] dma-mapping: to avoid exception when cpu_addr is NULL
From
Date


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
>
> .
>

\
 
 \ /
  Last update: 2016-03-07 14:01    [W:0.303 / U:0.624 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site