diff mbox series

[v2,6/6] mm/mempolicy: Fix mpol_misplaced kernel-doc

Message ID 20210215210203.3827513-7-willy@infradead.org (mailing list archive)
State New, archived
Headers show
Series Rationalise __alloc_pages wrappers | expand

Commit Message

Matthew Wilcox Feb. 15, 2021, 9:02 p.m. UTC
Sphinx interprets the Return section as a list and complains about it.
Turn it into a sentence and move it to the end of the kernel-doc to
fit the kernel-doc style.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
 Documentation/core-api/mm-api.rst |  1 +
 mm/mempolicy.c                    | 11 ++++-------
 2 files changed, 5 insertions(+), 7 deletions(-)

Comments

Mike Rapoport Feb. 15, 2021, 9:51 p.m. UTC | #1
On Mon, Feb 15, 2021 at 09:02:03PM +0000, Matthew Wilcox (Oracle) wrote:
> Sphinx interprets the Return section as a list and complains about it.
> Turn it into a sentence and move it to the end of the kernel-doc to
> fit the kernel-doc style.
> 
> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>

Acked-by: Mike Rapoport <rppt@linux.ibm.com>

> ---
>  Documentation/core-api/mm-api.rst |  1 +
>  mm/mempolicy.c                    | 11 ++++-------
>  2 files changed, 5 insertions(+), 7 deletions(-)
 
...

> diff --git a/mm/mempolicy.c b/mm/mempolicy.c
> index 96c98ce16727..577f59c8f327 100644
> --- a/mm/mempolicy.c
> +++ b/mm/mempolicy.c
> @@ -2456,14 +2456,11 @@ static void sp_free(struct sp_node *n)
>   * @addr: virtual address where page mapped
>   *
>   * Lookup current policy node id for vma,addr and "compare to" page's
> - * node id.
> - *
> - * Returns:
> - *	-1	- not misplaced, page is in the right node
> - *	node	- node id where the page should be
> - *
> - * Policy determination "mimics" alloc_page_vma().
> + * node id.  Policy determination "mimics" alloc_page_vma().
>   * Called from fault path where we know the vma and faulting address.
> + *
> + * Return: -1 if the page is in a node that is valid for this policy, or a
> + * suitable node ID to allocate a replacement page from.

I think it's possible to use lists in the Return: descriptions with the
right combination of spaces, asterisks and dashes, but this description is
way better anyway.
diff mbox series

Patch

diff --git a/Documentation/core-api/mm-api.rst b/Documentation/core-api/mm-api.rst
index 201b5423303b..874ae1250258 100644
--- a/Documentation/core-api/mm-api.rst
+++ b/Documentation/core-api/mm-api.rst
@@ -92,3 +92,4 @@  More Memory Management Functions
    :export:
 
 .. kernel-doc:: mm/page_alloc.c
+.. kernel-doc:: mm/mempolicy.c
diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index 96c98ce16727..577f59c8f327 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -2456,14 +2456,11 @@  static void sp_free(struct sp_node *n)
  * @addr: virtual address where page mapped
  *
  * Lookup current policy node id for vma,addr and "compare to" page's
- * node id.
- *
- * Returns:
- *	-1	- not misplaced, page is in the right node
- *	node	- node id where the page should be
- *
- * Policy determination "mimics" alloc_page_vma().
+ * node id.  Policy determination "mimics" alloc_page_vma().
  * Called from fault path where we know the vma and faulting address.
+ *
+ * Return: -1 if the page is in a node that is valid for this policy, or a
+ * suitable node ID to allocate a replacement page from.
  */
 int mpol_misplaced(struct page *page, struct vm_area_struct *vma, unsigned long addr)
 {