[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <28357e74-88d3-4382-ab2e-4058de185a18@huawei.com>
Date: Fri, 6 Dec 2024 10:13:46 +0800
From: chenridong <chenridong@...wei.com>
To: Daniel Jordan <daniel.m.jordan@...cle.com>, Chen Ridong
<chenridong@...weicloud.com>
CC: <steffen.klassert@...unet.com>, <herbert@...dor.apana.org.au>,
<linux-crypto@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<wangweiyang2@...wei.com>
Subject: Re: [PATCH 1/2] padata: add pd get/put refcnt helper
On 2024/12/6 7:03, Daniel Jordan wrote:
> On Sat, Nov 23, 2024 at 08:05:08AM +0000, Chen Ridong wrote:
>> From: Chen Ridong <chenridong@...wei.com>
>>
>> Add helpers for pd to get/put refcnt to make code consice.
>
> Seems reasonable.
>
>> +static inline void padata_put_pd(struct parallel_data *pd)
>> +{
>> + if (refcount_dec_and_test(&pd->refcnt))
>> + padata_free_pd(pd);
>> +}
>> +
>> +static inline void padata_put_pd_cnt(struct parallel_data *pd, int cnt)
>> +{
>> + if (refcount_sub_and_test(cnt, &pd->refcnt))
>> + padata_free_pd(pd);
>> +}
>
> padata_put_pd could be defined as padata_put_pd_cnt(pd, 1).
>
Thank you, will update.
Best regards,
Ridong
Powered by blists - more mailing lists