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


Groups > linux.kernel > #1580899 > unrolled thread

[PATCH] m32r: mm: fix build warning

Started bySudip Mukherjee <sudipm.mukherjee@gmail.com>
First post2017-02-14 23:10 +0100
Last post2017-02-15 12:40 +0100
Articles 3 — 2 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH] m32r: mm: fix build warning Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2017-02-14 23:10 +0100
    Re: [PATCH] m32r: mm: fix build warning Andrew Morton <akpm@linux-foundation.org> - 2017-02-14 23:20 +0100
      Re: [PATCH] m32r: mm: fix build warning Sudip Mukherjee <sudipm.mukherjee@gmail.com> - 2017-02-15 12:40 +0100

#1580899 — [PATCH] m32r: mm: fix build warning

FromSudip Mukherjee <sudipm.mukherjee@gmail.com>
Date2017-02-14 23:10 +0100
Subject[PATCH] m32r: mm: fix build warning
Message-ID<taTsl-7x0-3@gated-at.bofh.it>
The build of m32r was giving warning:
mm/pgtable-generic.c: In function 'ptep_clear_flush':
mm/pgtable-generic.c:76:20: warning:
	unused variable 'mm' [-Wunused-variable]

The implementation of ptep_get_and_clear() and pte_accessible()
does not use 'mm'.

Signed-off-by: Sudip Mukherjee <sudip.mukherjee@codethink.co.uk>
---

build log is at:
https://travis-ci.org/sudipm-mukherjee/parport/jobs/201416051

 mm/pgtable-generic.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/pgtable-generic.c b/mm/pgtable-generic.c
index 4ed5908..58f5937 100644
--- a/mm/pgtable-generic.c
+++ b/mm/pgtable-generic.c
@@ -73,7 +73,7 @@ int ptep_clear_flush_young(struct vm_area_struct *vma,
 pte_t ptep_clear_flush(struct vm_area_struct *vma, unsigned long address,
 		       pte_t *ptep)
 {
-	struct mm_struct *mm = (vma)->vm_mm;
+	struct mm_struct __maybe_unused *mm = (vma)->vm_mm;
 	pte_t pte;
 	pte = ptep_get_and_clear(mm, address, ptep);
 	if (pte_accessible(mm, pte))
-- 
2.7.4

[toc] | [next] | [standalone]


#1580906

FromAndrew Morton <akpm@linux-foundation.org>
Date2017-02-14 23:20 +0100
Message-ID<taTC2-7Be-7@gated-at.bofh.it>
In reply to#1580899
On Tue, 14 Feb 2017 22:05:45 +0000 Sudip Mukherjee <sudipm.mukherjee@gmail.com> wrote:

> The build of m32r was giving warning:
> mm/pgtable-generic.c: In function 'ptep_clear_flush':
> mm/pgtable-generic.c:76:20: warning:
> 	unused variable 'mm' [-Wunused-variable]
> 
> The implementation of ptep_get_and_clear() and pte_accessible()
> does not use 'mm'.

That's because ptep_get_and_clear() and pte_accessible() are
implemented as macros.  If they were (static inline) C functions then
this warning wouldn't occur.  All the other architectures get this
right.

[toc] | [prev] | [next] | [standalone]


#1581236

FromSudip Mukherjee <sudipm.mukherjee@gmail.com>
Date2017-02-15 12:40 +0100
Message-ID<tb66d-7Lf-13@gated-at.bofh.it>
In reply to#1580906
On Tue, Feb 14, 2017 at 02:15:51PM -0800, Andrew Morton wrote:
> On Tue, 14 Feb 2017 22:05:45 +0000 Sudip Mukherjee <sudipm.mukherjee@gmail.com> wrote:
> 
> > The build of m32r was giving warning:
> > mm/pgtable-generic.c: In function 'ptep_clear_flush':
> > mm/pgtable-generic.c:76:20: warning:
> > 	unused variable 'mm' [-Wunused-variable]
> > 
> > The implementation of ptep_get_and_clear() and pte_accessible()
> > does not use 'mm'.
> 
> That's because ptep_get_and_clear() and pte_accessible() are
> implemented as macros.  If they were (static inline) C functions then
> this warning wouldn't occur.  All the other architectures get this
> right.

oops.. sorry.. usually I will check all the other arch before sending a
patch but missed it this time.
Will investigate further today and send you a modified patch.

Regards
Sudip

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web