Skip to contentSkip to conversation

Pb1000 code style cleanup

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

lore
Share & tools
lore
#0 lore raw

PATCH 5/11 Pb1000 code style cleanup

Fix several errors and warnings given by checkpatch.pl:

- use of C99 // comments;

- brace not on the same line with condition in the 'switch' statement;

- printk() without KERN_* facility level;

- unnecessary braces for single-statement block;

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

In addition to these changes, also do the following:

- properly indent the 'switch' statement;

- remove needless parentheses;

- insert spaces between operator and its operands;

- replace numeric literals/expressions with the matching macros;

- remove useless #if dirctive from board_setup();

- remove unneeded numeric literal type casts;

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

- replace spaces after the macro name with tabs in the #define directives, and sometimes insert spaces there;

- remove excess new lines;

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

- make the multi-line comment style consistent with the kernel style elsewhere by adding empty first/last line;

- combine some comments;

- update MontaVista copyright;

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

 arch/mips/au1000/pb1000/Makefile      |    8 +-
 arch/mips/au1000/pb1000/board_setup.c |  110 +++++++++++++++++-----------------
 arch/mips/au1000/pb1000/init.c        |   20 ++----
 include/asm-mips/mach-pb1x00/pb1000.h |  104 +++++++++++++++-----------------
 4 files changed, 121 insertions(+), 121 deletions(-)
arch/mips/au1000/pb1000/Makefile +4 -4
Index: linux-2.6/arch/mips/au1000/pb1000/Makefile
===================================================================
@@ -1,8 +1,8 @@
 #
-#  Copyright 2000 MontaVista Software Inc.
-#  Author: MontaVista Software, Inc.
-#     	[email protected] or [email protected]
+#  Copyright 2000, 2008 MontaVista Software Inc.
+#  Author: MontaVista Software, Inc. <[email protected]>
+#
+# Makefile for the Alchemy Semiconductor Pb1000 board.
 #
-# Makefile for the Alchemy Semiconductor PB1000 board.
 
 lib-y := init.o board_setup.o irqmap.o
arch/mips/au1000/pb1000/board_setup.c +57 -53

185 lines not on this page · raw message

arch/mips/au1000/pb1000/init.c +9 -11
Index: linux-2.6/arch/mips/au1000/pb1000/init.c
===================================================================
@@ -1,10 +1,9 @@
 /*
  * BRIEF MODULE DESCRIPTION
- *	PB1000 board setup
+ *	Pb1000 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
@@ -44,16 +43,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 = 0x04000000;
-	} else {
-		memsize = simple_strtol(memsize_str, NULL, 0);
-	}
+	else
+		memsize = strict_strtol(memsize_str, 0, NULL);
 	add_memory_region(0, memsize, BOOT_MEM_RAM);
 }
include/asm-mips/mach-pb1x00/pb1000.h +51 -53

122 lines not on this page · raw message

#1 lore raw

Applied after fixing up a major reject. You probably want to verify the result. Thanks,

Ralf

#2 lore raw

Hello.

Quoted 1 line

Applied after fixing up a major reject.

That's because you've missed appied ""Pb1000: bury the remnants of the
PCI code (part 2) I psoted the day before the patchset... :-/

Quoted 1 line

You probably want to verify the result.

Looked OK.

Quoted 1 line

Thanks,

Thanks for applying it.

Quoted 1 line

Ralf

WBR, Sergei