[3/3] nvdimm/namespace: fix kernel-doc for function params
Commit Message
Adjust kernel-doc notation to prevent warnings when using -Wall.
namespace_devs.c:76: warning: No description found for return value of 'nd_is_uuid_unique'
namespace_devs.c:343: warning: No description found for return value of 'shrink_dpa_allocation'
namespace_devs.c:668: warning: No description found for return value of 'grow_dpa_allocation'
namespace_devs.c:958: warning: No description found for return value of 'namespace_update_uuid'
namespace_devs.c:1665: warning: Function parameter or member 'nd_mapping' not described in 'create_namespace_pmem'
namespace_devs.c:1665: warning: Excess function parameter 'nspm' description in 'create_namespace_pmem'
namespace_devs.c:1665: warning: No description found for return value of 'create_namespace_pmem'
Signed-off-by: Randy Dunlap <rdunlap@infradead.org>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Vishal Verma <vishal.l.verma@intel.com>
Cc: Dave Jiang <dave.jiang@intel.com>
Cc: Ira Weiny <ira.weiny@intel.com>
Cc: nvdimm@lists.linux.dev
---
drivers/nvdimm/namespace_devs.c | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
Comments
Randy Dunlap wrote:
[snip]
> @@ -1656,8 +1664,10 @@ static int select_pmem_id(struct nd_regi
> /**
> * create_namespace_pmem - validate interleave set labelling, retrieve label0
> * @nd_region: region with mappings to validate
> - * @nspm: target namespace to create
> + * @nd_mapping: container of dpa-resource-root + labels
> * @nd_label: target pmem namespace label to evaluate
> + *
> + * Returns: the created &struct device on success or -errno on error
NIT: should this be ERR_PTR(-errno) on error?
Generally good to me though.
Reviewed-by: Ira Weiny <ira.weiny@intel.com>
> */
> static struct device *create_namespace_pmem(struct nd_region *nd_region,
> struct nd_mapping *nd_mapping,
On 12/21/23 14:32, Ira Weiny wrote:
> Randy Dunlap wrote:
>
> [snip]
>
>> @@ -1656,8 +1664,10 @@ static int select_pmem_id(struct nd_regi
>> /**
>> * create_namespace_pmem - validate interleave set labelling, retrieve label0
>> * @nd_region: region with mappings to validate
>> - * @nspm: target namespace to create
>> + * @nd_mapping: container of dpa-resource-root + labels
>> * @nd_label: target pmem namespace label to evaluate
>> + *
>> + * Returns: the created &struct device on success or -errno on error
>
> NIT: should this be ERR_PTR(-errno) on error?
Oh, for sure. Thanks for catching that.
> Generally good to me though.
>
> Reviewed-by: Ira Weiny <ira.weiny@intel.com>
>
>> */
>> static struct device *create_namespace_pmem(struct nd_region *nd_region,
>> struct nd_mapping *nd_mapping,
Randy Dunlap wrote:
>
>
> On 12/21/23 14:32, Ira Weiny wrote:
> > Randy Dunlap wrote:
> >
> > [snip]
> >
> >> @@ -1656,8 +1664,10 @@ static int select_pmem_id(struct nd_regi
> >> /**
> >> * create_namespace_pmem - validate interleave set labelling, retrieve label0
> >> * @nd_region: region with mappings to validate
> >> - * @nspm: target namespace to create
> >> + * @nd_mapping: container of dpa-resource-root + labels
> >> * @nd_label: target pmem namespace label to evaluate
> >> + *
> >> + * Returns: the created &struct device on success or -errno on error
> >
> > NIT: should this be ERR_PTR(-errno) on error?
>
> Oh, for sure. Thanks for catching that.
I'll clean this up as well if you are good with me changing patch 2/3 as
well.
Ira
@@ -71,6 +71,8 @@ static int is_namespace_uuid_busy(struct
* nd_is_uuid_unique - verify that no other namespace has @uuid
* @dev: any device on a nvdimm_bus
* @uuid: uuid to check
+ *
+ * Returns: %true if the uuid is unique, %false if not
*/
bool nd_is_uuid_unique(struct device *dev, uuid_t *uuid)
{
@@ -337,6 +339,8 @@ static int scan_free(struct nd_region *n
* adjust_resource() the allocation to @n, but if @n is larger than the
* allocation delete it and find the 'new' last allocation in the label
* set.
+ *
+ * Returns: %0 on success on -errno on error
*/
static int shrink_dpa_allocation(struct nd_region *nd_region,
struct nd_label_id *label_id, resource_size_t n)
@@ -662,6 +666,8 @@ void release_free_pmem(struct nvdimm_bus
* allocations from the start of an interleave set and end at the first
* BLK allocation or the end of the interleave set, whichever comes
* first.
+ *
+ * Returns: %0 on success on -errno on error
*/
static int grow_dpa_allocation(struct nd_region *nd_region,
struct nd_label_id *label_id, resource_size_t n)
@@ -951,6 +957,8 @@ static ssize_t uuid_show(struct device *
* @dev: namespace type for generating label_id
* @new_uuid: incoming uuid
* @old_uuid: reference to the uuid storage location in the namespace object
+ *
+ * Returns: %0 on success on -errno on error
*/
static int namespace_update_uuid(struct nd_region *nd_region,
struct device *dev, uuid_t *new_uuid,
@@ -1656,8 +1664,10 @@ static int select_pmem_id(struct nd_regi
/**
* create_namespace_pmem - validate interleave set labelling, retrieve label0
* @nd_region: region with mappings to validate
- * @nspm: target namespace to create
+ * @nd_mapping: container of dpa-resource-root + labels
* @nd_label: target pmem namespace label to evaluate
+ *
+ * Returns: the created &struct device on success or -errno on error
*/
static struct device *create_namespace_pmem(struct nd_region *nd_region,
struct nd_mapping *nd_mapping,