diff options
author | Jeff Dike <jdike@addtoit.com> | 2007-02-10 04:44:10 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-02-11 13:51:22 -0500 |
commit | 60678bbc76685bea47043e61981b8fc5cffc10da (patch) | |
tree | 6d4844a2c126ad0c47cfe863671e74592fe0ee2a /arch/um/kernel/mem.c | |
parent | 94c282d79e17a83ccc876990e05378ed6dfbccae (diff) |
[PATCH] uml: mem.c and physmem.c formatting fixes
Fix a bunch of style violations in mem.c and physmem.c
Signed-off-by: Jeff Dike <jdike@addtoit.com>
Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'arch/um/kernel/mem.c')
-rw-r--r-- | arch/um/kernel/mem.c | 77 |
1 files changed, 34 insertions, 43 deletions
diff --git a/arch/um/kernel/mem.c b/arch/um/kernel/mem.c index fb11992f0b8a..d1480ff0f2a6 100644 --- a/arch/um/kernel/mem.c +++ b/arch/um/kernel/mem.c | |||
@@ -65,8 +65,8 @@ void mem_init(void) | |||
65 | { | 65 | { |
66 | max_low_pfn = (high_physmem - uml_physmem) >> PAGE_SHIFT; | 66 | max_low_pfn = (high_physmem - uml_physmem) >> PAGE_SHIFT; |
67 | 67 | ||
68 | /* clear the zero-page */ | 68 | /* clear the zero-page */ |
69 | memset((void *) empty_zero_page, 0, PAGE_SIZE); | 69 | memset((void *) empty_zero_page, 0, PAGE_SIZE); |
70 | 70 | ||
71 | /* Map in the area just after the brk now that kmalloc is about | 71 | /* Map in the area just after the brk now that kmalloc is about |
72 | * to be turned on. | 72 | * to be turned on. |
@@ -253,8 +253,10 @@ struct page *arch_validate(struct page *page, gfp_t mask, int order) | |||
253 | int i; | 253 | int i; |
254 | 254 | ||
255 | again: | 255 | again: |
256 | if(page == NULL) return(page); | 256 | if(page == NULL) |
257 | if(PageHighMem(page)) return(page); | 257 | return page; |
258 | if(PageHighMem(page)) | ||
259 | return page; | ||
258 | 260 | ||
259 | addr = (unsigned long) page_address(page); | 261 | addr = (unsigned long) page_address(page); |
260 | for(i = 0; i < (1 << order); i++){ | 262 | for(i = 0; i < (1 << order); i++){ |
@@ -263,13 +265,15 @@ struct page *arch_validate(struct page *page, gfp_t mask, int order) | |||
263 | sizeof(zero), | 265 | sizeof(zero), |
264 | ¤t->thread.fault_addr, | 266 | ¤t->thread.fault_addr, |
265 | ¤t->thread.fault_catcher)){ | 267 | ¤t->thread.fault_catcher)){ |
266 | if(!(mask & __GFP_WAIT)) return(NULL); | 268 | if(!(mask & __GFP_WAIT)) |
269 | return NULL; | ||
267 | else break; | 270 | else break; |
268 | } | 271 | } |
269 | addr += PAGE_SIZE; | 272 | addr += PAGE_SIZE; |
270 | } | 273 | } |
271 | 274 | ||
272 | if(i == (1 << order)) return(page); | 275 | if(i == (1 << order)) |
276 | return page; | ||
273 | page = alloc_pages(mask, order); | 277 | page = alloc_pages(mask, order); |
274 | goto again; | 278 | goto again; |
275 | } | 279 | } |
@@ -283,7 +287,6 @@ void free_initmem(void) | |||
283 | } | 287 | } |
284 | 288 | ||
285 | #ifdef CONFIG_BLK_DEV_INITRD | 289 | #ifdef CONFIG_BLK_DEV_INITRD |
286 | |||
287 | void free_initrd_mem(unsigned long start, unsigned long end) | 290 | void free_initrd_mem(unsigned long start, unsigned long end) |
288 | { | 291 | { |
289 | if (start < end) | 292 | if (start < end) |
@@ -296,37 +299,36 @@ void free_initrd_mem(unsigned long start, unsigned long end) | |||
296 | totalram_pages++; | 299 | totalram_pages++; |
297 | } | 300 | } |
298 | } | 301 | } |
299 | |||
300 | #endif | 302 | #endif |
301 | 303 | ||
302 | void show_mem(void) | 304 | void show_mem(void) |
303 | { | 305 | { |
304 | int pfn, total = 0, reserved = 0; | 306 | int pfn, total = 0, reserved = 0; |
305 | int shared = 0, cached = 0; | 307 | int shared = 0, cached = 0; |
306 | int highmem = 0; | 308 | int highmem = 0; |
307 | struct page *page; | 309 | struct page *page; |
308 | 310 | ||
309 | printk("Mem-info:\n"); | 311 | printk("Mem-info:\n"); |
310 | show_free_areas(); | 312 | show_free_areas(); |
311 | printk("Free swap: %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10)); | 313 | printk("Free swap: %6ldkB\n", nr_swap_pages<<(PAGE_SHIFT-10)); |
312 | pfn = max_mapnr; | 314 | pfn = max_mapnr; |
313 | while(pfn-- > 0) { | 315 | while(pfn-- > 0) { |
314 | page = pfn_to_page(pfn); | 316 | page = pfn_to_page(pfn); |
315 | total++; | 317 | total++; |
316 | if(PageHighMem(page)) | 318 | if(PageHighMem(page)) |
317 | highmem++; | 319 | highmem++; |
318 | if(PageReserved(page)) | 320 | if(PageReserved(page)) |
319 | reserved++; | 321 | reserved++; |
320 | else if(PageSwapCache(page)) | 322 | else if(PageSwapCache(page)) |
321 | cached++; | 323 | cached++; |
322 | else if(page_count(page)) | 324 | else if(page_count(page)) |
323 | shared += page_count(page) - 1; | 325 | shared += page_count(page) - 1; |
324 | } | 326 | } |
325 | printk("%d pages of RAM\n", total); | 327 | printk("%d pages of RAM\n", total); |
326 | printk("%d pages of HIGHMEM\n", highmem); | 328 | printk("%d pages of HIGHMEM\n", highmem); |
327 | printk("%d reserved pages\n", reserved); | 329 | printk("%d reserved pages\n", reserved); |
328 | printk("%d pages shared\n", shared); | 330 | printk("%d pages shared\n", shared); |
329 | printk("%d pages swap cached\n", cached); | 331 | printk("%d pages swap cached\n", cached); |
330 | } | 332 | } |
331 | 333 | ||
332 | /* | 334 | /* |
@@ -362,18 +364,7 @@ pte_t *pte_alloc_one_kernel(struct mm_struct *mm, unsigned long address) | |||
362 | struct page *pte_alloc_one(struct mm_struct *mm, unsigned long address) | 364 | struct page *pte_alloc_one(struct mm_struct *mm, unsigned long address) |
363 | { | 365 | { |
364 | struct page *pte; | 366 | struct page *pte; |
365 | 367 | ||
366 | pte = alloc_page(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO); | 368 | pte = alloc_page(GFP_KERNEL|__GFP_REPEAT|__GFP_ZERO); |
367 | return pte; | 369 | return pte; |
368 | } | 370 | } |
369 | |||
370 | /* | ||
371 | * Overrides for Emacs so that we follow Linus's tabbing style. | ||
372 | * Emacs will notice this stuff at the end of the file and automatically | ||
373 | * adjust the settings for this buffer only. This must remain at the end | ||
374 | * of the file. | ||
375 | * --------------------------------------------------------------------------- | ||
376 | * Local variables: | ||
377 | * c-file-style: "linux" | ||
378 | * End: | ||
379 | */ | ||