Distributed Replicated Block Device (DRBD) development
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: "Ruan Jinjie" <ruanjinjie@huawei.com>,
	linux-block@vger.kernel.org, drbd-dev@lists.linbit.com,
	"Philipp Reisner" <philipp.reisner@linbit.com>,
	"Lars Ellenberg" <lars.ellenberg@linbit.com>,
	"Christoph Böhmwalder" <christoph.boehmwalder@linbit.com>
Subject: Re: [Drbd-dev] [PATCH -next] drbd: Use helper put_drbd_dev() and get_drbd_dev()
Date: Tue, 8 Aug 2023 11:36:51 -0600	[thread overview]
Message-ID: <5e560155-b2a4-e5bd-d22e-0e44a5a85f43@kernel.dk> (raw)
In-Reply-To: <20230808090111.2420717-1-ruanjinjie@huawei.com>

On 8/8/23 3:01 AM, Ruan Jinjie wrote:
> The drbd_destroy_device() arg of this code is already duplicated
> 18 times, use helper function put_drbd_dev() to release drbd_device
> and related resources instead of open coding it to help improve
> code readability a bit.
> 
> And add get_drbd_dev() helper function to be symmetrical with it.
> 
> No functional change involved.

IMHO this just makes the code harder to read. You're not adding a
helper, all it does is call the same get/put parts. Why not just keep
it as-is then?

-- 
Jens Axboe



  reply	other threads:[~2023-08-08 17:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-08  9:01 [Drbd-dev] [PATCH -next] drbd: Use helper put_drbd_dev() and get_drbd_dev() Ruan Jinjie
2023-08-08 17:36 ` Jens Axboe [this message]
2023-08-09  1:32   ` Ruan Jinjie

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=5e560155-b2a4-e5bd-d22e-0e44a5a85f43@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=christoph.boehmwalder@linbit.com \
    --cc=drbd-dev@lists.linbit.com \
    --cc=lars.ellenberg@linbit.com \
    --cc=linux-block@vger.kernel.org \
    --cc=philipp.reisner@linbit.com \
    --cc=ruanjinjie@huawei.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox