[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20201201123921.2009cbea@coco.lan>
Date: Tue, 1 Dec 2020 12:39:21 +0100
From: Mauro Carvalho Chehab <mchehab+huawei@...nel.org>
To: Jason Gunthorpe <jgg@...dia.com>
Cc: Linux Doc Mailing List <linux-doc@...r.kernel.org>,
"Gustavo A. R. Silva" <gustavoars@...nel.org>,
HÃ¥kon Bugge <haakon.bugge@...cle.com>,
Jonathan Corbet <corbet@....net>,
Bart Van Assche <bvanassche@....org>,
Chuck Lever <chuck.lever@...cle.com>,
Danit Goldberg <danitg@...lanox.com>,
Dennis Dalessandro <dennis.dalessandro@...nelisnetworks.com>,
Divya Indi <divya.indi@...cle.com>,
Doug Ledford <dledford@...hat.com>,
Gal Pressman <galpress@...zon.com>,
Leon Romanovsky <leon@...nel.org>,
Maor Gottlieb <maorg@...lanox.com>,
Max Gurtovoy <mgurtovoy@...dia.com>,
Mike Marciniszyn <mike.marciniszyn@...nelisnetworks.com>,
Moni Shoua <monis@...lanox.com>,
"Or Gerlitz" <ogerlitz@...lanox.com>,
Parav Pandit <parav@...lanox.com>,
"Sagi Grimberg" <sagi@...mberg.me>,
Ursula Braun <ubraun@...ux.ibm.com>,
Xi Wang <wangxi11@...wei.com>,
Yamin Friedman <yaminf@...lanox.com>,
<linux-kernel@...r.kernel.org>, <linux-rdma@...r.kernel.org>,
<target-devel@...r.kernel.org>
Subject: Re: [PATCH v4 07/27] IB: fix kernel-doc markups
Em Mon, 23 Nov 2020 19:45:42 -0400
Jason Gunthorpe <jgg@...dia.com> escreveu:
> On Mon, Nov 16, 2020 at 11:18:03AM +0100, Mauro Carvalho Chehab wrote:
>
> > +/**
> > + * ib_alloc_pd - Allocates an unused protection domain.
> > + * @device: The device on which to allocate the protection domain.
> > + * @flags: protection domain flags
> > + *
> > + * A protection domain object provides an association between QPs, shared
> > + * receive queues, address handles, memory regions, and memory windows.
> > + *
> > + * Every PD has a local_dma_lkey which can be used as the lkey value for local
> > + * memory operations.
> > + */
> > #define ib_alloc_pd(device, flags) \
> > __ib_alloc_pd((device), (flags), KBUILD_MODNAME)
>
> Why this hunk adding a completely new description in this patch?
In order to document ib_alloc_pd().
See, currently, verbs.c has this kernel-doc markup:
/**
* ib_alloc_pd - Allocates an unused protection domain.
* @device: The device on which to allocate the protection domain.
* @flags: protection domain flags
* @caller: caller's build-time module name
*
* A protection domain object provides an association between QPs, shared
* receive queues, address handles, memory regions, and memory windows.
*
* Every PD has a local_dma_lkey which can be used as the lkey value for local
* memory operations.
*/
struct ib_pd *__ib_alloc_pd(struct ib_device *device, unsigned int flags,
const char *caller)
Which doesn't actually work as expected, as kernel-doc will, instead,
document __ib_alloc_pd():
$ ./scripts/kernel-doc -sphinx-version 3.1 -function ib_alloc_pd drivers/infiniband/core/verbs.c
drivers/infiniband/core/verbs.c:1: warning: 'ib_alloc_pd' not found
$ ./scripts/kernel-doc -sphinx-version 3.1 -function __ib_alloc_pd drivers/infiniband/core/verbs.c
.. c:function:: struct ib_pd * __ib_alloc_pd (struct ib_device *device, unsigned int flags, const char *caller)
Allocates an unused protection domain.
**Parameters**
``struct ib_device *device``
The device on which to allocate the protection domain.
``unsigned int flags``
protection domain flags
``const char *caller``
caller's build-time module name
**Description**
A protection domain object provides an association between QPs, shared
receive queues, address handles, memory regions, and memory windows.
Every PD has a local_dma_lkey which can be used as the lkey value for local
memory operations.
So, what this patch does is to fix the kernel-doc markup at verbs.c for
it to reflect the function that it is documented, adding a new markup for
ib_alloc_pd(), which is identical to __ib_alloc_pd(), except for the
@caller field, which is set to KBUILD_MODNAME by this macro.
Thanks,
Mauro
Powered by blists - more mailing lists