Skip to contentSkip to conversation

Pb1200/DBAu1200 code style cleanup

PATCH Applied Sergei Shtylyov 2 participants 2 messages Apr 30, 2008 – May 2, 2008 MIPS

lore
Share & tools
lore
#0 lore raw

PATCH 7/11 Pb1200/DBAu1200 code style cleanup

Fix several errors and warnings given by checkpatch.pl:

- use of C99 // comments;

- initialization of a 'static' variable to 0;

- space after opening and before closing parentheses;

- missing space between 'for' and opening parenthesis;

- macros with complex values not enclosed in parentheses;

- printk() without KERN_* facility level;

- unnecessary braces for single-statement block;

- using simple_strtol() where strict_strtol() could be used;

- line over 80 characters.

In addition to these changes, also do the following:

- mention DBAu1200 board in the Makefile;

- replace the group of #include/#ifdef directives by single #include <au1xxx.h> since this header contains the needed stuff;

- properly indent the blocks;

- insert spaces between operator and its operands, remove excess spaces there;

- remove needless parentheses and add some for clarity;

- replace numeric literals/expressions with the matching macros;

- remove space after the type cast's closing parenthesis;

- reduce pb1200_setup_cascade() to the single 'return' statement;

- reduce the number of printed empty lines in the so-called CPLD workaround;

- remove #undef AU1X00_EXTERNAL_INT since that macro is not defined anywhere;

- replace spaces after the macro name with tabs in the #define directives;

- remove excess tabs after the macro name in the #define directives;

- fix typo in the BCSR_RESETS_PWMR1mUX macro's name;

- group all Pb1200 PCMCIA definitions together;

- put the function's result type and name/parameters on the same line;

- insert missing and remove excess new lines;

- make the multi-line comment style consistent with the kernel style elsewhere by adding empty first line and/or adding space/asterisk on their left side;

- fix typos/errors, capitalize acronyms, etc. in the comments;

- combine some comments;

- update MontaVista copyright;

- remove Pete Popov's old email address...

 arch/mips/au1000/pb1200/Makefile      |    2 
 arch/mips/au1000/pb1200/board_setup.c |  131 ++++++++++++++++------------------
 arch/mips/au1000/pb1200/init.c        |   18 ++--
 arch/mips/au1000/pb1200/irqmap.c      |   66 +++++++----------
 include/asm-mips/mach-db1x00/db1200.h |   75 +++++++++----------
 include/asm-mips/mach-pb1x00/pb1200.h |   93 +++++++++++-------------
 6 files changed, 183 insertions(+), 202 deletions(-)
arch/mips/au1000/pb1200/Makefile +1 -1
Index: linux-2.6/arch/mips/au1000/pb1200/Makefile
===================================================================
@@ -1,5 +1,5 @@
 #
-# Makefile for the Alchemy Semiconductor PB1200 board.
+# Makefile for the Alchemy Semiconductor Pb1200/DBAu1200 boards.
 #
 
 lib-y := init.o board_setup.o irqmap.o
arch/mips/au1000/pb1200/board_setup.c +62 -69

184 lines not on this page · raw message

arch/mips/au1000/pb1200/init.c +8 -10
Index: linux-2.6/arch/mips/au1000/pb1200/init.c
===================================================================
@@ -3,9 +3,8 @@
  * BRIEF MODULE DESCRIPTION
  *	PB1200 board setup
  *
- * Copyright 2001 MontaVista Software Inc.
- * Author: MontaVista Software, Inc.
- *         	[email protected] or [email protected]
+ * Copyright 2001, 2008 MontaVista Software Inc.
+ * Author: MontaVista Software, Inc. <[email protected]>
  *
  *  This program is free software; you can redistribute  it and/or modify it
  *  under  the terms of  the GNU General  Public License as published by the
@@ -45,16 +44,15 @@ void __init prom_init(void)
 	unsigned char *memsize_str;
 	unsigned long memsize;
 
-	prom_argc = (int) fw_arg0;
-	prom_argv = (char **) fw_arg1;
-	prom_envp = (char **) fw_arg2;
+	prom_argc = (int)fw_arg0;
+	prom_argv = (char **)fw_arg1;
+	prom_envp = (char **)fw_arg2;
 
 	prom_init_cmdline();
 	memsize_str = prom_getenv("memsize");
-	if (!memsize_str) {
+	if (!memsize_str)
 		memsize = 0x08000000;
-	} else {
-		memsize = simple_strtol(memsize_str, NULL, 0);
-	}
+	else
+		memsize = strict_strtol(memsize_str, 0, NULL);
 	add_memory_region(0, memsize, BOOT_MEM_RAM);
 }
arch/mips/au1000/pb1200/irqmap.c +30 -36

110 lines not on this page · raw message

include/asm-mips/mach-db1x00/db1200.h +36 -39

125 lines not on this page · raw message

include/asm-mips/mach-pb1x00/pb1200.h +46 -47

156 lines not on this page · raw message