UML - mem.c and physmem.c formatting fixes
PATCH 9/9 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 <[email protected]>
--
arch/um/kernel/mem.c | 77 ++++++++++++++++++++--------------------------- arch/um/kernel/physmem.c | 57 ++++++++++++++-------------------- 2 files changed, 57 insertions(+), 77 deletions(-)
arch/um/kernel/mem.c +34 -43
@@ -66,8 +66,8 @@ void mem_init(void) { max_low_pfn = (high_physmem - uml_physmem) >>PAGE_SHIFT ; -/* clear the zero-page */ -memset ((void *) empty_zero_page,0 ,PAGE_SIZE ); +/* clear the zero-page */ +memset ((void *) empty_zero_page,0 ,PAGE_SIZE );/* Map in the area just after the brk now that kmalloc is about * to be turned on.
@@ -254,8 +254,10 @@ struct page *arch_validate(struct page *int i; again: -if (page ==NULL )return (page); -if (PageHighMem (page))return (page); +if (page ==NULL ) +return page; +if (PageHighMem (page)) +return page; addr = (unsigned long )page_address (page);for (i =0 ; i < (1 << order); i++){
@@ -264,13 +266,15 @@ struct page *arch_validate(struct page * sizeof(zero), ¤t->thread.fault_addr, ¤t->thread.fault_catcher)){ -if (!(mask & __GFP_WAIT))return (NULL ); +if (!(mask & __GFP_WAIT)) +return NULL ;else break ; } addr +=PAGE_SIZE ; } -if (i == (1 << order))return (page); +if (i == (1 << order)) +return page; page =alloc_pages (mask, order); goto again; }
@@ -284,7 +288,6 @@ void free_initmem(void) }#ifdef CONFIG_BLK_DEV_INITRD -void free_initrd_mem (unsigned long start,unsigned long end) {if (start < end)
@@ -297,37 +300,36 @@ void free_initrd_mem(unsigned long start totalram_pages++; } } -#endif void show_mem (void ) { -int pfn, total =0 , reserved =0 ; -int shared =0 , cached =0 ; -int highmem =0 ; +int pfn, total =0 , reserved =0 ; +int shared =0 , cached =0 ; +int highmem =0 ;struct page *page; -printk ("Mem-info:\n" ); -show_free_areas (); -printk ("Free swap: %6ldkB\n" , nr_swap_pages<<(PAGE_SHIFT -10 )); - pfn = max_mapnr; -while (pfn-- >0 ) { +printk ("Mem-info:\n" ); +show_free_areas (); +printk ("Free swap: %6ldkB\n" , nr_swap_pages<<(PAGE_SHIFT -10 )); + pfn = max_mapnr; +while (pfn-- >0 ) { page =pfn_to_page (pfn); - total++; -if (PageHighMem (page)) - highmem++; -if (PageReserved (page)) - reserved++; -else if (PageSwapCache (page)) - cached++; -else if (page_count (page)) - shared +=page_count (page) -1 ; - } -printk ("%d pages of RAM\n" , total); -printk ("%d pages of HIGHMEM\n" , highmem); -printk ("%d reserved pages\n" , reserved); -printk ("%d pages shared\n" , shared); -printk ("%d pages swap cached\n" , cached); + total++; +if (PageHighMem (page)) + highmem++; +if (PageReserved (page)) + reserved++; +else if (PageSwapCache (page)) + cached++; +else if (page_count (page)) + shared +=page_count (page) -1 ; + } +printk ("%d pages of RAM\n" , total); +printk ("%d pages of HIGHMEM\n" , highmem); +printk ("%d reserved pages\n" , reserved); +printk ("%d pages shared\n" , shared); +printk ("%d pages swap cached\n" , cached); }/*
@@ -363,18 +365,7 @@ pte_t *pte_alloc_one_kernel(struct mm_ststruct page *pte_alloc_one (struct mm_struct *mm,unsigned long address) {struct page *pte; - + pte =alloc_page (GFP_KERNEL |__GFP_REPEAT|__GFP_ZERO);return pte; } - -/* -* Overrides for Emacs so that we follow Linus's tabbing style. -* Emacs will notice this stuff at the end of the file and automatically -* adjust the settings for this buffer only. This must remain at the end -* of the file. -* --------------------------------------------------------------------------- -* Local variables: -* c-file-style: "linux" -* End: -*/
arch/um/kernel/physmem.c +23 -34
170 lines not on this page · raw message
-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
User-mode-linux-devel mailing list [email protected]
https://lists.sourceforge.net/lists/listinfo/user-mode-linux-devel