All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/5] Remove warnings from today's mmotm
@ 2021-06-15 20:02 Matthew Wilcox (Oracle)
  2021-06-15 20:02 ` [PATCH 1/5] mm writeback,cgroup: Fix documentation Matthew Wilcox (Oracle)
                   ` (4 more replies)
  0 siblings, 5 replies; 7+ messages in thread
From: Matthew Wilcox (Oracle) @ 2021-06-15 20:02 UTC (permalink / raw)
  To: akpm; +Cc: Matthew Wilcox (Oracle), linux-mm

These warnings all show up with W=1.  There's one more warning which
I'm not really sure how to fix.

Matthew Wilcox (Oracle) (5):
  mm writeback,cgroup: Fix documentation
  Fix hugetlb_basepage_index missing prototype warning
  mm/thp: Fix strncpy warning
  mm/sparse-vmemmap: Fix documentation warning
  mm: Fix alloc_vmemmap_page_list documentation warning

 include/linux/pagemap.h | 6 +++---
 mm/backing-dev.c        | 7 ++-----
 mm/huge_memory.c        | 2 +-
 mm/sparse-vmemmap.c     | 4 ++--
 4 files changed, 8 insertions(+), 11 deletions(-)

-- 
2.30.2



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

* [PATCH 1/5] mm writeback,cgroup: Fix documentation
  2021-06-15 20:02 [PATCH 0/5] Remove warnings from today's mmotm Matthew Wilcox (Oracle)
@ 2021-06-15 20:02 ` Matthew Wilcox (Oracle)
  2021-06-15 20:02 ` [PATCH 2/5] Fix hugetlb_basepage_index missing prototype warning Matthew Wilcox (Oracle)
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Matthew Wilcox (Oracle) @ 2021-06-15 20:02 UTC (permalink / raw)
  To: akpm; +Cc: Matthew Wilcox (Oracle), linux-mm

This is a static function, so it doesn't need kernel-doc.  Also remove
the inaccurate comment about the locking.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
 mm/backing-dev.c | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/mm/backing-dev.c b/mm/backing-dev.c
index 52eaeee40da3..271f2ca862c8 100644
--- a/mm/backing-dev.c
+++ b/mm/backing-dev.c
@@ -645,15 +645,12 @@ static void cgwb_bdi_unregister(struct backing_dev_info *bdi)
 	mutex_unlock(&bdi->cgwb_release_mutex);
 }
 
-/**
- * cleanup_offline_cgwbs - try to release dying cgwbs
+/*
+ * cleanup_offline_cgwbs_workfn - try to release dying cgwbs
  *
  * Try to release dying cgwbs by switching attached inodes to the nearest
  * living ancestor's writeback. Processed wbs are placed at the end
  * of the list to guarantee the forward progress.
- *
- * Should be called with the acquired cgwb_lock lock, which might
- * be released and re-acquired in the process.
  */
 static void cleanup_offline_cgwbs_workfn(struct work_struct *work)
 {
-- 
2.30.2



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

* [PATCH 2/5] Fix hugetlb_basepage_index missing prototype warning
  2021-06-15 20:02 [PATCH 0/5] Remove warnings from today's mmotm Matthew Wilcox (Oracle)
  2021-06-15 20:02 ` [PATCH 1/5] mm writeback,cgroup: Fix documentation Matthew Wilcox (Oracle)
@ 2021-06-15 20:02 ` Matthew Wilcox (Oracle)
  2021-06-15 23:16   ` Hugh Dickins
  2021-06-15 20:02 ` [PATCH 3/5] mm/thp: Fix strncpy warning Matthew Wilcox (Oracle)
                   ` (2 subsequent siblings)
  4 siblings, 1 reply; 7+ messages in thread
From: Matthew Wilcox (Oracle) @ 2021-06-15 20:02 UTC (permalink / raw)
  To: akpm; +Cc: Matthew Wilcox (Oracle), linux-mm

-Wmissing-prototypes requires that the prototype actually be in scope,
not just previously seen.  Move it outside page_to_pgoff().

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
 include/linux/pagemap.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
index 5f0582de24e7..c4b1514818ff 100644
--- a/include/linux/pagemap.h
+++ b/include/linux/pagemap.h
@@ -585,16 +585,16 @@ static inline pgoff_t page_to_index(struct page *page)
 	return pgoff;
 }
 
+extern pgoff_t hugetlb_basepage_index(struct page *page);
+
 /*
  * Get the offset in PAGE_SIZE (even for hugetlb pages).
  * (TODO: hugetlb pages should have ->index in PAGE_SIZE)
  */
 static inline pgoff_t page_to_pgoff(struct page *page)
 {
-	if (unlikely(PageHuge(page))) {
-		extern pgoff_t hugetlb_basepage_index(struct page *page);
+	if (unlikely(PageHuge(page)))
 		return hugetlb_basepage_index(page);
-	}
 	return page_to_index(page);
 }
 
-- 
2.30.2



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

* [PATCH 3/5] mm/thp: Fix strncpy warning
  2021-06-15 20:02 [PATCH 0/5] Remove warnings from today's mmotm Matthew Wilcox (Oracle)
  2021-06-15 20:02 ` [PATCH 1/5] mm writeback,cgroup: Fix documentation Matthew Wilcox (Oracle)
  2021-06-15 20:02 ` [PATCH 2/5] Fix hugetlb_basepage_index missing prototype warning Matthew Wilcox (Oracle)
@ 2021-06-15 20:02 ` Matthew Wilcox (Oracle)
  2021-06-15 20:02 ` [PATCH 4/5] mm/sparse-vmemmap: Fix documentation warning Matthew Wilcox (Oracle)
  2021-06-15 20:02 ` [PATCH 5/5] mm: Fix alloc_vmemmap_page_list " Matthew Wilcox (Oracle)
  4 siblings, 0 replies; 7+ messages in thread
From: Matthew Wilcox (Oracle) @ 2021-06-15 20:02 UTC (permalink / raw)
  To: akpm; +Cc: Matthew Wilcox (Oracle), linux-mm

Using MAX_INPUT_BUF_SZ as the maximum length of the string makes fortify
complain as it thinks the string might be longer than the buffer, and if
it is, we will end up with a "string" that is missing a NUL terminator.
It's trivial to show that 'tok' points to a NUL-terminated string which is
less than MAX_INPUT_BUF_SZ in length, so we may as well just use strcpy()
and avoid the warning.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
 mm/huge_memory.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index 503c8e1aecc6..d513b0cd1161 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -3101,7 +3101,7 @@ static ssize_t split_huge_pages_write(struct file *file, const char __user *buf,
 
 		tok = strsep(&buf, ",");
 		if (tok) {
-			strncpy(file_path, tok, MAX_INPUT_BUF_SZ);
+			strcpy(file_path, tok);
 		} else {
 			ret = -EINVAL;
 			goto out;
-- 
2.30.2



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

* [PATCH 4/5] mm/sparse-vmemmap: Fix documentation warning
  2021-06-15 20:02 [PATCH 0/5] Remove warnings from today's mmotm Matthew Wilcox (Oracle)
                   ` (2 preceding siblings ...)
  2021-06-15 20:02 ` [PATCH 3/5] mm/thp: Fix strncpy warning Matthew Wilcox (Oracle)
@ 2021-06-15 20:02 ` Matthew Wilcox (Oracle)
  2021-06-15 20:02 ` [PATCH 5/5] mm: Fix alloc_vmemmap_page_list " Matthew Wilcox (Oracle)
  4 siblings, 0 replies; 7+ messages in thread
From: Matthew Wilcox (Oracle) @ 2021-06-15 20:02 UTC (permalink / raw)
  To: akpm; +Cc: Matthew Wilcox (Oracle), linux-mm

vmemmap_remap_walk is a struct, not a function, and needs to be marked
accordingly.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
 mm/sparse-vmemmap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/sparse-vmemmap.c b/mm/sparse-vmemmap.c
index 693de0aec7a8..66740a79fe4e 100644
--- a/mm/sparse-vmemmap.c
+++ b/mm/sparse-vmemmap.c
@@ -35,7 +35,7 @@
 #include <asm/tlbflush.h>
 
 /**
- * vmemmap_remap_walk - walk vmemmap page table
+ * struct vmemmap_remap_walk - walk vmemmap page table
  *
  * @remap_pte:		called for each lowest-level entry (PTE).
  * @reuse_page:		the page which is reused for the tail vmemmap pages.
-- 
2.30.2



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

* [PATCH 5/5] mm: Fix alloc_vmemmap_page_list documentation warning
  2021-06-15 20:02 [PATCH 0/5] Remove warnings from today's mmotm Matthew Wilcox (Oracle)
                   ` (3 preceding siblings ...)
  2021-06-15 20:02 ` [PATCH 4/5] mm/sparse-vmemmap: Fix documentation warning Matthew Wilcox (Oracle)
@ 2021-06-15 20:02 ` Matthew Wilcox (Oracle)
  4 siblings, 0 replies; 7+ messages in thread
From: Matthew Wilcox (Oracle) @ 2021-06-15 20:02 UTC (permalink / raw)
  To: akpm; +Cc: Matthew Wilcox (Oracle), linux-mm

This simple typo generates two warnings from kernel-doc.

Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>
---
 mm/sparse-vmemmap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/sparse-vmemmap.c b/mm/sparse-vmemmap.c
index 66740a79fe4e..a3aa275e2668 100644
--- a/mm/sparse-vmemmap.c
+++ b/mm/sparse-vmemmap.c
@@ -272,7 +272,7 @@ static int alloc_vmemmap_page_list(unsigned long start, unsigned long end,
  * @end:	end address of the vmemmap virtual address range that we want to
  *		remap.
  * @reuse:	reuse address.
- * @gpf_mask:	GFP flag for allocating vmemmap pages.
+ * @gfp_mask:	GFP flag for allocating vmemmap pages.
  */
 int vmemmap_remap_alloc(unsigned long start, unsigned long end,
 			unsigned long reuse, gfp_t gfp_mask)
-- 
2.30.2



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

* Re: [PATCH 2/5] Fix hugetlb_basepage_index missing prototype warning
  2021-06-15 20:02 ` [PATCH 2/5] Fix hugetlb_basepage_index missing prototype warning Matthew Wilcox (Oracle)
@ 2021-06-15 23:16   ` Hugh Dickins
  0 siblings, 0 replies; 7+ messages in thread
From: Hugh Dickins @ 2021-06-15 23:16 UTC (permalink / raw)
  To: Matthew Wilcox (Oracle); +Cc: Andrew Morton, linux-mm

On Tue, 15 Jun 2021, Matthew Wilcox (Oracle) wrote:

> -Wmissing-prototypes requires that the prototype actually be in scope,
> not just previously seen.  Move it outside page_to_pgoff().
> 
> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org>

Thanks Matthew:
Acked-by: Hugh Dickins <hughd@google.com>
but Andrew please just add as a -fix.patch to
mm-futex-fix-shared-futex-pgoff-on-shmem-huge-page.patch
and merge them in due course - thank you.

> ---
>  include/linux/pagemap.h | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
> index 5f0582de24e7..c4b1514818ff 100644
> --- a/include/linux/pagemap.h
> +++ b/include/linux/pagemap.h
> @@ -585,16 +585,16 @@ static inline pgoff_t page_to_index(struct page *page)
>  	return pgoff;
>  }
>  
> +extern pgoff_t hugetlb_basepage_index(struct page *page);
> +
>  /*
>   * Get the offset in PAGE_SIZE (even for hugetlb pages).
>   * (TODO: hugetlb pages should have ->index in PAGE_SIZE)
>   */
>  static inline pgoff_t page_to_pgoff(struct page *page)
>  {
> -	if (unlikely(PageHuge(page))) {
> -		extern pgoff_t hugetlb_basepage_index(struct page *page);
> +	if (unlikely(PageHuge(page)))
>  		return hugetlb_basepage_index(page);
> -	}
>  	return page_to_index(page);
>  }
>  
> -- 
> 2.30.2


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

end of thread, other threads:[~2021-06-15 23:17 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-15 20:02 [PATCH 0/5] Remove warnings from today's mmotm Matthew Wilcox (Oracle)
2021-06-15 20:02 ` [PATCH 1/5] mm writeback,cgroup: Fix documentation Matthew Wilcox (Oracle)
2021-06-15 20:02 ` [PATCH 2/5] Fix hugetlb_basepage_index missing prototype warning Matthew Wilcox (Oracle)
2021-06-15 23:16   ` Hugh Dickins
2021-06-15 20:02 ` [PATCH 3/5] mm/thp: Fix strncpy warning Matthew Wilcox (Oracle)
2021-06-15 20:02 ` [PATCH 4/5] mm/sparse-vmemmap: Fix documentation warning Matthew Wilcox (Oracle)
2021-06-15 20:02 ` [PATCH 5/5] mm: Fix alloc_vmemmap_page_list " Matthew Wilcox (Oracle)

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.