Skip to content

Commit

Permalink
m32r: mm: fix build warning
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
sudipm-mukherjee authored and torvalds committed Mar 15, 2016
1 parent 2552821 commit 3701dc8
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions arch/m32r/mm/init.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 3701dc8

Please sign in to comment.