aboutsummaryrefslogtreecommitdiffstats
path: root/arch/um/kernel
diff options
context:
space:
mode:
authorJeff Dike <jdike@addtoit.com>2007-05-06 17:51:41 -0400
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-05-07 15:13:03 -0400
commitdc764e5087bceeb26714bb7975b711062b39d804 (patch)
treef777ee4533f398754e9779f9d2505387eb074307 /arch/um/kernel
parentfda83a99b2b49016b9d7ed562745969db25c4ef9 (diff)
uml: formatting fixes around os_{read_write}_file callers
Formatting fixes ahead of renaming os_{read_write}_file_k to os_{read_write}_file and fixing all the callers. Signed-off-by: Jeff Dike <jdike@linux.intel.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')
-rw-r--r--arch/um/kernel/initrd.c32
-rw-r--r--arch/um/kernel/smp.c25
2 files changed, 22 insertions, 35 deletions
diff --git a/arch/um/kernel/initrd.c b/arch/um/kernel/initrd.c
index bf3dd9659865..cff73faae991 100644
--- a/arch/um/kernel/initrd.c
+++ b/arch/um/kernel/initrd.c
@@ -21,12 +21,20 @@ static int __init read_initrd(void)
21 long long size; 21 long long size;
22 int err; 22 int err;
23 23
24 if(initrd == NULL) return 0; 24 if(initrd == NULL)
25 return 0;
26
25 err = os_file_size(initrd, &size); 27 err = os_file_size(initrd, &size);
26 if(err) return 0; 28 if(err)
29 return 0;
30
27 area = alloc_bootmem(size); 31 area = alloc_bootmem(size);
28 if(area == NULL) return 0; 32 if(area == NULL)
29 if(load_initrd(initrd, area, size) == -1) return 0; 33 return 0;
34
35 if(load_initrd(initrd, area, size) == -1)
36 return 0;
37
30 initrd_start = (unsigned long) area; 38 initrd_start = (unsigned long) area;
31 initrd_end = initrd_start + size; 39 initrd_end = initrd_start + size;
32 return 0; 40 return 0;
@@ -53,25 +61,15 @@ int load_initrd(char *filename, void *buf, int size)
53 fd = os_open_file(filename, of_read(OPENFLAGS()), 0); 61 fd = os_open_file(filename, of_read(OPENFLAGS()), 0);
54 if(fd < 0){ 62 if(fd < 0){
55 printk("Opening '%s' failed - err = %d\n", filename, -fd); 63 printk("Opening '%s' failed - err = %d\n", filename, -fd);
56 return(-1); 64 return -1;
57 } 65 }
58 n = os_read_file_k(fd, buf, size); 66 n = os_read_file_k(fd, buf, size);
59 if(n != size){ 67 if(n != size){
60 printk("Read of %d bytes from '%s' failed, err = %d\n", size, 68 printk("Read of %d bytes from '%s' failed, err = %d\n", size,
61 filename, -n); 69 filename, -n);
62 return(-1); 70 return -1;
63 } 71 }
64 72
65 os_close_file(fd); 73 os_close_file(fd);
66 return(0); 74 return 0;
67} 75}
68/*
69 * Overrides for Emacs so that we follow Linus's tabbing style.
70 * Emacs will notice this stuff at the end of the file and automatically
71 * adjust the settings for this buffer only. This must remain at the end
72 * of the file.
73 * ---------------------------------------------------------------------------
74 * Local variables:
75 * c-file-style: "linux"
76 * End:
77 */
diff --git a/arch/um/kernel/smp.c b/arch/um/kernel/smp.c
index 47b690893c06..9ac562124654 100644
--- a/arch/um/kernel/smp.c
+++ b/arch/um/kernel/smp.c
@@ -89,7 +89,7 @@ static int idle_proc(void *cpup)
89 89
90 cpu_set(cpu, cpu_online_map); 90 cpu_set(cpu, cpu_online_map);
91 default_idle(); 91 default_idle();
92 return(0); 92 return 0;
93} 93}
94 94
95static struct task_struct *idle_thread(int cpu) 95static struct task_struct *idle_thread(int cpu)
@@ -97,8 +97,8 @@ static struct task_struct *idle_thread(int cpu)
97 struct task_struct *new_task; 97 struct task_struct *new_task;
98 unsigned char c; 98 unsigned char c;
99 99
100 current->thread.request.u.thread.proc = idle_proc; 100 current->thread.request.u.thread.proc = idle_proc;
101 current->thread.request.u.thread.arg = (void *) cpu; 101 current->thread.request.u.thread.arg = (void *) cpu;
102 new_task = fork_idle(cpu); 102 new_task = fork_idle(cpu);
103 if(IS_ERR(new_task)) 103 if(IS_ERR(new_task))
104 panic("copy_process failed in idle_thread, error = %ld", 104 panic("copy_process failed in idle_thread, error = %ld",
@@ -111,7 +111,7 @@ static struct task_struct *idle_thread(int cpu)
111 CHOOSE_MODE(os_write_file_k(new_task->thread.mode.tt.switch_pipe[1], &c, 111 CHOOSE_MODE(os_write_file_k(new_task->thread.mode.tt.switch_pipe[1], &c,
112 sizeof(c)), 112 sizeof(c)),
113 ({ panic("skas mode doesn't support SMP"); })); 113 ({ panic("skas mode doesn't support SMP"); }));
114 return(new_task); 114 return new_task;
115} 115}
116 116
117void smp_prepare_cpus(unsigned int maxcpus) 117void smp_prepare_cpus(unsigned int maxcpus)
@@ -162,13 +162,13 @@ int __cpu_up(unsigned int cpu)
162 cpu_set(cpu, smp_commenced_mask); 162 cpu_set(cpu, smp_commenced_mask);
163 while (!cpu_isset(cpu, cpu_online_map)) 163 while (!cpu_isset(cpu, cpu_online_map))
164 mb(); 164 mb();
165 return(0); 165 return 0;
166} 166}
167 167
168int setup_profiling_timer(unsigned int multiplier) 168int setup_profiling_timer(unsigned int multiplier)
169{ 169{
170 printk(KERN_INFO "setup_profiling_timer\n"); 170 printk(KERN_INFO "setup_profiling_timer\n");
171 return(0); 171 return 0;
172} 172}
173 173
174void smp_call_function_slave(int cpu); 174void smp_call_function_slave(int cpu);
@@ -204,7 +204,7 @@ void IPI_handler(int cpu)
204 204
205int hard_smp_processor_id(void) 205int hard_smp_processor_id(void)
206{ 206{
207 return(pid_to_processor_id(os_getpid())); 207 return pid_to_processor_id(os_getpid());
208} 208}
209 209
210static DEFINE_SPINLOCK(call_lock); 210static DEFINE_SPINLOCK(call_lock);
@@ -253,14 +253,3 @@ int smp_call_function(void (*_func)(void *info), void *_info, int nonatomic,
253} 253}
254 254
255#endif 255#endif
256
257/*
258 * Overrides for Emacs so that we follow Linus's tabbing style.
259 * Emacs will notice this stuff at the end of the file and automatically
260 * adjust the settings for this buffer only. This must remain at the end
261 * of the file.
262 * ---------------------------------------------------------------------------
263 * Local variables:
264 * c-file-style: "linux"
265 * End:
266 */