From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by mail19.linbit.com (LINBIT Mail Daemon) with ESMTP id 5CB8A42019F for ; Wed, 9 Aug 2023 03:32:11 +0200 (CEST) Message-ID: Date: Wed, 9 Aug 2023 09:32:08 +0800 MIME-Version: 1.0 Content-Language: en-US To: Jens Axboe , , , Philipp Reisner , Lars Ellenberg , =?UTF-8?Q?Christoph_B=c3=b6hmwalder?= References: <20230808090111.2420717-1-ruanjinjie@huawei.com> <5e560155-b2a4-e5bd-d22e-0e44a5a85f43@kernel.dk> From: Ruan Jinjie In-Reply-To: <5e560155-b2a4-e5bd-d22e-0e44a5a85f43@kernel.dk> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8bit Subject: Re: [Drbd-dev] [PATCH -next] drbd: Use helper put_drbd_dev() and get_drbd_dev() List-Id: "*Coordination* of development, patches, contributions -- *Questions* \(even to developers\) go to drbd-user, please." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , On 2023/8/9 1:36, Jens Axboe wrote: > 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? Sorry, I misunderstood the meaning of a helper.I'll learn more about what other helper patches are doing. It's okay to keep it as it is. >