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 03:04:36AM -0700, Christoph Hellwig wrote:
> 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.

Possible. I didn't dare to offer this due to lack of knowledge how it's used in
other places.

> In general
> we expect *free* to deal with NULL pointers transparently, so we
> should do so here as well.

Exactly my point, thanks.

--
With Best Regards,
Andy Shevchenko


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