lkml.org 
[lkml]   [2015]   [Nov]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] tree wide: Use kvfree() than conditional kfree()/vfree()
From
On Sun, Nov 8, 2015 at 7:04 AM, Tetsuo Handa
<penguin-kernel@i-love.sakura.ne.jp> wrote:
> Andy Shevchenko wrote:
>> Like Joe noticed you have left few places like
>> void my_func_kvfree(arg)
>> {
>> kvfree(arg);
>> }
>>
>> Might make sense to remove them completely, especially in case when
>> you have changed the callers.
>
> I think we should stop at
>
> #define my_func_kvfree(arg) kvfree(arg)

I don't think it's a good idea.

>
> in case someone want to add some code in future.

…then leave them to decide what to do, no? Trying to hunt the problem
which rather will not happen.

>
> Also, we might want to add a helper that does vmalloc() when
> kmalloc() failed because locations that do
>
> ptr = kmalloc(size, GFP_NOFS);
> if (!ptr)
> ptr = vmalloc(size); /* Wrong because GFP_KERNEL is used implicitly */
>
> are found.

Another patch like Sergey suggested.

>
>> One more thought. Might be good to provide a coccinelle script for
>> such places? Julia?
>
> Welcome. I'm sure I'm missing some locations.



--
With Best Regards,
Andy Shevchenko


\
 
 \ /
  Last update: 2015-11-08 22:01    [W:0.057 / U:0.092 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site