Commit dc764e50 authored by Jeff Dike's avatar Jeff Dike Committed by Linus Torvalds

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: default avatarJeff Dike <jdike@linux.intel.com>
Cc: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent fda83a99
...@@ -203,14 +203,3 @@ void register_winch(int fd, struct tty_struct *tty) ...@@ -203,14 +203,3 @@ void register_winch(int fd, struct tty_struct *tty)
} }
} }
} }
/*
* 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:
*/
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
static inline void *cow_malloc(int size) static inline void *cow_malloc(int size)
{ {
return(um_kmalloc(size)); return um_kmalloc(size);
} }
static inline void cow_free(void *ptr) static inline void cow_free(void *ptr)
...@@ -20,29 +20,22 @@ static inline void cow_free(void *ptr) ...@@ -20,29 +20,22 @@ static inline void cow_free(void *ptr)
static inline char *cow_strdup(char *str) static inline char *cow_strdup(char *str)
{ {
return(uml_strdup(str)); return uml_strdup(str);
} }
static inline int cow_seek_file(int fd, __u64 offset) static inline int cow_seek_file(int fd, __u64 offset)
{ {
return(os_seek_file(fd, offset)); return os_seek_file(fd, offset);
} }
static inline int cow_file_size(char *file, unsigned long long *size_out) static inline int cow_file_size(char *file, unsigned long long *size_out)
{ {
return(os_file_size(file, size_out)); return os_file_size(file, size_out);
} }
static inline int cow_write_file(int fd, void *buf, int size) static inline int cow_write_file(int fd, void *buf, int size)
{ {
return(os_write_file_k(fd, buf, size)); return os_write_file_k(fd, buf, size);
} }
#endif #endif
/*
* ---------------------------------------------------------------------------
* Local variables:
* c-file-style: "linux"
* End:
*/
This diff is collapsed.
...@@ -21,12 +21,20 @@ static int __init read_initrd(void) ...@@ -21,12 +21,20 @@ static int __init read_initrd(void)
long long size; long long size;
int err; int err;
if(initrd == NULL) return 0; if(initrd == NULL)
return 0;
err = os_file_size(initrd, &size); err = os_file_size(initrd, &size);
if(err) return 0; if(err)
return 0;
area = alloc_bootmem(size); area = alloc_bootmem(size);
if(area == NULL) return 0; if(area == NULL)
if(load_initrd(initrd, area, size) == -1) return 0; return 0;
if(load_initrd(initrd, area, size) == -1)
return 0;
initrd_start = (unsigned long) area; initrd_start = (unsigned long) area;
initrd_end = initrd_start + size; initrd_end = initrd_start + size;
return 0; return 0;
...@@ -53,25 +61,15 @@ int load_initrd(char *filename, void *buf, int size) ...@@ -53,25 +61,15 @@ int load_initrd(char *filename, void *buf, int size)
fd = os_open_file(filename, of_read(OPENFLAGS()), 0); fd = os_open_file(filename, of_read(OPENFLAGS()), 0);
if(fd < 0){ if(fd < 0){
printk("Opening '%s' failed - err = %d\n", filename, -fd); printk("Opening '%s' failed - err = %d\n", filename, -fd);
return(-1); return -1;
} }
n = os_read_file_k(fd, buf, size); n = os_read_file_k(fd, buf, size);
if(n != size){ if(n != size){
printk("Read of %d bytes from '%s' failed, err = %d\n", size, printk("Read of %d bytes from '%s' failed, err = %d\n", size,
filename, -n); filename, -n);
return(-1); return -1;
} }
os_close_file(fd); os_close_file(fd);
return(0); return 0;
} }
/*
* 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:
*/
...@@ -89,7 +89,7 @@ static int idle_proc(void *cpup) ...@@ -89,7 +89,7 @@ static int idle_proc(void *cpup)
cpu_set(cpu, cpu_online_map); cpu_set(cpu, cpu_online_map);
default_idle(); default_idle();
return(0); return 0;
} }
static struct task_struct *idle_thread(int cpu) static struct task_struct *idle_thread(int cpu)
...@@ -97,8 +97,8 @@ static struct task_struct *idle_thread(int cpu) ...@@ -97,8 +97,8 @@ static struct task_struct *idle_thread(int cpu)
struct task_struct *new_task; struct task_struct *new_task;
unsigned char c; unsigned char c;
current->thread.request.u.thread.proc = idle_proc; current->thread.request.u.thread.proc = idle_proc;
current->thread.request.u.thread.arg = (void *) cpu; current->thread.request.u.thread.arg = (void *) cpu;
new_task = fork_idle(cpu); new_task = fork_idle(cpu);
if(IS_ERR(new_task)) if(IS_ERR(new_task))
panic("copy_process failed in idle_thread, error = %ld", panic("copy_process failed in idle_thread, error = %ld",
...@@ -111,7 +111,7 @@ static struct task_struct *idle_thread(int cpu) ...@@ -111,7 +111,7 @@ static struct task_struct *idle_thread(int cpu)
CHOOSE_MODE(os_write_file_k(new_task->thread.mode.tt.switch_pipe[1], &c, CHOOSE_MODE(os_write_file_k(new_task->thread.mode.tt.switch_pipe[1], &c,
sizeof(c)), sizeof(c)),
({ panic("skas mode doesn't support SMP"); })); ({ panic("skas mode doesn't support SMP"); }));
return(new_task); return new_task;
} }
void smp_prepare_cpus(unsigned int maxcpus) void smp_prepare_cpus(unsigned int maxcpus)
...@@ -162,13 +162,13 @@ int __cpu_up(unsigned int cpu) ...@@ -162,13 +162,13 @@ int __cpu_up(unsigned int cpu)
cpu_set(cpu, smp_commenced_mask); cpu_set(cpu, smp_commenced_mask);
while (!cpu_isset(cpu, cpu_online_map)) while (!cpu_isset(cpu, cpu_online_map))
mb(); mb();
return(0); return 0;
} }
int setup_profiling_timer(unsigned int multiplier) int setup_profiling_timer(unsigned int multiplier)
{ {
printk(KERN_INFO "setup_profiling_timer\n"); printk(KERN_INFO "setup_profiling_timer\n");
return(0); return 0;
} }
void smp_call_function_slave(int cpu); void smp_call_function_slave(int cpu);
...@@ -204,7 +204,7 @@ void IPI_handler(int cpu) ...@@ -204,7 +204,7 @@ void IPI_handler(int cpu)
int hard_smp_processor_id(void) int hard_smp_processor_id(void)
{ {
return(pid_to_processor_id(os_getpid())); return pid_to_processor_id(os_getpid());
} }
static DEFINE_SPINLOCK(call_lock); static DEFINE_SPINLOCK(call_lock);
...@@ -253,14 +253,3 @@ int smp_call_function(void (*_func)(void *info), void *_info, int nonatomic, ...@@ -253,14 +253,3 @@ int smp_call_function(void (*_func)(void *info), void *_info, int nonatomic,
} }
#endif #endif
/*
* 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:
*/
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment