diff options
author | Sergei Shtylyov <sshtylyov@ru.mvista.com> | 2008-04-30 15:18:41 -0400 |
---|---|---|
committer | Ralf Baechle <ralf@linux-mips.org> | 2008-05-12 11:46:52 -0400 |
commit | c1dcb14ec2ae3c594ce1c2db953004083f2bd4a0 (patch) | |
tree | 1724db98ba009b3b8af1750af09f2992bc106eeb /arch/mips/au1000/common/prom.c | |
parent | ff6814d53016081947ff4021e00db3f806a561c9 (diff) |
[MIPS] Alchemy common code style cleanup
Fix many errors and warnings given by checkpatch.pl:
- use of C99 // comments;
- missing space between the type and asterisk in a variable declaration;
- space between the asterisk and function/variable name;
- leading spaces instead of tabs;
- space after opening and before closing parentheses;
- initialization of a 'static' variable to 0;
- missing spaces around assignement/comparison operator;
- brace not on the same line with condition (or 'else') in the 'if'/'switch'
statement;
- missing space between 'if'/'for'/'while' and opening parenthesis;
- use of assignement in 'if' statement's condition;
- printk() without KERN_* facility level;
- EXPORT_SYMBOL() not following its function immediately;
- unnecessary braces for single-statement block;
- adding new 'typedef' (where including <linux/types.h> will do);
- use of 'extern' in the .c file (where it can be avoided by including header);
- line over 80 characters.
In addition to these changes, also do the following:
- insert missing space after opening brace and/or before closing brace in the
structure initializers;
- insert spaces between operator and its operands;
- put the function's result type and name/parameters on the same line;
- properly indent multi-line expressions;
- remove commented out code;
- remove useless initializers and code;
- remove needless parentheses;
- fix broken/excess indentation;
- add missing spaces between operator and its operands;
- insert missing and remove excess new lines;
- group 'else' and 'if' together where possible;
- make au1xxx_platform_init() 'static';
- regroup variable declarations in pm_do_freq() for prettier look;
- replace numeric literals with the matching macros;
- fix printk() format specifiers mismatching the argument types;
- make the multi-line comment style consistent with the kernel style elsewhere
by adding empty first line and/or adding space on their left side;
- make two-line comments that only have one line of text one-line;
- fix typos/errors, capitalize acronyms, etc. in the comments;
- fix/remove obsolete references in the comments;
- reformat some comments;
- add comment about the CPU:counter clock ratio to calc_clock();
- update MontaVista copyright;
- remove Pete Popov's and Steve Longerbeam's old email addresses...
Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Ralf Baechle <ralf@linux-mips.org>
Diffstat (limited to 'arch/mips/au1000/common/prom.c')
-rw-r--r-- | arch/mips/au1000/common/prom.c | 21 |
1 files changed, 9 insertions, 12 deletions
diff --git a/arch/mips/au1000/common/prom.c b/arch/mips/au1000/common/prom.c index f10af829e4ec..18b310b475ca 100644 --- a/arch/mips/au1000/common/prom.c +++ b/arch/mips/au1000/common/prom.c | |||
@@ -3,9 +3,8 @@ | |||
3 | * BRIEF MODULE DESCRIPTION | 3 | * BRIEF MODULE DESCRIPTION |
4 | * PROM library initialisation code, supports YAMON and U-Boot. | 4 | * PROM library initialisation code, supports YAMON and U-Boot. |
5 | * | 5 | * |
6 | * Copyright 2000, 2001, 2006 MontaVista Software Inc. | 6 | * Copyright 2000-2001, 2006, 2008 MontaVista Software Inc. |
7 | * Author: MontaVista Software, Inc. | 7 | * Author: MontaVista Software, Inc. <source@mvista.com> |
8 | * ppopov@mvista.com or source@mvista.com | ||
9 | * | 8 | * |
10 | * This file was derived from Carsten Langgaard's | 9 | * This file was derived from Carsten Langgaard's |
11 | * arch/mips/mips-boards/xx files. | 10 | * arch/mips/mips-boards/xx files. |
@@ -57,7 +56,7 @@ void prom_init_cmdline(void) | |||
57 | actr = 1; /* Always ignore argv[0] */ | 56 | actr = 1; /* Always ignore argv[0] */ |
58 | 57 | ||
59 | cp = &(arcs_cmdline[0]); | 58 | cp = &(arcs_cmdline[0]); |
60 | while(actr < prom_argc) { | 59 | while (actr < prom_argc) { |
61 | strcpy(cp, prom_argv[actr]); | 60 | strcpy(cp, prom_argv[actr]); |
62 | cp += strlen(prom_argv[actr]); | 61 | cp += strlen(prom_argv[actr]); |
63 | *cp++ = ' '; | 62 | *cp++ = ' '; |
@@ -84,10 +83,8 @@ char *prom_getenv(char *envname) | |||
84 | if (yamon) { | 83 | if (yamon) { |
85 | if (strcmp(envname, *env++) == 0) | 84 | if (strcmp(envname, *env++) == 0) |
86 | return *env; | 85 | return *env; |
87 | } else { | 86 | } else if (strncmp(envname, *env, i) == 0 && (*env)[i] == '=') |
88 | if (strncmp(envname, *env, i) == 0 && (*env)[i] == '=') | 87 | return *env + i + 1; |
89 | return *env + i + 1; | ||
90 | } | ||
91 | env++; | 88 | env++; |
92 | } | 89 | } |
93 | 90 | ||
@@ -110,13 +107,13 @@ static inline void str2eaddr(unsigned char *ea, unsigned char *str) | |||
110 | { | 107 | { |
111 | int i; | 108 | int i; |
112 | 109 | ||
113 | for(i = 0; i < 6; i++) { | 110 | for (i = 0; i < 6; i++) { |
114 | unsigned char num; | 111 | unsigned char num; |
115 | 112 | ||
116 | if((*str == '.') || (*str == ':')) | 113 | if ((*str == '.') || (*str == ':')) |
117 | str++; | 114 | str++; |
118 | num = str2hexnum(*str++) << 4; | 115 | num = str2hexnum(*str++) << 4; |
119 | num |= (str2hexnum(*str++)); | 116 | num |= str2hexnum(*str++); |
120 | ea[i] = num; | 117 | ea[i] = num; |
121 | } | 118 | } |
122 | } | 119 | } |