Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1598841 > unrolled thread

[PATCH] mm: mark gup_pud_range as unused

Started byChris Packham <chris.packham@alliedtelesis.co.nz>
First post2017-03-13 05:00 +0100
Last post2017-03-13 06:30 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] mm: mark gup_pud_range as unused Chris Packham <chris.packham@alliedtelesis.co.nz> - 2017-03-13 05:00 +0100
    Re: [PATCH] mm: mark gup_pud_range as unused "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> - 2017-03-13 06:30 +0100

#1598841 — [PATCH] mm: mark gup_pud_range as unused

FromChris Packham <chris.packham@alliedtelesis.co.nz>
Date2017-03-13 05:00 +0100
Subject[PATCH] mm: mark gup_pud_range as unused
Message-ID<tkpjk-2RV-7@gated-at.bofh.it>
The last caller to gup_pud_range was removed in commit c2febafc6773
("mm: convert generic code to 5-level paging"). Mark it as unused to
silence a warning from gcc.

Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
---
I saw this warning when compiling 4.11-rc2 with -Werror. An equally valid fix
would be to remove the function entirely but I went for the less invasive
approach.

 mm/gup.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/mm/gup.c b/mm/gup.c
index c74bad1bf6e8..10f5c582273c 100644
--- a/mm/gup.c
+++ b/mm/gup.c
@@ -1409,8 +1409,9 @@ static int gup_pmd_range(pud_t pud, unsigned long addr, unsigned long end,
 	return 1;
 }
 
-static int gup_pud_range(p4d_t p4d, unsigned long addr, unsigned long end,
-			 int write, struct page **pages, int *nr)
+static int __maybe_unused gup_pud_range(p4d_t p4d, unsigned long addr,
+					unsigned long end, int write,
+					struct page **pages, int *nr)
 {
 	unsigned long next;
 	pud_t *pudp;
-- 
2.11.0.24.ge6920cf

[toc] | [next] | [standalone]


#1598853

From"Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Date2017-03-13 06:30 +0100
Message-ID<tkqIq-46N-5@gated-at.bofh.it>
In reply to#1598841
On Mon, Mar 13, 2017 at 04:58:37PM +1300, Chris Packham wrote:
> The last caller to gup_pud_range was removed in commit c2febafc6773
> ("mm: convert generic code to 5-level paging"). Mark it as unused to
> silence a warning from gcc.
> 
> Signed-off-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
> ---
> I saw this warning when compiling 4.11-rc2 with -Werror. An equally valid fix
> would be to remove the function entirely but I went for the less invasive
> approach.

Thanks for report. But real fix is to call gup_pud_range() from
gup_p4d_range(), not itself.

I'll post a fix.
Reported-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Reported-by: Chris Packham <chris.packham@alliedtelesis.co.nz>

-- 
 Kirill A. Shutemov

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web