Commit 4e60c86bd9e5a7110ed28874d0b6592186550ae8

Authored by Andi Kleen
Committed by Linus Torvalds
1 parent 627295e492

gcc-4.6: mm: fix unused but set warnings

No real bugs, just some dead code and some fixups.

Signed-off-by: Andi Kleen <ak@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Showing 6 changed files with 9 additions and 9 deletions Side-by-side Diff

arch/x86/include/asm/pgtable_64.h
... ... @@ -126,8 +126,8 @@
126 126 /* x86-64 always has all page tables mapped. */
127 127 #define pte_offset_map(dir, address) pte_offset_kernel((dir), (address))
128 128 #define pte_offset_map_nested(dir, address) pte_offset_kernel((dir), (address))
129   -#define pte_unmap(pte) /* NOP */
130   -#define pte_unmap_nested(pte) /* NOP */
  129 +#define pte_unmap(pte) ((void)(pte))/* NOP */
  130 +#define pte_unmap_nested(pte) ((void)(pte)) /* NOP */
131 131  
132 132 #define update_mmu_cache(vma, address, ptep) do { } while (0)
133 133  
include/linux/highmem.h
... ... @@ -73,7 +73,11 @@
73 73 }
74 74 #define kmap_atomic_prot(page, idx, prot) kmap_atomic(page, idx)
75 75  
76   -#define kunmap_atomic_notypecheck(addr, idx) do { pagefault_enable(); } while (0)
  76 +static inline void kunmap_atomic_notypecheck(void *addr, enum km_type idx)
  77 +{
  78 + pagefault_enable();
  79 +}
  80 +
77 81 #define kmap_atomic_pfn(pfn, idx) kmap_atomic(pfn_to_page(pfn), (idx))
78 82 #define kmap_atomic_to_page(ptr) virt_to_page(ptr)
79 83  
include/linux/mmdebug.h
... ... @@ -4,7 +4,7 @@
4 4 #ifdef CONFIG_DEBUG_VM
5 5 #define VM_BUG_ON(cond) BUG_ON(cond)
6 6 #else
7   -#define VM_BUG_ON(cond) do { } while (0)
  7 +#define VM_BUG_ON(cond) do { (void)(cond); } while (0)
8 8 #endif
9 9  
10 10 #ifdef CONFIG_DEBUG_VIRTUAL
... ... @@ -2238,14 +2238,12 @@
2238 2238  
2239 2239 do {
2240 2240 struct page *page;
2241   - pgoff_t index; /* Pagecache index for current page */
2242 2241 unsigned long offset; /* Offset into pagecache page */
2243 2242 unsigned long bytes; /* Bytes to write to page */
2244 2243 size_t copied; /* Bytes copied from user */
2245 2244 void *fsdata;
2246 2245  
2247 2246 offset = (pos & (PAGE_CACHE_SIZE - 1));
2248   - index = pos >> PAGE_CACHE_SHIFT;
2249 2247 bytes = min_t(unsigned long, PAGE_CACHE_SIZE - offset,
2250 2248 iov_iter_count(i));
2251 2249  
... ... @@ -307,7 +307,6 @@
307 307 {
308 308 pgd_t *pgd;
309 309 unsigned long next;
310   - unsigned long start;
311 310  
312 311 /*
313 312 * The next few lines have given us lots of grief...
... ... @@ -351,7 +350,6 @@
351 350 if (addr > end - 1)
352 351 return;
353 352  
354   - start = addr;
355 353 pgd = pgd_offset(tlb->mm, addr);
356 354 do {
357 355 next = pgd_addr_end(addr, end);
... ... @@ -394,7 +394,7 @@
394 394 #define STATS_DEC_ACTIVE(x) do { } while (0)
395 395 #define STATS_INC_ALLOCED(x) do { } while (0)
396 396 #define STATS_INC_GROWN(x) do { } while (0)
397   -#define STATS_ADD_REAPED(x,y) do { } while (0)
  397 +#define STATS_ADD_REAPED(x,y) do { (void)(y); } while (0)
398 398 #define STATS_SET_HIGH(x) do { } while (0)
399 399 #define STATS_INC_ERR(x) do { } while (0)
400 400 #define STATS_INC_NODEALLOCS(x) do { } while (0)