lkml.org 
[lkml]   [2019]   [Apr]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 01/18] drivers core: Add I/O ASID allocator
On Tue, Apr 09, 2019 at 01:00:49PM +0300, Andriy Shevchenko wrote:
> I think it makes sense to add a helper macro to rcupdate.h
> (and we have several cases in kernel that can utilize it)
>
> #define kfree_non_null_rcu(ptr, rcu_head) \
> do { \
> if (ptr) \
> kfree_rcu(ptr, rcu_head); \
> } while (0)
>
> as a more common pattern for resource deallocators.

I think that should move straight into kfree_rcu. In general
we expect *free* to deal with NULL pointers transparently, so we
should do so here as well.

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