linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] m32r: mm: fix build warning
@ 2017-02-14 22:05 Sudip Mukherjee
  2017-02-14 22:15 ` Andrew Morton
  0 siblings, 1 reply; 4+ messages in thread
From: Sudip Mukherjee @ 2017-02-14 22:05 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel, Sudip Mukherjee

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

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

* Re: [PATCH] m32r: mm: fix build warning
  2017-02-14 22:05 [PATCH] m32r: mm: fix build warning Sudip Mukherjee
@ 2017-02-14 22:15 ` Andrew Morton
  2017-02-15 11:38   ` Sudip Mukherjee
  0 siblings, 1 reply; 4+ messages in thread
From: Andrew Morton @ 2017-02-14 22:15 UTC (permalink / raw)
  To: Sudip Mukherjee; +Cc: linux-kernel

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.

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

* Re: [PATCH] m32r: mm: fix build warning
  2017-02-14 22:15 ` Andrew Morton
@ 2017-02-15 11:38   ` Sudip Mukherjee
  0 siblings, 0 replies; 4+ messages in thread
From: Sudip Mukherjee @ 2017-02-15 11:38 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel

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

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

* [PATCH] m32r: mm: fix build warning
@ 2016-01-28 13:10 Sudip Mukherjee
  0 siblings, 0 replies; 4+ messages in thread
From: Sudip Mukherjee @ 2016-01-28 13:10 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel, Sudip Mukherjee

While building we are getting warnings:
arch/m32r/mm/init.c:63:17: warning: unused variable 'low'
arch/m32r/mm/init.c:62:17: warning: unused variable 'max_dma'

max_dma and low are only used if CONFIG_MMU is defined. Lets declare the
variables inside the #ifdef.

Signed-off-by: Sudip Mukherjee <sudip@vectorindia.org>
---
 arch/m32r/mm/init.c | 27 +++++++++++++++------------
 1 file changed, 15 insertions(+), 12 deletions(-)

diff --git a/arch/m32r/mm/init.c b/arch/m32r/mm/init.c
index 0d4146f..bf196d6 100644
--- a/arch/m32r/mm/init.c
+++ b/arch/m32r/mm/init.c
@@ -59,21 +59,24 @@ void free_initrd_mem(unsigned long, unsigned long);
 void __init zone_sizes_init(void)
 {
 	unsigned long  zones_size[MAX_NR_ZONES] = {0, };
-	unsigned long  max_dma;
-	unsigned long  low;
 	unsigned long  start_pfn;
 
 #ifdef CONFIG_MMU
-	start_pfn = START_PFN(0);
-	max_dma = virt_to_phys((char *)MAX_DMA_ADDRESS) >> PAGE_SHIFT;
-	low = MAX_LOW_PFN(0);
-
-	if (low < max_dma){
-		zones_size[ZONE_DMA] = low - start_pfn;
-		zones_size[ZONE_NORMAL] = 0;
-	} else {
-		zones_size[ZONE_DMA] = low - start_pfn;
-		zones_size[ZONE_NORMAL] = low - max_dma;
+	{
+		unsigned long  low;
+		unsigned long  max_dma;
+
+		start_pfn = START_PFN(0);
+		max_dma = virt_to_phys((char *)MAX_DMA_ADDRESS) >> PAGE_SHIFT;
+		low = MAX_LOW_PFN(0);
+
+		if (low < max_dma) {
+			zones_size[ZONE_DMA] = low - start_pfn;
+			zones_size[ZONE_NORMAL] = 0;
+		} else {
+			zones_size[ZONE_DMA] = low - start_pfn;
+			zones_size[ZONE_NORMAL] = low - max_dma;
+		}
 	}
 #else
 	zones_size[ZONE_DMA] = 0 >> PAGE_SHIFT;
-- 
1.9.1

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

end of thread, other threads:[~2017-02-15 11:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-02-14 22:05 [PATCH] m32r: mm: fix build warning Sudip Mukherjee
2017-02-14 22:15 ` Andrew Morton
2017-02-15 11:38   ` Sudip Mukherjee
  -- strict thread matches above, loose matches on Subject: below --
2016-01-28 13:10 Sudip Mukherjee

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).