Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Andi Kleen and committed by
Linus Torvalds
4e60c86b 627295e4

+9 -9
+2 -2
arch/x86/include/asm/pgtable_64.h
··· 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
+5 -1
include/linux/highmem.h
··· 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
+1 -1
include/linux/mmdebug.h
··· 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
-2
mm/filemap.c
··· 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
-2
mm/memory.c
··· 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... ··· 350 351 if (addr > end - 1) 351 352 return; 352 353 353 - start = addr; 354 354 pgd = pgd_offset(tlb->mm, addr); 355 355 do { 356 356 next = pgd_addr_end(addr, end);
+1 -1
mm/slab.c
··· 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)