Skip to content

Commit a5ed1ff

Browse files
cfd-36Linus Torvalds
authored andcommitted
uml: formatting fixes
Formatting fixes - style violations whitespace breakage emacs formatting comment removal 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>
1 parent 11100b1 commit a5ed1ff

4 files changed

Lines changed: 67 additions & 83 deletions

File tree

‎arch/um/kernel/um_arch.c‎

Lines changed: 25 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ struct cpuinfo_um boot_cpu_data = {
6363

6464
unsigned long thread_saved_pc(struct task_struct *task)
6565
{
66-
return(os_process_pc(CHOOSE_MODE_PROC(thread_pid_tt, thread_pid_skas,
67-
task)));
66+
return os_process_pc(CHOOSE_MODE_PROC(thread_pid_tt, thread_pid_skas,
67+
task));
6868
}
6969

7070
static int show_cpuinfo(struct seq_file *m, void *v)
@@ -86,7 +86,7 @@ static int show_cpuinfo(struct seq_file *m, void *v)
8686
loops_per_jiffy/(500000/HZ),
8787
(loops_per_jiffy/(5000/HZ)) % 100);
8888

89-
return(0);
89+
return 0;
9090
}
9191

9292
static void *c_start(struct seq_file *m, loff_t *pos)
@@ -212,12 +212,12 @@ __uml_setup("debug", no_skas_debug_setup,
212212
#ifdef CONFIG_SMP
213213
static int __init uml_ncpus_setup(char *line, int *add)
214214
{
215-
if (!sscanf(line, "%d", &ncpus)) {
216-
printf("Couldn't parse [%s]\n", line);
217-
return -1;
218-
}
215+
if (!sscanf(line, "%d", &ncpus)) {
216+
printf("Couldn't parse [%s]\n", line);
217+
return -1;
218+
}
219219

220-
return 0;
220+
return 0;
221221
}
222222

223223
__uml_setup("ncpus=", uml_ncpus_setup,
@@ -234,7 +234,7 @@ static int force_tt = 0;
234234
static int __init mode_tt_setup(char *line, int *add)
235235
{
236236
force_tt = 1;
237-
return(0);
237+
return 0;
238238
}
239239

240240
#else
@@ -245,7 +245,7 @@ static int __init mode_tt_setup(char *line, int *add)
245245
static int __init mode_tt_setup(char *line, int *add)
246246
{
247247
printf("CONFIG_MODE_TT disabled - 'mode=tt' ignored\n");
248-
return(0);
248+
return 0;
249249
}
250250

251251
#else
@@ -256,7 +256,7 @@ static int __init mode_tt_setup(char *line, int *add)
256256
static int __init mode_tt_setup(char *line, int *add)
257257
{
258258
printf("CONFIG_MODE_SKAS disabled - 'mode=tt' redundant\n");
259-
return(0);
259+
return 0;
260260
}
261261

262262
#endif
@@ -274,16 +274,15 @@ int mode_tt = DEFAULT_TT;
274274

275275
static int __init Usage(char *line, int *add)
276276
{
277-
const char **p;
277+
const char **p;
278278

279279
printf(usage_string, init_utsname()->release);
280-
p = &__uml_help_start;
281-
while (p < &__uml_help_end) {
282-
printf("%s", *p);
283-
p++;
284-
}
280+
p = &__uml_help_start;
281+
while (p < &__uml_help_end) {
282+
printf("%s", *p);
283+
p++;
284+
}
285285
exit(0);
286-
287286
return 0;
288287
}
289288

@@ -379,8 +378,8 @@ int __init linux_main(int argc, char **argv)
379378
set_task_sizes_skas, &task_size);
380379

381380
/*
382-
* Setting up handlers to 'sig_info' struct
383-
*/
381+
* Setting up handlers to 'sig_info' struct
382+
*/
384383
os_fill_handlinfo(handlinfo_kern);
385384

386385
brk_start = (unsigned long) sbrk(0);
@@ -407,7 +406,7 @@ int __init linux_main(int argc, char **argv)
407406
argv1_begin = argv[1];
408407
argv1_end = &argv[1][strlen(argv[1])];
409408
#endif
410-
409+
411410
highmem = 0;
412411
iomem_size = (iomem_size + PAGE_SIZE - 1) & PAGE_MASK;
413412
max_physmem = get_kmem_end() - uml_physmem - iomem_size - MIN_VMALLOC;
@@ -449,12 +448,12 @@ int __init linux_main(int argc, char **argv)
449448
printf("Kernel virtual memory size shrunk to %lu bytes\n",
450449
virtmem_size);
451450

452-
uml_postsetup();
451+
uml_postsetup();
453452

454453
task_protections((unsigned long) &init_thread_info);
455454
os_flush_stdout();
456455

457-
return(CHOOSE_MODE(start_uml_tt(), start_uml_skas()));
456+
return CHOOSE_MODE(start_uml_tt(), start_uml_skas());
458457
}
459458

460459
extern int uml_exitcode;
@@ -467,7 +466,7 @@ static int panic_exit(struct notifier_block *self, unsigned long unused1,
467466
bust_spinlocks(0);
468467
uml_exitcode = 1;
469468
machine_halt();
470-
return(0);
469+
return 0;
471470
}
472471

473472
static struct notifier_block panic_exit_notifier = {
@@ -482,14 +481,14 @@ void __init setup_arch(char **cmdline_p)
482481
&panic_exit_notifier);
483482
paging_init();
484483
strlcpy(boot_command_line, command_line, COMMAND_LINE_SIZE);
485-
*cmdline_p = command_line;
484+
*cmdline_p = command_line;
486485
setup_hostinfo();
487486
}
488487

489488
void __init check_bugs(void)
490489
{
491490
arch_check_bugs();
492-
os_check_bugs();
491+
os_check_bugs();
493492
}
494493

495494
void apply_alternatives(struct alt_instr *start, struct alt_instr *end)

‎arch/um/os-Linux/main.c‎

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ int main(int argc, char **argv, char **envp)
218218
ret = 1;
219219
}
220220
printf("\n");
221-
return(uml_exitcode);
221+
return uml_exitcode;
222222
}
223223

224224
#define CAN_KMALLOC() \
@@ -231,7 +231,7 @@ void *__wrap_malloc(int size)
231231
void *ret;
232232

233233
if(!CAN_KMALLOC())
234-
return(__real_malloc(size));
234+
return __real_malloc(size);
235235
else if(size <= PAGE_SIZE) /* finding contiguos pages can be hard*/
236236
ret = um_kmalloc(size);
237237
else ret = um_vmalloc(size);
@@ -242,16 +242,17 @@ void *__wrap_malloc(int size)
242242
if(ret == NULL)
243243
errno = ENOMEM;
244244

245-
return(ret);
245+
return ret;
246246
}
247247

248248
void *__wrap_calloc(int n, int size)
249249
{
250250
void *ptr = __wrap_malloc(n * size);
251251

252-
if(ptr == NULL) return(NULL);
252+
if(ptr == NULL)
253+
return NULL;
253254
memset(ptr, 0, n * size);
254-
return(ptr);
255+
return ptr;
255256
}
256257

257258
extern void __real_free(void *);

‎arch/um/sys-i386/bugs.c‎

Lines changed: 24 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/*
1+
/*
22
* Copyright (C) 2002 Jeff Dike (jdike@karaya.com)
33
* Licensed under the GPL
44
*/
@@ -32,21 +32,21 @@ static char token(int fd, char *buf, int len, char stop)
3232
n = os_read_file(fd, ptr, sizeof(*ptr));
3333
c = *ptr++;
3434
if(n != sizeof(*ptr)){
35-
if(n == 0) return(0);
35+
if(n == 0)
36+
return 0;
3637
printk("Reading /proc/cpuinfo failed, err = %d\n", -n);
3738
if(n < 0)
38-
return(n);
39-
else
40-
return(-EIO);
39+
return n;
40+
else return -EIO;
4141
}
4242
} while((c != '\n') && (c != stop) && (ptr < end));
4343

4444
if(ptr == end){
4545
printk("Failed to find '%c' in /proc/cpuinfo\n", stop);
46-
return(-1);
46+
return -1;
4747
}
4848
*(ptr - 1) = '\0';
49-
return(c);
49+
return c;
5050
}
5151

5252
static int find_cpuinfo_line(int fd, char *key, char *scratch, int len)
@@ -58,25 +58,25 @@ static int find_cpuinfo_line(int fd, char *key, char *scratch, int len)
5858
while(1){
5959
c = token(fd, scratch, len - 1, ':');
6060
if(c <= 0)
61-
return(0);
61+
return 0;
6262
else if(c != ':'){
6363
printk("Failed to find ':' in /proc/cpuinfo\n");
64-
return(0);
64+
return 0;
6565
}
6666

6767
if(!strncmp(scratch, key, strlen(key)))
68-
return(1);
68+
return 1;
6969

7070
do {
7171
n = os_read_file(fd, &c, sizeof(c));
7272
if(n != sizeof(c)){
7373
printk("Failed to find newline in "
7474
"/proc/cpuinfo, err = %d\n", -n);
75-
return(0);
75+
return 0;
7676
}
7777
} while(c != '\n');
7878
}
79-
return(0);
79+
return 0;
8080
}
8181

8282
static int check_cpu_flag(char *feature, int *have_it)
@@ -96,15 +96,17 @@ static int check_cpu_flag(char *feature, int *have_it)
9696
goto out;
9797

9898
c = token(fd, buf, len - 1, ' ');
99-
if(c < 0) goto out;
99+
if(c < 0)
100+
goto out;
100101
else if(c != ' '){
101102
printk("Failed to find ' ' in /proc/cpuinfo\n");
102103
goto out;
103104
}
104105

105106
while(1){
106107
c = token(fd, buf, len - 1, ' ');
107-
if(c < 0) goto out;
108+
if(c < 0)
109+
goto out;
108110
else if(c == '\n') break;
109111

110112
if(!strcmp(buf, feature)){
@@ -113,8 +115,10 @@ static int check_cpu_flag(char *feature, int *have_it)
113115
}
114116
}
115117
out:
116-
if(*have_it == 0) printk("No\n");
117-
else if(*have_it == 1) printk("Yes\n");
118+
if(*have_it == 0)
119+
printk("No\n");
120+
else if(*have_it == 1)
121+
printk("Yes\n");
118122
os_close_file(fd);
119123
return 1;
120124
}
@@ -166,12 +170,13 @@ int arch_handle_signal(int sig, union uml_pt_regs *regs)
166170
/* This is testing for a cmov (0x0f 0x4x) instruction causing a
167171
* SIGILL in init.
168172
*/
169-
if((sig != SIGILL) || (TASK_PID(get_current()) != 1)) return(0);
173+
if((sig != SIGILL) || (TASK_PID(get_current()) != 1))
174+
return 0;
170175

171176
if (copy_from_user_proc(tmp, (void *) UPT_IP(regs), 2))
172177
panic("SIGILL in init, could not read instructions!\n");
173178
if((tmp[0] != 0x0f) || ((tmp[1] & 0xf0) != 0x40))
174-
return(0);
179+
return 0;
175180

176181
if(host_has_cmov == 0)
177182
panic("SIGILL caused by cmov, which this processor doesn't "
@@ -185,16 +190,5 @@ int arch_handle_signal(int sig, union uml_pt_regs *regs)
185190
"implements it, boot a filesystem compiled for older "
186191
"processors");
187192
else panic("Bad value for host_has_cmov (%d)", host_has_cmov);
188-
return(0);
193+
return 0;
189194
}
190-
191-
/*
192-
* Overrides for Emacs so that we follow Linus's tabbing style.
193-
* Emacs will notice this stuff at the end of the file and automatically
194-
* adjust the settings for this buffer only. This must remain at the end
195-
* of the file.
196-
* ---------------------------------------------------------------------------
197-
* Local variables:
198-
* c-file-style: "linux"
199-
* End:
200-
*/

‎arch/um/sys-x86_64/bugs.c‎

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ void arch_check_bugs(void)
2121

2222
int arch_handle_signal(int sig, union uml_pt_regs *regs)
2323
{
24-
return(0);
24+
return 0;
2525
}
2626

2727
#define MAXTOKEN 64
@@ -41,21 +41,21 @@ static char token(int fd, char *buf, int len, char stop)
4141
n = os_read_file(fd, ptr, sizeof(*ptr));
4242
c = *ptr++;
4343
if(n != sizeof(*ptr)){
44-
if(n == 0) return(0);
44+
if(n == 0)
45+
return 0;
4546
printk("Reading /proc/cpuinfo failed, err = %d\n", -n);
4647
if(n < 0)
47-
return(n);
48-
else
49-
return(-EIO);
48+
return n;
49+
else return -EIO;
5050
}
5151
} while((c != '\n') && (c != stop) && (ptr < end));
5252

5353
if(ptr == end){
5454
printk("Failed to find '%c' in /proc/cpuinfo\n", stop);
55-
return(-1);
55+
return -1;
5656
}
5757
*(ptr - 1) = '\0';
58-
return(c);
58+
return c;
5959
}
6060

6161
static int find_cpuinfo_line(int fd, char *key, char *scratch, int len)
@@ -67,33 +67,23 @@ static int find_cpuinfo_line(int fd, char *key, char *scratch, int len)
6767
while(1){
6868
c = token(fd, scratch, len - 1, ':');
6969
if(c <= 0)
70-
return(0);
70+
return 0;
7171
else if(c != ':'){
7272
printk("Failed to find ':' in /proc/cpuinfo\n");
73-
return(0);
73+
return 0;
7474
}
7575

7676
if(!strncmp(scratch, key, strlen(key)))
77-
return(1);
77+
return 1;
7878

7979
do {
8080
n = os_read_file(fd, &c, sizeof(c));
8181
if(n != sizeof(c)){
8282
printk("Failed to find newline in "
8383
"/proc/cpuinfo, err = %d\n", -n);
84-
return(0);
84+
return 0;
8585
}
8686
} while(c != '\n');
8787
}
88-
return(0);
88+
return 0;
8989
}
90-
91-
/* Overrides for Emacs so that we follow Linus's tabbing style.
92-
* Emacs will notice this stuff at the end of the file and automatically
93-
* adjust the settings for this buffer only. This must remain at the end
94-
* of the file.
95-
* ---------------------------------------------------------------------------
96-
* Local variables:
97-
* c-file-style: "linux"
98-
* End:
99-
*/

0 commit comments

Comments
 (0)