All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tobias Klauser <tklauser@distanz.ch>
To: David Herrmann <dh.herrmann@gmail.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Daniel Mack <daniel@zonque.org>,
	David Herrmann <dh.herrmann@googlemail.com>,
	Djalal Harouni <tixxdz@opendz.org>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] kdbus: Make kdbus_bus_unref() return void
Date: Wed, 22 Apr 2015 14:12:19 +0200	[thread overview]
Message-ID: <20150422121219.GC17830@distanz.ch> (raw)
In-Reply-To: <CANq1E4SnYpxUJ3dDyCCYh=mXtE8kW8g_20xsUX-0W+CgNhNutg@mail.gmail.com>

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 :(

      reply	other threads:[~2015-04-22 12:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-22 11:50 [PATCH] kdbus: Make kdbus_bus_unref() return void Tobias Klauser
2015-04-22 12:01 ` David Herrmann
2015-04-22 12:12   ` Tobias Klauser [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150422121219.GC17830@distanz.ch \
    --to=tklauser@distanz.ch \
    --cc=daniel@zonque.org \
    --cc=dh.herrmann@gmail.com \
    --cc=dh.herrmann@googlemail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tixxdz@opendz.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.