Pb1500 code style cleanup
PATCH 7/11 Pb1500 code style cleanup
Fix several errors and warnings given by checkpatch.pl:
- use of C99 // comments;
- 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:
- replace numeric literals/expressions with the matching macros;
- insert spaces between operator and its operands;
- properly indent the code and the array initializers;
- remove useless #if dirctive from board_setup();
- remove needless parentheses;
- remove unneeded type casts;
- remove excess new lines;
- make hexadecimal literals all lower case;
- remove space after the type cast's closing parenthesis;
- insert missing space before closing brace in the array initializers;
- replace spaces after the macro name with tabs in the #define directives, also sometimes insert space there for better looks;
- fix typos/errors, capitalize acronyms, etc. in the comments;
- update MontaVista copyright;
- remove Pete Popov's old email address...
arch/mips/au1000/pb1500/Makefile | 6 ++-- arch/mips/au1000/pb1500/board_setup.c | 46 +++++++++++++++------------------- arch/mips/au1000/pb1500/init.c | 20 ++++++-------- arch/mips/au1000/pb1500/irqmap.c | 6 ++-- include/asm-mips/mach-pb1x00/pb1500.h | 42 ++++++++++++++----------------- 5 files changed, 56 insertions(+), 64 deletions(-)
arch/mips/au1000/pb1500/Makefile +3 -3
@@ -1,8 +1,8 @@ # -# Copyright 2000,2001 MontaVista Software Inc. -# Author: MontaVista Software, Inc. -# [email protected] or [email protected] +# Copyright 2000, 2001, 2008 MontaVista Software Inc. +# Author: MontaVista Software, Inc. <[email protected]> # # Makefile for the Alchemy Semiconductor Pb1500 board. +# lib-y := init.o board_setup.o irqmap.o
arch/mips/au1000/pb1500/board_setup.c +21 -25
105 lines not on this page · raw message
arch/mips/au1000/pb1500/init.c +9 -11
@@ -1,11 +1,10 @@/* * * BRIEF MODULE DESCRIPTION -* PB1500 board setup +* Pb1500 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 =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 ); }
arch/mips/au1000/pb1500/irqmap.c +3 -3
@@ -31,12 +31,12 @@#include <asm/mach-au1x00/au1000.h> char irq_tab_alchemy[][5 ]__initdata = { - [12 ] = {-1 ,INTA ,INTX ,INTX ,INTX },/* IDSEL 12 - HPT370 */ - [13 ] = {-1 ,INTA ,INTB ,INTC ,INTD },/* IDSEL 13 - PCI slot */ + [12 ] = {-1 ,INTA ,INTX ,INTX ,INTX },/* IDSEL 12 - HPT370 */ + [13 ] = {-1 ,INTA ,INTB ,INTC ,INTD },/* IDSEL 13 - PCI slot */ };struct au1xxx_irqmap __initdata au1xxx_irq_map[] = { - {AU1500_GPIO_204 ,INTC_INT_HIGH_LEVEL ,0 }, + {AU1500_GPIO_204 ,INTC_INT_HIGH_LEVEL ,0 }, {AU1500_GPIO_201 ,INTC_INT_LOW_LEVEL ,0 }, {AU1500_GPIO_202 ,INTC_INT_LOW_LEVEL ,0 }, {AU1500_GPIO_203 ,INTC_INT_LOW_LEVEL ,0 },
include/asm-mips/mach-pb1x00/pb1500.h +20 -22
54 lines not on this page · raw message
Ralf Baechle
AppliedApplied. Thanks,
Ralf