Re: [PATCH v8 04/12] SIW connection management

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



-----"Jason Gunthorpe" <jgg@xxxxxxxx> wrote: -----

>To: "Bernard Metzler" <BMT@xxxxxxxxxxxxxx>
>From: "Jason Gunthorpe" <jgg@xxxxxxxx>
>Date: 05/07/2019 05:44PM
>Cc: "Leon Romanovsky" <leon@xxxxxxxxxx>, linux-rdma@xxxxxxxxxxxxxxx
>Subject: Re: [PATCH v8 04/12] SIW connection management
>
>On Tue, May 07, 2019 at 03:21:28PM +0000, Bernard Metzler wrote:
>
>> >> +void siw_cep_put(struct siw_cep *cep)
>> >> +{
>> >> +	siw_dbg_cep(cep, "new refcount: %d\n", kref_read(&cep->ref) -
>1);
>> >> +
>> >> +	WARN_ON(kref_read(&cep->ref) < 1);
>> >> +	kref_put(&cep->ref, __siw_cep_dealloc);
>> >> +}
>> >> +
>> >> +void siw_cep_get(struct siw_cep *cep)
>> >> +{
>> >> +	kref_get(&cep->ref);
>> >> +	siw_dbg_cep(cep, "new refcount: %d\n", kref_read(&cep->ref));
>> >> +}
>> >
>> >Another kref_get/put wrappers, unlikely needed.
>> >
>> It just avoids writing down the free routine in each
>> put call, and I used it to add some debug info for
>> tracking status. So I would remove it if it you tell me it's
>> bad style...
>
>It is common to have a put wrapper and thus usually a symetrically
>named get wrapepr - this is so the free function is done consistently
>
>The debugging might be over doing it
>

Yes, agreed, I am going to drop that debugging stuff.




[Index of Archives]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Photo]     [Yosemite News]     [Yosemite Photos]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux