All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] x86/resctrl: Fix kernel-doc in rdtgroup.c
@ 2021-07-21 18:15 Fabio M. De Francesco
  2021-07-21 20:34 ` Reinette Chatre
  0 siblings, 1 reply; 2+ messages in thread
From: Fabio M. De Francesco @ 2021-07-21 18:15 UTC (permalink / raw)
  To: Reinette Chatre, Fenghua Yu, Thomas Gleixner, Ingo Molnar,
	Borislav Petkov, x86, H. Peter Anvin, linux-kernel
  Cc: Fabio M. De Francesco

Add description of undocumented parameters. Issues detected by
scripts/kernel-doc.

Suggested-by: Reinette Chatre <reinette.chatre@intel.com>
Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
---

v1 --> v2:
Change some parameter descriptions according to the suggestions of
Reinette Chatre.

 arch/x86/kernel/cpu/resctrl/rdtgroup.c | 19 +++++++++++++++++++
 1 file changed, 19 insertions(+)

diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c
index 01fd30e7829d..b51513661469 100644
--- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c
+++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c
@@ -877,6 +877,9 @@ static int rdt_shareable_bits_show(struct kernfs_open_file *of,
 
 /**
  * rdt_bit_usage_show - Display current usage of resources
+ * @of: pointer to opened "bit_usage" info file
+ * @seq: seq_file used to format output to "bit_usage"
+ * @v: unused pointer to void
  *
  * A domain is a shared resource that can now be allocated differently. Here
  * we display the current regions of the domain as an annotated bitmask.
@@ -888,6 +891,8 @@ static int rdt_shareable_bits_show(struct kernfs_open_file *of,
  *   S - currently used and shareable by software only
  *   E - currently used exclusively by one resource group
  *   P - currently pseudo-locked by one resource group
+ *
+ * Return: 0
  */
 static int rdt_bit_usage_show(struct kernfs_open_file *of,
 			      struct seq_file *seq, void *v)
@@ -1243,6 +1248,7 @@ bool rdtgroup_cbm_overlaps(struct rdt_resource *r, struct rdt_domain *d,
 
 /**
  * rdtgroup_mode_test_exclusive - Test if this resource group can be exclusive
+ * @rdtgrp: resource group
  *
  * An exclusive resource group implies that there should be no sharing of
  * its allocated resources. At the time this group is considered to be
@@ -1283,7 +1289,12 @@ static bool rdtgroup_mode_test_exclusive(struct rdtgroup *rdtgrp)
 
 /**
  * rdtgroup_mode_write - Modify the resource group's mode
+ * @of: pointer to opened "mode" file of a resource group
+ * @buf: data from user-space
+ * @nbytes: length of input data buffer
+ * @off: unsupported offset to input
  *
+ * Return: @nbytes on success, <0 on failure
  */
 static ssize_t rdtgroup_mode_write(struct kernfs_open_file *of,
 				   char *buf, size_t nbytes, loff_t off)
@@ -1367,6 +1378,8 @@ static ssize_t rdtgroup_mode_write(struct kernfs_open_file *of,
  *
  * @cbm is unsigned long, even if only 32 bits are used to make the
  * bitmap functions work correctly.
+ *
+ * Return: how many bytes of the cache are represented by @cbm.
  */
 unsigned int rdtgroup_cbm_to_size(struct rdt_resource *r,
 				  struct rdt_domain *d, unsigned long cbm)
@@ -1389,10 +1402,14 @@ unsigned int rdtgroup_cbm_to_size(struct rdt_resource *r,
 
 /**
  * rdtgroup_size_show - Display size in bytes of allocated regions
+ * @of: pointer to opened "size" file of a resource group
+ * @s: seq_file used to format output to "size"
+ * @v: unused pointer to void
  *
  * The "size" file mirrors the layout of the "schemata" file, printing the
  * size in bytes of each region instead of the capacity bitmask.
  *
+ * Return: 0 on success, <0 on failure
  */
 static int rdtgroup_size_show(struct kernfs_open_file *of,
 			      struct seq_file *s, void *v)
@@ -2618,6 +2635,8 @@ static int mkdir_mondata_all(struct kernfs_node *parent_kn,
  * resource group is initialized. The user can follow this with a
  * modification to the CBM if the default does not satisfy the
  * requirements.
+ *
+ * Return: A valid CBM, 0 if @_val is only 0 filled
  */
 static u32 cbm_ensure_valid(u32 _val, struct rdt_resource *r)
 {
-- 
2.32.0


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH v2] x86/resctrl: Fix kernel-doc in rdtgroup.c
  2021-07-21 18:15 [PATCH v2] x86/resctrl: Fix kernel-doc in rdtgroup.c Fabio M. De Francesco
@ 2021-07-21 20:34 ` Reinette Chatre
  0 siblings, 0 replies; 2+ messages in thread
From: Reinette Chatre @ 2021-07-21 20:34 UTC (permalink / raw)
  To: Fabio M. De Francesco, Fenghua Yu, Thomas Gleixner, Ingo Molnar,
	Borislav Petkov, x86, H. Peter Anvin, linux-kernel

Hi Fabio,

On 7/21/2021 11:15 AM, Fabio M. De Francesco wrote:
> Add description of undocumented parameters. Issues detected by
> scripts/kernel-doc.
> 
> Suggested-by: Reinette Chatre <reinette.chatre@intel.com>

This tag is used when somebody suggested that this work be done in the 
first place - to recognize the original idea. It is not used to 
recognize review feedback. In this case the kerneldoc cleanup is your 
work initiated by you so you should remove this tag.

> Signed-off-by: Fabio M. De Francesco <fmdefrancesco@gmail.com>
> ---
> 
> v1 --> v2:
> Change some parameter descriptions according to the suggestions of
> Reinette Chatre.
> 
>   arch/x86/kernel/cpu/resctrl/rdtgroup.c | 19 +++++++++++++++++++
>   1 file changed, 19 insertions(+)
> 
> diff --git a/arch/x86/kernel/cpu/resctrl/rdtgroup.c b/arch/x86/kernel/cpu/resctrl/rdtgroup.c
> index 01fd30e7829d..b51513661469 100644
> --- a/arch/x86/kernel/cpu/resctrl/rdtgroup.c
> +++ b/arch/x86/kernel/cpu/resctrl/rdtgroup.c
> @@ -877,6 +877,9 @@ static int rdt_shareable_bits_show(struct kernfs_open_file *of,
>   
>   /**
>    * rdt_bit_usage_show - Display current usage of resources
> + * @of: pointer to opened "bit_usage" info file
> + * @seq: seq_file used to format output to "bit_usage"
> + * @v: unused pointer to void
>    *
>    * A domain is a shared resource that can now be allocated differently. Here
>    * we display the current regions of the domain as an annotated bitmask.
> @@ -888,6 +891,8 @@ static int rdt_shareable_bits_show(struct kernfs_open_file *of,
>    *   S - currently used and shareable by software only
>    *   E - currently used exclusively by one resource group
>    *   P - currently pseudo-locked by one resource group
> + *
> + * Return: 0
>    */
>   static int rdt_bit_usage_show(struct kernfs_open_file *of,
>   			      struct seq_file *seq, void *v)
> @@ -1243,6 +1248,7 @@ bool rdtgroup_cbm_overlaps(struct rdt_resource *r, struct rdt_domain *d,
>   
>   /**
>    * rdtgroup_mode_test_exclusive - Test if this resource group can be exclusive
> + * @rdtgrp: resource group
>    *
>    * An exclusive resource group implies that there should be no sharing of
>    * its allocated resources. At the time this group is considered to be
> @@ -1283,7 +1289,12 @@ static bool rdtgroup_mode_test_exclusive(struct rdtgroup *rdtgrp)
>   
>   /**
>    * rdtgroup_mode_write - Modify the resource group's mode
> + * @of: pointer to opened "mode" file of a resource group
> + * @buf: data from user-space
> + * @nbytes: length of input data buffer
> + * @off: unsupported offset to input
>    *
> + * Return: @nbytes on success, <0 on failure
>    */
>   static ssize_t rdtgroup_mode_write(struct kernfs_open_file *of,
>   				   char *buf, size_t nbytes, loff_t off)
> @@ -1367,6 +1378,8 @@ static ssize_t rdtgroup_mode_write(struct kernfs_open_file *of,
>    *
>    * @cbm is unsigned long, even if only 32 bits are used to make the
>    * bitmap functions work correctly.
> + *
> + * Return: how many bytes of the cache are represented by @cbm.
>    */
>   unsigned int rdtgroup_cbm_to_size(struct rdt_resource *r,
>   				  struct rdt_domain *d, unsigned long cbm)
> @@ -1389,10 +1402,14 @@ unsigned int rdtgroup_cbm_to_size(struct rdt_resource *r,
>   
>   /**
>    * rdtgroup_size_show - Display size in bytes of allocated regions
> + * @of: pointer to opened "size" file of a resource group
> + * @s: seq_file used to format output to "size"
> + * @v: unused pointer to void
>    *
>    * The "size" file mirrors the layout of the "schemata" file, printing the
>    * size in bytes of each region instead of the capacity bitmask.
>    *
> + * Return: 0 on success, <0 on failure
>    */
>   static int rdtgroup_size_show(struct kernfs_open_file *of,
>   			      struct seq_file *s, void *v)
> @@ -2618,6 +2635,8 @@ static int mkdir_mondata_all(struct kernfs_node *parent_kn,
>    * resource group is initialized. The user can follow this with a
>    * modification to the CBM if the default does not satisfy the
>    * requirements.
> + *
> + * Return: A valid CBM, 0 if @_val is only 0 filled
>    */
>   static u32 cbm_ensure_valid(u32 _val, struct rdt_resource *r)
>   {
> 

Before these fixes:

$ scripts/kernel-doc -none arch/x86/kernel/cpu/resctrl/rdtgroup.c
arch/x86/kernel/cpu/resctrl/rdtgroup.c:894: warning: Function parameter 
or member 'of' not described in 'rdt_bit_usage_show'
arch/x86/kernel/cpu/resctrl/rdtgroup.c:894: warning: Function parameter 
or member 'seq' not described in 'rdt_bit_usage_show'
arch/x86/kernel/cpu/resctrl/rdtgroup.c:894: warning: Function parameter 
or member 'v' not described in 'rdt_bit_usage_show'
arch/x86/kernel/cpu/resctrl/rdtgroup.c:1257: warning: Function parameter 
or member 'rdtgrp' not described in 'rdtgroup_mode_test_exclusive'
arch/x86/kernel/cpu/resctrl/rdtgroup.c:1290: warning: Function parameter 
or member 'of' not described in 'rdtgroup_mode_write'
arch/x86/kernel/cpu/resctrl/rdtgroup.c:1290: warning: Function parameter 
or member 'buf' not described in 'rdtgroup_mode_write'
arch/x86/kernel/cpu/resctrl/rdtgroup.c:1290: warning: Function parameter 
or member 'nbytes' not described in 'rdtgroup_mode_write'
arch/x86/kernel/cpu/resctrl/rdtgroup.c:1290: warning: Function parameter 
or member 'off' not described in 'rdtgroup_mode_write'
arch/x86/kernel/cpu/resctrl/rdtgroup.c:1399: warning: Function parameter 
or member 'of' not described in 'rdtgroup_size_show'
arch/x86/kernel/cpu/resctrl/rdtgroup.c:1399: warning: Function parameter 
or member 's' not described in 'rdtgroup_size_show'
arch/x86/kernel/cpu/resctrl/rdtgroup.c:1399: warning: Function parameter 
or member 'v' not described in 'rdtgroup_size_show'
$

After these fixes:

$ scripts/kernel-doc -none arch/x86/kernel/cpu/resctrl/rdtgroup.c
$

Thank you very much for these fixes.

Reviewed-by: Reinette Chatre <reinette.chatre@intel.com>

Reinette

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-07-21 20:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-21 18:15 [PATCH v2] x86/resctrl: Fix kernel-doc in rdtgroup.c Fabio M. De Francesco
2021-07-21 20:34 ` Reinette Chatre

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.