aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/kernel
diff options
context:
space:
mode:
authorJeff Dike <jdike@addtoit.com>2006-09-26 02:33:00 -0400
committerLinus Torvalds <torvalds@g5.osdl.org>2006-09-26 11:49:05 -0400
commit91b165c0594ab78c64f26d26e3174e6dfd60ed9d (patch)
tree0730eefa9d4ce786f7f561e3b40700418d6d0970 /arch/um/kernel
parent13c06be399902c9ebda08e092edb1614bb4a3761 (diff)
[PATCH] uml: Use ARRAY_SIZE more assiduously
There were a bunch of missed ARRAY_SIZE opportunities. Also, some formatting fixes in the affected areas of code. Signed-off-by: Jeff Dike <jdike@addtoit.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'arch/um/kernel')
-rw-r--r--arch/um/kernel/mem.c3
-rw-r--r--arch/um/kernel/reboot.c13
-rw-r--r--arch/um/kernel/tlb.c5
3 files changed, 6 insertions, 15 deletions
diff --git a/arch/um/kernel/mem.c b/arch/um/kernel/mem.c
index b1cd5c6e468b..93121c6d26e5 100644
--- a/arch/um/kernel/mem.c
+++ b/arch/um/kernel/mem.c
@@ -223,8 +223,9 @@ void paging_init(void)
223 223
224 empty_zero_page = (unsigned long *) alloc_bootmem_low_pages(PAGE_SIZE); 224 empty_zero_page = (unsigned long *) alloc_bootmem_low_pages(PAGE_SIZE);
225 empty_bad_page = (unsigned long *) alloc_bootmem_low_pages(PAGE_SIZE); 225 empty_bad_page = (unsigned long *) alloc_bootmem_low_pages(PAGE_SIZE);
226 for(i=0;i<sizeof(zones_size)/sizeof(zones_size[0]);i++) 226 for(i = 0; i < ARRAY_SIZE(zones_size); i++)
227 zones_size[i] = 0; 227 zones_size[i] = 0;
228
228 zones_size[ZONE_DMA] = (end_iomem >> PAGE_SHIFT) - (uml_physmem >> PAGE_SHIFT); 229 zones_size[ZONE_DMA] = (end_iomem >> PAGE_SHIFT) - (uml_physmem >> PAGE_SHIFT);
229#ifdef CONFIG_HIGHMEM 230#ifdef CONFIG_HIGHMEM
230 zones_size[ZONE_HIGHMEM] = highmem >> PAGE_SHIFT; 231 zones_size[ZONE_HIGHMEM] = highmem >> PAGE_SHIFT;
diff --git a/arch/um/kernel/reboot.c b/arch/um/kernel/reboot.c
index 3ef73bf2e781..f602623644aa 100644
--- a/arch/um/kernel/reboot.c
+++ b/arch/um/kernel/reboot.c
@@ -22,7 +22,7 @@ static void kill_idlers(int me)
22 struct task_struct *p; 22 struct task_struct *p;
23 int i; 23 int i;
24 24
25 for(i = 0; i < sizeof(idle_threads)/sizeof(idle_threads[0]); i++){ 25 for(i = 0; i < ARRAY_SIZE(idle_threads); i++){
26 p = idle_threads[i]; 26 p = idle_threads[i];
27 if((p != NULL) && (p->thread.mode.tt.extern_pid != me)) 27 if((p != NULL) && (p->thread.mode.tt.extern_pid != me))
28 os_kill_process(p->thread.mode.tt.extern_pid, 0); 28 os_kill_process(p->thread.mode.tt.extern_pid, 0);
@@ -62,14 +62,3 @@ void machine_halt(void)
62{ 62{
63 machine_power_off(); 63 machine_power_off();
64} 64}
65
66/*
67 * Overrides for Emacs so that we follow Linus's tabbing style.
68 * Emacs will notice this stuff at the end of the file and automatically
69 * adjust the settings for this buffer only. This must remain at the end
70 * of the file.
71 * ---------------------------------------------------------------------------
72 * Local variables:
73 * c-file-style: "linux"
74 * End:
75 */
diff --git a/arch/um/kernel/tlb.c b/arch/um/kernel/tlb.c
index f5b0636f9ad7..cca330edf717 100644
--- a/arch/um/kernel/tlb.c
+++ b/arch/um/kernel/tlb.c
@@ -137,10 +137,11 @@ void fix_range_common(struct mm_struct *mm, unsigned long start_addr,
137 int r, w, x; 137 int r, w, x;
138 struct host_vm_op ops[1]; 138 struct host_vm_op ops[1];
139 void *flush = NULL; 139 void *flush = NULL;
140 int op_index = -1, last_op = sizeof(ops) / sizeof(ops[0]) - 1; 140 int op_index = -1, last_op = ARRAY_SIZE(ops) - 1;
141 int ret = 0; 141 int ret = 0;
142 142
143 if(mm == NULL) return; 143 if(mm == NULL)
144 return;
144 145
145 ops[0].type = NONE; 146 ops[0].type = NONE;
146 for(addr = start_addr; addr < end_addr && !ret;){ 147 for(addr = start_addr; addr < end_addr && !ret;){