diff mbox series

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

Message ID 20230706142755.124879-2-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-region.c:46: warning: No description found for return value of 'fpga_region_get'
drivers/fpga/fpga-region.c:97: warning: No description found for return value of 'fpga_region_program_fpga'
drivers/fpga/fpga-region.c:295: warning: No description found for return value of 'fpga_region_init'

- Remove the "and registers a reconfig notifier" part from the description
  of fpga_region_init() since it does not register an of_overlay notifier
  anymore.

- Remove the outdated "if @np is not an FPGA Region" case from the return
  description of fpga_region_get() and replace it with the case when
  try_module_get() fails.

Signed-off-by: Marco Pagani <marpagan@redhat.com>
---
 drivers/fpga/fpga-region.c | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)

Comments

Randy Dunlap July 6, 2023, 9:30 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-region.c:46: warning: No description found for return value of 'fpga_region_get'
> drivers/fpga/fpga-region.c:97: warning: No description found for return value of 'fpga_region_program_fpga'
> drivers/fpga/fpga-region.c:295: warning: No description found for return value of 'fpga_region_init'
> 
> - Remove the "and registers a reconfig notifier" part from the description
>   of fpga_region_init() since it does not register an of_overlay notifier
>   anymore.
> 
> - Remove the outdated "if @np is not an FPGA Region" case from the return
>   description of fpga_region_get() and replace it with the case when
>   try_module_get() fails.
> 
> Signed-off-by: Marco Pagani <marpagan@redhat.com>

Looks good. Thanks.

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

> ---
>  drivers/fpga/fpga-region.c | 14 ++++++++------
>  1 file changed, 8 insertions(+), 6 deletions(-)
> 
> diff --git a/drivers/fpga/fpga-region.c b/drivers/fpga/fpga-region.c
> index ccf6fdab1360..c9d065a6961b 100644
> --- a/drivers/fpga/fpga-region.c
> +++ b/drivers/fpga/fpga-region.c
> @@ -38,9 +38,10 @@ EXPORT_SYMBOL_GPL(fpga_region_class_find);
>   *
>   * Caller should call fpga_region_put() when done with region.
>   *
> - * Return fpga_region struct if successful.
> - * Return -EBUSY if someone already has a reference to the region.
> - * Return -ENODEV if @np is not an FPGA Region.
> + * Return:
> + * * fpga_region struct if successful.
> + * * -EBUSY if someone already has a reference to the region.
> + * * -ENODEV if can't take parent driver module refcount.
>   */
>  static struct fpga_region *fpga_region_get(struct fpga_region *region)
>  {
> @@ -91,7 +92,7 @@ static void fpga_region_put(struct fpga_region *region)
>   * The caller will need to call fpga_bridges_put() before attempting to
>   * reprogram the region.
>   *
> - * Return 0 for success or negative error code.
> + * Return: 0 for success or negative error code.
>   */
>  int fpga_region_program_fpga(struct fpga_region *region)
>  {
> @@ -288,8 +289,9 @@ static void fpga_region_dev_release(struct device *dev)
>  }
>  
>  /**
> - * fpga_region_init - init function for fpga_region class
> - * Creates the fpga_region class and registers a reconfig notifier.
> + * fpga_region_init - creates the fpga_region class.
> + *
> + * Return: 0 on success or ERR_PTR() on error.
>   */
>  static int __init fpga_region_init(void)
>  {
Xu Yilun July 10, 2023, 8:05 a.m. UTC | #2
On 2023-07-06 at 14:30:34 -0700, 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-region.c:46: warning: No description found for return value of 'fpga_region_get'
> > drivers/fpga/fpga-region.c:97: warning: No description found for return value of 'fpga_region_program_fpga'
> > drivers/fpga/fpga-region.c:295: warning: No description found for return value of 'fpga_region_init'
> > 
> > - Remove the "and registers a reconfig notifier" part from the description
> >   of fpga_region_init() since it does not register an of_overlay notifier
> >   anymore.
> > 
> > - Remove the outdated "if @np is not an FPGA Region" case from the return
> >   description of fpga_region_get() and replace it with the case when
> >   try_module_get() fails.
> > 
> > Signed-off-by: Marco Pagani <marpagan@redhat.com>
> 
> Looks good. Thanks.
> 
> Reviewed-by: Randy Dunlap <rdunlap@infradead.org>

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

Applied.

BTW: No need to have RFC if you think it is ready for full review.
diff mbox series

Patch

diff --git a/drivers/fpga/fpga-region.c b/drivers/fpga/fpga-region.c
index ccf6fdab1360..c9d065a6961b 100644
--- a/drivers/fpga/fpga-region.c
+++ b/drivers/fpga/fpga-region.c
@@ -38,9 +38,10 @@  EXPORT_SYMBOL_GPL(fpga_region_class_find);
  *
  * Caller should call fpga_region_put() when done with region.
  *
- * Return fpga_region struct if successful.
- * Return -EBUSY if someone already has a reference to the region.
- * Return -ENODEV if @np is not an FPGA Region.
+ * Return:
+ * * fpga_region struct if successful.
+ * * -EBUSY if someone already has a reference to the region.
+ * * -ENODEV if can't take parent driver module refcount.
  */
 static struct fpga_region *fpga_region_get(struct fpga_region *region)
 {
@@ -91,7 +92,7 @@  static void fpga_region_put(struct fpga_region *region)
  * The caller will need to call fpga_bridges_put() before attempting to
  * reprogram the region.
  *
- * Return 0 for success or negative error code.
+ * Return: 0 for success or negative error code.
  */
 int fpga_region_program_fpga(struct fpga_region *region)
 {
@@ -288,8 +289,9 @@  static void fpga_region_dev_release(struct device *dev)
 }
 
 /**
- * fpga_region_init - init function for fpga_region class
- * Creates the fpga_region class and registers a reconfig notifier.
+ * fpga_region_init - creates the fpga_region class.
+ *
+ * Return: 0 on success or ERR_PTR() on error.
  */
 static int __init fpga_region_init(void)
 {