[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20150422121219.GC17830@distanz.ch>
Date: Wed, 22 Apr 2015 14:12:19 +0200
From: Tobias Klauser <tklauser@...tanz.ch>
To: David Herrmann <dh.herrmann@...il.com>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Daniel Mack <daniel@...que.org>,
David Herrmann <dh.herrmann@...glemail.com>,
Djalal Harouni <tixxdz@...ndz.org>,
linux-kernel <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] kdbus: Make kdbus_bus_unref() return void
On 2015-04-22 at 14:01:05 +0200, David Herrmann <dh.herrmann@...il.com> wrote:
> Hi
>
> On Wed, Apr 22, 2015 at 1:50 PM, Tobias Klauser <tklauser@...tanz.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@...tanz.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 :(
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists