lkml.org 
[lkml]   [2015]   [Apr]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] kdbus: Make kdbus_bus_unref() return void
On 2015-04-22 at 14:01:05 +0200, David Herrmann <dh.herrmann@gmail.com> wrote:
> Hi
>
> On Wed, Apr 22, 2015 at 1:50 PM, Tobias Klauser <tklauser@distanz.ch> wrote:
> > kdbus_bus_unref() always returns NULL and none of its callers use the
> > return value, so make it return void.
> >
> > Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
>
> All our destructors return NULL, which allows simple assignment during
> destruction:
> foo->bus = kdbus_bus_unref(foo->bus);
> And our destructors ignore NULL, so no reason to conditionalize the
> call to unref(). This simplifies our error-paths a lot, and I'd like
> to keep it that way.

Thanks for the explanation. I didn't consider this - and didn't even
look at the other *_unref() for that matter :(


\
 
 \ /
  Last update: 2015-04-22 14:21    [W:0.047 / U:16.764 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site