diff options
author | Andy Whitcroft <apw@shadowen.org> | 2006-12-06 23:33:04 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.osdl.org> | 2006-12-07 11:39:23 -0500 |
commit | 4af2bfc1202041006a0f01d0591a975f6c573f09 (patch) | |
tree | 6fb140a40083c793919a417cfa28b31c9f86c662 /include/asm-i386/mmzone.h | |
parent | 25ba77c141dbcd2602dd0171824d0d72aa023a01 (diff) |
[PATCH] silence unused pgdat warning from alloc_bootmem_node and friends
x86 NUMA systems only define bootmem for node 0. alloc_bootmem_node() and
friends therefore ignore the passed pgdat and use NODE_DATA(0) in all
cases. This leads to the following warnings as we are not using the passed
parameter:
.../mm/page_alloc.c: In function 'zone_wait_table_init':
.../mm/page_alloc.c:2259: warning: unused variable 'pgdat'
One option would be to define all variables used with these macros
__attribute__ ((unused)), but this would leave us exposed should these
become genuinely unused.
The key here is that we _are_ using the value, we ignore it but that is a
deliberate action. This patch adds a nested local variable within the
alloc_bootmem_node helper to which the pgdat parameter is assigned making
it 'used'. The nested local is marked __attribute__ ((unused)) to silence
this same warning for it.
Signed-off-by: Andy Whitcroft <apw@shadowen.org>
Cc: Christoph Lameter <clameter@engr.sgi.com>
Cc: Andi Kleen <ak@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/asm-i386/mmzone.h')
-rw-r--r-- | include/asm-i386/mmzone.h | 27 |
1 files changed, 20 insertions, 7 deletions
diff --git a/include/asm-i386/mmzone.h b/include/asm-i386/mmzone.h index 61b073322006..3503ad66945e 100644 --- a/include/asm-i386/mmzone.h +++ b/include/asm-i386/mmzone.h | |||
@@ -120,13 +120,26 @@ static inline int pfn_valid(int pfn) | |||
120 | __alloc_bootmem_node(NODE_DATA(0), (x), PAGE_SIZE, __pa(MAX_DMA_ADDRESS)) | 120 | __alloc_bootmem_node(NODE_DATA(0), (x), PAGE_SIZE, __pa(MAX_DMA_ADDRESS)) |
121 | #define alloc_bootmem_low_pages(x) \ | 121 | #define alloc_bootmem_low_pages(x) \ |
122 | __alloc_bootmem_node(NODE_DATA(0), (x), PAGE_SIZE, 0) | 122 | __alloc_bootmem_node(NODE_DATA(0), (x), PAGE_SIZE, 0) |
123 | #define alloc_bootmem_node(ignore, x) \ | 123 | #define alloc_bootmem_node(pgdat, x) \ |
124 | __alloc_bootmem_node(NODE_DATA(0), (x), SMP_CACHE_BYTES, __pa(MAX_DMA_ADDRESS)) | 124 | ({ \ |
125 | #define alloc_bootmem_pages_node(ignore, x) \ | 125 | struct pglist_data __attribute__ ((unused)) \ |
126 | __alloc_bootmem_node(NODE_DATA(0), (x), PAGE_SIZE, __pa(MAX_DMA_ADDRESS)) | 126 | *__alloc_bootmem_node__pgdat = (pgdat); \ |
127 | #define alloc_bootmem_low_pages_node(ignore, x) \ | 127 | __alloc_bootmem_node(NODE_DATA(0), (x), SMP_CACHE_BYTES, \ |
128 | __alloc_bootmem_node(NODE_DATA(0), (x), PAGE_SIZE, 0) | 128 | __pa(MAX_DMA_ADDRESS)); \ |
129 | 129 | }) | |
130 | #define alloc_bootmem_pages_node(pgdat, x) \ | ||
131 | ({ \ | ||
132 | struct pglist_data __attribute__ ((unused)) \ | ||
133 | *__alloc_bootmem_node__pgdat = (pgdat); \ | ||
134 | __alloc_bootmem_node(NODE_DATA(0), (x), PAGE_SIZE, \ | ||
135 | __pa(MAX_DMA_ADDRESS)) \ | ||
136 | }) | ||
137 | #define alloc_bootmem_low_pages_node(pgdat, x) \ | ||
138 | ({ \ | ||
139 | struct pglist_data __attribute__ ((unused)) \ | ||
140 | *__alloc_bootmem_node__pgdat = (pgdat); \ | ||
141 | __alloc_bootmem_node(NODE_DATA(0), (x), PAGE_SIZE, 0); \ | ||
142 | }) | ||
130 | #endif /* CONFIG_NEED_MULTIPLE_NODES */ | 143 | #endif /* CONFIG_NEED_MULTIPLE_NODES */ |
131 | 144 | ||
132 | #endif /* _ASM_MMZONE_H_ */ | 145 | #endif /* _ASM_MMZONE_H_ */ |