lkml.org 
[lkml]   [2019]   [Oct]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v8 1/5] kasan: support backing vmalloc space with real shadow memory
Daniel Axtens <dja@axtens.net> a écrit :

> Hi,
>
>>> /*
>>> * Find a place in the tree where VA potentially will be
>>> * inserted, unless it is merged with its sibling/siblings.
>>> @@ -741,6 +752,10 @@ merge_or_add_vmap_area(struct vmap_area *va,
>>> if (sibling->va_end == va->va_start) {
>>> sibling->va_end = va->va_end;
>>>
>>> + kasan_release_vmalloc(orig_start, orig_end,
>>> + sibling->va_start,
>>> + sibling->va_end);
>>> +
>> The same.
>
> The call to kasan_release_vmalloc() is a static inline no-op if
> CONFIG_KASAN_VMALLOC is not defined, which I thought was the preferred
> way to do things rather than sprinkling the code with ifdefs?
>
> The complier should be smart enough to eliminate all the
> orig_state/orig_end stuff at compile time because it can see that it's
> not used, so there's no cost in the binary.
>


Daniel,

You are entirely right in your way to do i, that's fully in line with
Linux kernel codying style
https://www.kernel.org/doc/html/latest/process/coding-style.html#conditional-compilation

Christophe

\
 
 \ /
  Last update: 2019-10-02 09:12    [W:0.057 / U:8.276 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site