2023-12-07 21:06:11

by Randy Dunlap

[permalink] [raw]
Subject: [PATCH 2/3] nvdimm/dimm_devs: fix kernel-doc for function params

Adjust kernel-doc notation to prevent warnings when using -Wall.

dimm_devs.c:59: warning: Function parameter or member 'ndd' not described in 'nvdimm_init_nsarea'
dimm_devs.c:59: warning: Excess function parameter 'nvdimm' description in 'nvdimm_init_nsarea'
dimm_devs.c:59: warning: No description found for return value of 'nvdimm_init_nsarea'
dimm_devs.c:728: warning: No description found for return value of 'nd_pmem_max_contiguous_dpa'
dimm_devs.c:773: warning: No description found for return value of 'nd_pmem_available_dpa'
dimm_devs.c:844: warning: Function parameter or member 'ndd' not described in 'nvdimm_allocated_dpa'
dimm_devs.c:844: warning: Excess function parameter 'nvdimm' description in 'nvdimm_allocated_dpa'
dimm_devs.c:844: warning: No description found for return value of 'nvdimm_allocated_dpa'

Signed-off-by: Randy Dunlap <[email protected]>
Cc: Dan Williams <[email protected]>
Cc: Vishal Verma <[email protected]>
Cc: Dave Jiang <[email protected]>
Cc: Ira Weiny <[email protected]>
Cc: [email protected]
---
drivers/nvdimm/dimm_devs.c | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)

diff -- a/drivers/nvdimm/dimm_devs.c b/drivers/nvdimm/dimm_devs.c
--- a/drivers/nvdimm/dimm_devs.c
+++ b/drivers/nvdimm/dimm_devs.c
@@ -53,7 +53,10 @@ static int validate_dimm(struct nvdimm_d

/**
* nvdimm_init_nsarea - determine the geometry of a dimm's namespace area
- * @nvdimm: dimm to initialize
+ * @ndd: dimm to initialize
+ *
+ * Returns: %0 if the area is already valid, -errno on error, otherwise an
+ * ND_CMD_* status code.
*/
int nvdimm_init_nsarea(struct nvdimm_drvdata *ndd)
{
@@ -722,6 +725,9 @@ static unsigned long dpa_align(struct nd
* contiguous unallocated dpa range.
* @nd_region: constrain available space check to this reference region
* @nd_mapping: container of dpa-resource-root + labels
+ *
+ * Returns: %0 if there is an alignment error, otherwise the max
+ * unallocated dpa range
*/
resource_size_t nd_pmem_max_contiguous_dpa(struct nd_region *nd_region,
struct nd_mapping *nd_mapping)
@@ -767,6 +773,8 @@ resource_size_t nd_pmem_max_contiguous_d
*
* Validate that a PMEM label, if present, aligns with the start of an
* interleave set.
+ *
+ * Returns: %0 if there is an alignment error, otherwise the unallocated dpa
*/
resource_size_t nd_pmem_available_dpa(struct nd_region *nd_region,
struct nd_mapping *nd_mapping)
@@ -836,8 +844,10 @@ struct resource *nvdimm_allocate_dpa(str

/**
* nvdimm_allocated_dpa - sum up the dpa currently allocated to this label_id
- * @nvdimm: container of dpa-resource-root + labels
+ * @ndd: container of dpa-resource-root + labels
* @label_id: dpa resource name of the form pmem-<human readable uuid>
+ *
+ * Returns: sum of the dpa allocated to the label_id
*/
resource_size_t nvdimm_allocated_dpa(struct nvdimm_drvdata *ndd,
struct nd_label_id *label_id)


2023-12-21 22:28:42

by Ira Weiny

[permalink] [raw]
Subject: Re: [PATCH 2/3] nvdimm/dimm_devs: fix kernel-doc for function params

Randy Dunlap wrote:
> Adjust kernel-doc notation to prevent warnings when using -Wall.
>
> dimm_devs.c:59: warning: Function parameter or member 'ndd' not described in 'nvdimm_init_nsarea'
> dimm_devs.c:59: warning: Excess function parameter 'nvdimm' description in 'nvdimm_init_nsarea'
> dimm_devs.c:59: warning: No description found for return value of 'nvdimm_init_nsarea'
> dimm_devs.c:728: warning: No description found for return value of 'nd_pmem_max_contiguous_dpa'
> dimm_devs.c:773: warning: No description found for return value of 'nd_pmem_available_dpa'
> dimm_devs.c:844: warning: Function parameter or member 'ndd' not described in 'nvdimm_allocated_dpa'
> dimm_devs.c:844: warning: Excess function parameter 'nvdimm' description in 'nvdimm_allocated_dpa'
> dimm_devs.c:844: warning: No description found for return value of 'nvdimm_allocated_dpa'
>
> Signed-off-by: Randy Dunlap <[email protected]>
> Cc: Dan Williams <[email protected]>
> Cc: Vishal Verma <[email protected]>
> Cc: Dave Jiang <[email protected]>
> Cc: Ira Weiny <[email protected]>
> Cc: [email protected]
> ---
> drivers/nvdimm/dimm_devs.c | 14 ++++++++++++--
> 1 file changed, 12 insertions(+), 2 deletions(-)
>
> diff -- a/drivers/nvdimm/dimm_devs.c b/drivers/nvdimm/dimm_devs.c
> --- a/drivers/nvdimm/dimm_devs.c
> +++ b/drivers/nvdimm/dimm_devs.c
> @@ -53,7 +53,10 @@ static int validate_dimm(struct nvdimm_d
>
> /**
> * nvdimm_init_nsarea - determine the geometry of a dimm's namespace area
> - * @nvdimm: dimm to initialize
> + * @ndd: dimm to initialize
> + *
> + * Returns: %0 if the area is already valid, -errno on error,

This is good...

> ...otherwise an
> + * ND_CMD_* status code.

I don't see where any of the ->ndctl() calls return an ND_CMD_* status
code. What am I missing?

The rest looks good,
Ira

> */
> int nvdimm_init_nsarea(struct nvdimm_drvdata *ndd)
> {
> @@ -722,6 +725,9 @@ static unsigned long dpa_align(struct nd
> * contiguous unallocated dpa range.
> * @nd_region: constrain available space check to this reference region
> * @nd_mapping: container of dpa-resource-root + labels
> + *
> + * Returns: %0 if there is an alignment error, otherwise the max
> + * unallocated dpa range
> */
> resource_size_t nd_pmem_max_contiguous_dpa(struct nd_region *nd_region,
> struct nd_mapping *nd_mapping)
> @@ -767,6 +773,8 @@ resource_size_t nd_pmem_max_contiguous_d
> *
> * Validate that a PMEM label, if present, aligns with the start of an
> * interleave set.
> + *
> + * Returns: %0 if there is an alignment error, otherwise the unallocated dpa
> */
> resource_size_t nd_pmem_available_dpa(struct nd_region *nd_region,
> struct nd_mapping *nd_mapping)
> @@ -836,8 +844,10 @@ struct resource *nvdimm_allocate_dpa(str
>
> /**
> * nvdimm_allocated_dpa - sum up the dpa currently allocated to this label_id
> - * @nvdimm: container of dpa-resource-root + labels
> + * @ndd: container of dpa-resource-root + labels
> * @label_id: dpa resource name of the form pmem-<human readable uuid>
> + *
> + * Returns: sum of the dpa allocated to the label_id
> */
> resource_size_t nvdimm_allocated_dpa(struct nvdimm_drvdata *ndd,
> struct nd_label_id *label_id)

2023-12-21 22:34:29

by Ira Weiny

[permalink] [raw]
Subject: Re: [PATCH 2/3] nvdimm/dimm_devs: fix kernel-doc for function params

Ira Weiny wrote:
> Randy Dunlap wrote:

[snip]

> > diff -- a/drivers/nvdimm/dimm_devs.c b/drivers/nvdimm/dimm_devs.c
> > --- a/drivers/nvdimm/dimm_devs.c
> > +++ b/drivers/nvdimm/dimm_devs.c
> > @@ -53,7 +53,10 @@ static int validate_dimm(struct nvdimm_d
> >
> > /**
> > * nvdimm_init_nsarea - determine the geometry of a dimm's namespace area
> > - * @nvdimm: dimm to initialize
> > + * @ndd: dimm to initialize
> > + *
> > + * Returns: %0 if the area is already valid, -errno on error,
>
> This is good...
>
> > ...otherwise an
> > + * ND_CMD_* status code.
>
> I don't see where any of the ->ndctl() calls return an ND_CMD_* status
> code. What am I missing?

If you agree that this should be dropped I can clean it up as I'm trying
to prep the nvdimm tree now and was hoping to take this series.

Ira

>
> The rest looks good,
> Ira

2023-12-21 23:35:47

by Randy Dunlap

[permalink] [raw]
Subject: Re: [PATCH 2/3] nvdimm/dimm_devs: fix kernel-doc for function params

Hi Ira,

On 12/21/23 14:34, Ira Weiny wrote:
> Ira Weiny wrote:
>> Randy Dunlap wrote:
>
> [snip]
>
>>> diff -- a/drivers/nvdimm/dimm_devs.c b/drivers/nvdimm/dimm_devs.c
>>> --- a/drivers/nvdimm/dimm_devs.c
>>> +++ b/drivers/nvdimm/dimm_devs.c
>>> @@ -53,7 +53,10 @@ static int validate_dimm(struct nvdimm_d
>>>
>>> /**
>>> * nvdimm_init_nsarea - determine the geometry of a dimm's namespace area
>>> - * @nvdimm: dimm to initialize
>>> + * @ndd: dimm to initialize
>>> + *
>>> + * Returns: %0 if the area is already valid, -errno on error,
>>
>> This is good...
>>
>>> ...otherwise an
>>> + * ND_CMD_* status code.
>>
>> I don't see where any of the ->ndctl() calls return an ND_CMD_* status
>> code. What am I missing?

Probably nothing.
Yes, please drop that/fix that when you merge it.
Thanks.

> If you agree that this should be dropped I can clean it up as I'm trying
> to prep the nvdimm tree now and was hoping to take this series.
>
> Ira
>
>>
>> The rest looks good,
>> Ira

--
#Randy
https://people.kernel.org/tglx/notes-about-netiquette
https://subspace.kernel.org/etiquette.html