diff mbox series

[RFC,2/2] fpga: bridge: fix kernel-doc

Message ID 20230706142755.124879-3-marpagan@redhat.com (mailing list archive)
State New
Headers show
Series fpga: fix kernel-doc warnings and align descriptions for the core components | expand

Commit Message

Marco Pagani July 6, 2023, 2:27 p.m. UTC
Fix the following warnings issued by the kernel-doc script:

drivers/fpga/fpga-bridge.c:99: warning: No description found for return value of 'of_fpga_bridge_get'
drivers/fpga/fpga-bridge.c:163: warning: No description found for return value of 'fpga_bridges_enable'
drivers/fpga/fpga-bridge.c:187: warning: No description found for return value of 'fpga_bridges_disable'
drivers/fpga/fpga-bridge.c:238: warning: No description found for return value of 'of_fpga_bridge_get_to_list'
drivers/fpga/fpga-bridge.c:268: warning: No description found for return value of 'fpga_bridge_get_to_list'

- Extend the return description of of_fpga_bridge_get() to include the
  case when try_module_get() fails.

Signed-off-by: Marco Pagani <marpagan@redhat.com>
---
 drivers/fpga/fpga-bridge.c | 23 ++++++++++++-----------
 1 file changed, 12 insertions(+), 11 deletions(-)

Comments

Randy Dunlap July 6, 2023, 9:35 p.m. UTC | #1
HI--

On 7/6/23 07:27, Marco Pagani wrote:
> Fix the following warnings issued by the kernel-doc script:
> 
> drivers/fpga/fpga-bridge.c:99: warning: No description found for return value of 'of_fpga_bridge_get'
> drivers/fpga/fpga-bridge.c:163: warning: No description found for return value of 'fpga_bridges_enable'
> drivers/fpga/fpga-bridge.c:187: warning: No description found for return value of 'fpga_bridges_disable'
> drivers/fpga/fpga-bridge.c:238: warning: No description found for return value of 'of_fpga_bridge_get_to_list'
> drivers/fpga/fpga-bridge.c:268: warning: No description found for return value of 'fpga_bridge_get_to_list'
> 
> - Extend the return description of of_fpga_bridge_get() to include the
>   case when try_module_get() fails.
> 
> Signed-off-by: Marco Pagani <marpagan@redhat.com>
> ---
>  drivers/fpga/fpga-bridge.c | 23 ++++++++++++-----------
>  1 file changed, 12 insertions(+), 11 deletions(-)
> 
> diff --git a/drivers/fpga/fpga-bridge.c b/drivers/fpga/fpga-bridge.c
> index a6c25dee9cc1..0b76c67c50e5 100644
> --- a/drivers/fpga/fpga-bridge.c
> +++ b/drivers/fpga/fpga-bridge.c
> @@ -87,12 +87,13 @@ static struct fpga_bridge *__fpga_bridge_get(struct device *dev,
>  /**
>   * of_fpga_bridge_get - get an exclusive reference to an fpga bridge
>   *
> - * @np: node pointer of an FPGA bridge
> - * @info: fpga image specific information
> + * @np: node pointer of an FPGA bridge.
> + * @info: fpga image specific information.

Those are not sentences. There is no reason that a period ('.') is needed
to end those lines. OTOH, the maintainers can do as they like with it.

The rest looks good. Thanks.

Reviewed-by: Randy Dunlap <rdunlap@infradead.org>

>   *
> - * Return fpga_bridge struct if successful.
> - * Return -EBUSY if someone already has a reference to the bridge.
> - * Return -ENODEV if @np is not an FPGA Bridge.
> + * Return:
> + * * fpga_bridge struct pointer if successful.
> + * * -EBUSY if someone already has a reference to the bridge.
> + * * -ENODEV if @np is not an FPGA Bridge or can't take parent driver refcount.
>   */
>  struct fpga_bridge *of_fpga_bridge_get(struct device_node *np,
>  				       struct fpga_image_info *info)
> @@ -155,9 +156,9 @@ EXPORT_SYMBOL_GPL(fpga_bridge_put);
>   * fpga_bridges_enable - enable bridges in a list
>   * @bridge_list: list of FPGA bridges
>   *
> - * Enable each bridge in the list.  If list is empty, do nothing.
> + * Enable each bridge in the list. If list is empty, do nothing.
>   *
> - * Return 0 for success or empty bridge list; return error code otherwise.
> + * Return: 0 for success or empty bridge list or an error code otherwise.
>   */
>  int fpga_bridges_enable(struct list_head *bridge_list)
>  {
> @@ -179,9 +180,9 @@ EXPORT_SYMBOL_GPL(fpga_bridges_enable);
>   *
>   * @bridge_list: list of FPGA bridges
>   *
> - * Disable each bridge in the list.  If list is empty, do nothing.
> + * Disable each bridge in the list. If list is empty, do nothing.
>   *
> - * Return 0 for success or empty bridge list; return error code otherwise.
> + * Return: 0 for success or empty bridge list or an error code otherwise.
>   */
>  int fpga_bridges_disable(struct list_head *bridge_list)
>  {
> @@ -230,7 +231,7 @@ EXPORT_SYMBOL_GPL(fpga_bridges_put);
>   *
>   * Get an exclusive reference to the bridge and it to the list.
>   *
> - * Return 0 for success, error code from of_fpga_bridge_get() otherwise.
> + * Return: 0 for success, error code from of_fpga_bridge_get() otherwise.
>   */
>  int of_fpga_bridge_get_to_list(struct device_node *np,
>  			       struct fpga_image_info *info,
> @@ -260,7 +261,7 @@ EXPORT_SYMBOL_GPL(of_fpga_bridge_get_to_list);
>   *
>   * Get an exclusive reference to the bridge and it to the list.
>   *
> - * Return 0 for success, error code from fpga_bridge_get() otherwise.
> + * Return: 0 for success, error code from fpga_bridge_get() otherwise.
>   */
>  int fpga_bridge_get_to_list(struct device *dev,
>  			    struct fpga_image_info *info,
Randy Dunlap July 6, 2023, 9:37 p.m. UTC | #2
Hi again,

On 7/6/23 14:35, Randy Dunlap wrote:
> HI--
> 
> On 7/6/23 07:27, Marco Pagani wrote:
>> Fix the following warnings issued by the kernel-doc script:
>>
>> drivers/fpga/fpga-bridge.c:99: warning: No description found for return value of 'of_fpga_bridge_get'
>> drivers/fpga/fpga-bridge.c:163: warning: No description found for return value of 'fpga_bridges_enable'
>> drivers/fpga/fpga-bridge.c:187: warning: No description found for return value of 'fpga_bridges_disable'
>> drivers/fpga/fpga-bridge.c:238: warning: No description found for return value of 'of_fpga_bridge_get_to_list'
>> drivers/fpga/fpga-bridge.c:268: warning: No description found for return value of 'fpga_bridge_get_to_list'
>>
>> - Extend the return description of of_fpga_bridge_get() to include the
>>   case when try_module_get() fails.
>>
>> Signed-off-by: Marco Pagani <marpagan@redhat.com>
>> ---
>>  drivers/fpga/fpga-bridge.c | 23 ++++++++++++-----------
>>  1 file changed, 12 insertions(+), 11 deletions(-)
>>
>> diff --git a/drivers/fpga/fpga-bridge.c b/drivers/fpga/fpga-bridge.c
>> index a6c25dee9cc1..0b76c67c50e5 100644
>> --- a/drivers/fpga/fpga-bridge.c
>> +++ b/drivers/fpga/fpga-bridge.c
>> @@ -87,12 +87,13 @@ static struct fpga_bridge *__fpga_bridge_get(struct device *dev,
>>  /**
>>   * of_fpga_bridge_get - get an exclusive reference to an fpga bridge
>>   *
>> - * @np: node pointer of an FPGA bridge
>> - * @info: fpga image specific information
>> + * @np: node pointer of an FPGA bridge.
>> + * @info: fpga image specific information.
> 
> Those are not sentences. There is no reason that a period ('.') is needed
> to end those lines. OTOH, the maintainers can do as they like with it.
> 
> The rest looks good. Thanks.
> 
> Reviewed-by: Randy Dunlap <rdunlap@infradead.org>
> 
>>   *
>> - * Return fpga_bridge struct if successful.
>> - * Return -EBUSY if someone already has a reference to the bridge.
>> - * Return -ENODEV if @np is not an FPGA Bridge.
>> + * Return:
>> + * * fpga_bridge struct pointer if successful.
>> + * * -EBUSY if someone already has a reference to the bridge.
>> + * * -ENODEV if @np is not an FPGA Bridge or can't take parent driver refcount.
>>   */
>>  struct fpga_bridge *of_fpga_bridge_get(struct device_node *np,
>>  				       struct fpga_image_info *info)
>> @@ -155,9 +156,9 @@ EXPORT_SYMBOL_GPL(fpga_bridge_put);
>>   * fpga_bridges_enable - enable bridges in a list
>>   * @bridge_list: list of FPGA bridges
>>   *
>> - * Enable each bridge in the list.  If list is empty, do nothing.
>> + * Enable each bridge in the list. If list is empty, do nothing.

These (multiple) 2-space to 1-space changes also are not necessary but are at the
discretion of the maintainers.

>>   *
>> - * Return 0 for success or empty bridge list; return error code otherwise.
>> + * Return: 0 for success or empty bridge list or an error code otherwise.
>>   */
>>  int fpga_bridges_enable(struct list_head *bridge_list)
>>  {
>> @@ -179,9 +180,9 @@ EXPORT_SYMBOL_GPL(fpga_bridges_enable);
>>   *
>>   * @bridge_list: list of FPGA bridges
>>   *
>> - * Disable each bridge in the list.  If list is empty, do nothing.
>> + * Disable each bridge in the list. If list is empty, do nothing.
>>   *
>> - * Return 0 for success or empty bridge list; return error code otherwise.
>> + * Return: 0 for success or empty bridge list or an error code otherwise.
>>   */
>>  int fpga_bridges_disable(struct list_head *bridge_list)
>>  {
>> @@ -230,7 +231,7 @@ EXPORT_SYMBOL_GPL(fpga_bridges_put);
>>   *
>>   * Get an exclusive reference to the bridge and it to the list.
>>   *
>> - * Return 0 for success, error code from of_fpga_bridge_get() otherwise.
>> + * Return: 0 for success, error code from of_fpga_bridge_get() otherwise.
>>   */
>>  int of_fpga_bridge_get_to_list(struct device_node *np,
>>  			       struct fpga_image_info *info,
>> @@ -260,7 +261,7 @@ EXPORT_SYMBOL_GPL(of_fpga_bridge_get_to_list);
>>   *
>>   * Get an exclusive reference to the bridge and it to the list.
>>   *
>> - * Return 0 for success, error code from fpga_bridge_get() otherwise.
>> + * Return: 0 for success, error code from fpga_bridge_get() otherwise.
>>   */
>>  int fpga_bridge_get_to_list(struct device *dev,
>>  			    struct fpga_image_info *info,
>
Marco Pagani July 7, 2023, 8:50 a.m. UTC | #3
On 2023-07-06 23:35, Randy Dunlap wrote:
> HI--
> 
> On 7/6/23 07:27, Marco Pagani wrote:
>> Fix the following warnings issued by the kernel-doc script:
>>
>> drivers/fpga/fpga-bridge.c:99: warning: No description found for return value of 'of_fpga_bridge_get'
>> drivers/fpga/fpga-bridge.c:163: warning: No description found for return value of 'fpga_bridges_enable'
>> drivers/fpga/fpga-bridge.c:187: warning: No description found for return value of 'fpga_bridges_disable'
>> drivers/fpga/fpga-bridge.c:238: warning: No description found for return value of 'of_fpga_bridge_get_to_list'
>> drivers/fpga/fpga-bridge.c:268: warning: No description found for return value of 'fpga_bridge_get_to_list'
>>
>> - Extend the return description of of_fpga_bridge_get() to include the
>>   case when try_module_get() fails.
>>
>> Signed-off-by: Marco Pagani <marpagan@redhat.com>
>> ---
>>  drivers/fpga/fpga-bridge.c | 23 ++++++++++++-----------
>>  1 file changed, 12 insertions(+), 11 deletions(-)
>>
>> diff --git a/drivers/fpga/fpga-bridge.c b/drivers/fpga/fpga-bridge.c
>> index a6c25dee9cc1..0b76c67c50e5 100644
>> --- a/drivers/fpga/fpga-bridge.c
>> +++ b/drivers/fpga/fpga-bridge.c
>> @@ -87,12 +87,13 @@ static struct fpga_bridge *__fpga_bridge_get(struct device *dev,
>>  /**
>>   * of_fpga_bridge_get - get an exclusive reference to an fpga bridge
>>   *
>> - * @np: node pointer of an FPGA bridge
>> - * @info: fpga image specific information
>> + * @np: node pointer of an FPGA bridge.
>> + * @info: fpga image specific information.
> 
> Those are not sentences. There is no reason that a period ('.') is needed
> to end those lines. OTOH, the maintainers can do as they like with it.
> 
> The rest looks good. Thanks.
> 
> Reviewed-by: Randy Dunlap <rdunlap@infradead.org>

I added a period at the end of each argument description to follow
the style recommended in the "Function documentation" section of the
kernel-doc documentation.

Thanks,
Marco

[...]
Xu Yilun July 10, 2023, 8:06 a.m. UTC | #4
On 2023-07-07 at 10:50:16 +0200, Marco Pagani wrote:
> 
> 
> On 2023-07-06 23:35, Randy Dunlap wrote:
> > HI--
> > 
> > On 7/6/23 07:27, Marco Pagani wrote:
> >> Fix the following warnings issued by the kernel-doc script:
> >>
> >> drivers/fpga/fpga-bridge.c:99: warning: No description found for return value of 'of_fpga_bridge_get'
> >> drivers/fpga/fpga-bridge.c:163: warning: No description found for return value of 'fpga_bridges_enable'
> >> drivers/fpga/fpga-bridge.c:187: warning: No description found for return value of 'fpga_bridges_disable'
> >> drivers/fpga/fpga-bridge.c:238: warning: No description found for return value of 'of_fpga_bridge_get_to_list'
> >> drivers/fpga/fpga-bridge.c:268: warning: No description found for return value of 'fpga_bridge_get_to_list'
> >>
> >> - Extend the return description of of_fpga_bridge_get() to include the
> >>   case when try_module_get() fails.
> >>
> >> Signed-off-by: Marco Pagani <marpagan@redhat.com>
> >> ---
> >>  drivers/fpga/fpga-bridge.c | 23 ++++++++++++-----------
> >>  1 file changed, 12 insertions(+), 11 deletions(-)
> >>
> >> diff --git a/drivers/fpga/fpga-bridge.c b/drivers/fpga/fpga-bridge.c
> >> index a6c25dee9cc1..0b76c67c50e5 100644
> >> --- a/drivers/fpga/fpga-bridge.c
> >> +++ b/drivers/fpga/fpga-bridge.c
> >> @@ -87,12 +87,13 @@ static struct fpga_bridge *__fpga_bridge_get(struct device *dev,
> >>  /**
> >>   * of_fpga_bridge_get - get an exclusive reference to an fpga bridge
> >>   *
> >> - * @np: node pointer of an FPGA bridge
> >> - * @info: fpga image specific information
> >> + * @np: node pointer of an FPGA bridge.
> >> + * @info: fpga image specific information.
> > 
> > Those are not sentences. There is no reason that a period ('.') is needed
> > to end those lines. OTOH, the maintainers can do as they like with it.
> > 
> > The rest looks good. Thanks.
> > 
> > Reviewed-by: Randy Dunlap <rdunlap@infradead.org>
> 
> I added a period at the end of each argument description to follow
> the style recommended in the "Function documentation" section of the
> kernel-doc documentation.

I'm OK with them.

Acked-by: Xu Yilun <yilun.xu@intel.com>

Applied.

> 
> Thanks,
> Marco
> 
> [...]
>
diff mbox series

Patch

diff --git a/drivers/fpga/fpga-bridge.c b/drivers/fpga/fpga-bridge.c
index a6c25dee9cc1..0b76c67c50e5 100644
--- a/drivers/fpga/fpga-bridge.c
+++ b/drivers/fpga/fpga-bridge.c
@@ -87,12 +87,13 @@  static struct fpga_bridge *__fpga_bridge_get(struct device *dev,
 /**
  * of_fpga_bridge_get - get an exclusive reference to an fpga bridge
  *
- * @np: node pointer of an FPGA bridge
- * @info: fpga image specific information
+ * @np: node pointer of an FPGA bridge.
+ * @info: fpga image specific information.
  *
- * Return fpga_bridge struct if successful.
- * Return -EBUSY if someone already has a reference to the bridge.
- * Return -ENODEV if @np is not an FPGA Bridge.
+ * Return:
+ * * fpga_bridge struct pointer if successful.
+ * * -EBUSY if someone already has a reference to the bridge.
+ * * -ENODEV if @np is not an FPGA Bridge or can't take parent driver refcount.
  */
 struct fpga_bridge *of_fpga_bridge_get(struct device_node *np,
 				       struct fpga_image_info *info)
@@ -155,9 +156,9 @@  EXPORT_SYMBOL_GPL(fpga_bridge_put);
  * fpga_bridges_enable - enable bridges in a list
  * @bridge_list: list of FPGA bridges
  *
- * Enable each bridge in the list.  If list is empty, do nothing.
+ * Enable each bridge in the list. If list is empty, do nothing.
  *
- * Return 0 for success or empty bridge list; return error code otherwise.
+ * Return: 0 for success or empty bridge list or an error code otherwise.
  */
 int fpga_bridges_enable(struct list_head *bridge_list)
 {
@@ -179,9 +180,9 @@  EXPORT_SYMBOL_GPL(fpga_bridges_enable);
  *
  * @bridge_list: list of FPGA bridges
  *
- * Disable each bridge in the list.  If list is empty, do nothing.
+ * Disable each bridge in the list. If list is empty, do nothing.
  *
- * Return 0 for success or empty bridge list; return error code otherwise.
+ * Return: 0 for success or empty bridge list or an error code otherwise.
  */
 int fpga_bridges_disable(struct list_head *bridge_list)
 {
@@ -230,7 +231,7 @@  EXPORT_SYMBOL_GPL(fpga_bridges_put);
  *
  * Get an exclusive reference to the bridge and it to the list.
  *
- * Return 0 for success, error code from of_fpga_bridge_get() otherwise.
+ * Return: 0 for success, error code from of_fpga_bridge_get() otherwise.
  */
 int of_fpga_bridge_get_to_list(struct device_node *np,
 			       struct fpga_image_info *info,
@@ -260,7 +261,7 @@  EXPORT_SYMBOL_GPL(of_fpga_bridge_get_to_list);
  *
  * Get an exclusive reference to the bridge and it to the list.
  *
- * Return 0 for success, error code from fpga_bridge_get() otherwise.
+ * Return: 0 for success, error code from fpga_bridge_get() otherwise.
  */
 int fpga_bridge_get_to_list(struct device *dev,
 			    struct fpga_image_info *info,