From c5fc7db3559e080858461b724251f87be6faa2cd Mon Sep 17 00:00:00 2001 From: Patrick Georgi Date: Wed, 7 Mar 2012 15:55:47 +0100 Subject: Move C labels to start-of-line Also mark the corresponding lint test stable. Change-Id: Ib7c9ed88c5254bf56e68c01cdbd5ab91cd7bfc2f Signed-off-by: Patrick Georgi Reviewed-on: http://review.coreboot.org/772 Tested-by: build bot (Jenkins) Reviewed-by: Stefan Reinauer --- src/arch/x86/boot/mpspec.c | 2 +- src/arch/x86/lib/cpu.c | 2 +- src/boot/selfboot.c | 2 +- src/console/vtxprintf.c | 2 +- src/cpu/x86/lapic/secondary.S | 2 +- src/devices/oprom/yabel/pmm.c | 2 +- src/lib/xmodem.c | 2 +- src/northbridge/amd/amdk8/raminit.c | 2 +- src/northbridge/amd/amdk8/raminit_f.c | 6 +++--- src/northbridge/amd/amdk8/raminit_test.c | 2 +- src/northbridge/intel/e7520/raminit.c | 6 +++--- src/northbridge/intel/e7525/raminit.c | 6 +++--- src/northbridge/intel/i3100/raminit.c | 6 +++--- src/northbridge/intel/i3100/raminit_ep80579.c | 2 +- src/northbridge/intel/i945/raminit.c | 2 +- src/southbridge/amd/cs5536/early_smbus.c | 2 +- util/lint/lint-004-style-labels | 22 ---------------------- util/lint/lint-stable-004-style-labels | 22 ++++++++++++++++++++++ 18 files changed, 46 insertions(+), 46 deletions(-) delete mode 100755 util/lint/lint-004-style-labels create mode 100755 util/lint/lint-stable-004-style-labels diff --git a/src/arch/x86/boot/mpspec.c b/src/arch/x86/boot/mpspec.c index d519cfaacc..e7d767b7ac 100644 --- a/src/arch/x86/boot/mpspec.c +++ b/src/arch/x86/boot/mpspec.c @@ -267,7 +267,7 @@ void smp_write_intsrc_pci_bridge(struct mp_config_table *mc, smp_write_intsrc_pci_bridge(mc, irqtype, irqflag, child, dstapic, dstirq_x); } - next: +next: child = child->sibling; } diff --git a/src/arch/x86/lib/cpu.c b/src/arch/x86/lib/cpu.c index 8aacaac196..a7f7b322c0 100644 --- a/src/arch/x86/lib/cpu.c +++ b/src/arch/x86/lib/cpu.c @@ -227,7 +227,7 @@ static void set_cpu_ops(struct device *cpu) } } return; - found: +found: cpu->ops = driver->ops; } diff --git a/src/boot/selfboot.c b/src/boot/selfboot.c index c45fa63652..99b1493ed7 100644 --- a/src/boot/selfboot.c +++ b/src/boot/selfboot.c @@ -511,7 +511,7 @@ static int selfboot(struct lb_memory *mem, struct cbfs_payload *payload) jmp_to_elf_entry((void*)entry, bounce_buffer, bounce_size); return 1; - out: +out: return 0; } diff --git a/src/console/vtxprintf.c b/src/console/vtxprintf.c index 944fd5b96f..405302311d 100644 --- a/src/console/vtxprintf.c +++ b/src/console/vtxprintf.c @@ -123,7 +123,7 @@ int vtxprintf(void (*tx_byte)(unsigned char byte), const char *fmt, va_list args /* process flags */ flags = 0; - repeat: +repeat: ++fmt; /* this also skips first '%' */ switch (*fmt) { case '-': flags |= LEFT; goto repeat; diff --git a/src/cpu/x86/lapic/secondary.S b/src/cpu/x86/lapic/secondary.S index 5c1e7607e8..dc00b082e9 100644 --- a/src/cpu/x86/lapic/secondary.S +++ b/src/cpu/x86/lapic/secondary.S @@ -47,7 +47,7 @@ _secondary_start: 1: hlt jmp 1b - gdtaddr: +gdtaddr: .word gdt_limit /* the table limit */ .long gdt /* we know the offset */ diff --git a/src/devices/oprom/yabel/pmm.c b/src/devices/oprom/yabel/pmm.c index 989bde4d27..19d14d46b6 100644 --- a/src/devices/oprom/yabel/pmm.c +++ b/src/devices/oprom/yabel/pmm.c @@ -267,7 +267,7 @@ void pmm_handleInt() rval = 0xFFFFFFFF; goto exit; } - exit: +exit: /* exit handler of this function, restore registers, put return value in DX:AX */ M.x86 = backup_regs; M.x86.R_DX = (u16) ((rval >> 16) & 0xFFFF); diff --git a/src/lib/xmodem.c b/src/lib/xmodem.c index 2d553bed03..a00653a731 100644 --- a/src/lib/xmodem.c +++ b/src/lib/xmodem.c @@ -166,7 +166,7 @@ int xmodemReceive(unsigned char *dest, int destsz) _outbyte(ACK); continue; } - reject: +reject: flushinput(); _outbyte(NAK); } diff --git a/src/northbridge/amd/amdk8/raminit.c b/src/northbridge/amd/amdk8/raminit.c index eb33a39745..9cb7c60004 100644 --- a/src/northbridge/amd/amdk8/raminit.c +++ b/src/northbridge/amd/amdk8/raminit.c @@ -681,7 +681,7 @@ hw_err: #if CONFIG_QRANK_DIMM_SUPPORT sz.rank = 0; #endif - out: +out: return sz; } diff --git a/src/northbridge/amd/amdk8/raminit_f.c b/src/northbridge/amd/amdk8/raminit_f.c index dc3addbe87..33df485c8c 100644 --- a/src/northbridge/amd/amdk8/raminit_f.c +++ b/src/northbridge/amd/amdk8/raminit_f.c @@ -49,7 +49,7 @@ /* for PCI_ADDR(0, 0x18, 2, 0x98) index, and PCI_ADDR(0x, 0x18, 2, 0x9c) data */ /* - index: +index: [29: 0] DctOffset (Dram Controller Offset) [30:30] DctAccessWrite (Dram Controller Read/Write Select) 0 = read access @@ -659,7 +659,7 @@ static void sdram_set_registers(const struct mem_controller *ctrl, struct sys_in /* for PCI_ADDR(0, 0x18, 2, 0x98) index, and PCI_ADDR(0x, 0x18, 2, 0x9c) data */ /* - index: +index: [29: 0] DctOffset (Dram Controller Offset) [30:30] DctAccessWrite (Dram Controller Read/Write Select) 0 = read access @@ -820,7 +820,7 @@ static void spd_get_dimm_size(unsigned device, struct dimm_size *sz) sz->col = 0; sz->bank = 0; sz->rank = 0; - out: +out: return; } diff --git a/src/northbridge/amd/amdk8/raminit_test.c b/src/northbridge/amd/amdk8/raminit_test.c index e2a13a3c6d..fd2107cce9 100644 --- a/src/northbridge/amd/amdk8/raminit_test.c +++ b/src/northbridge/amd/amdk8/raminit_test.c @@ -419,7 +419,7 @@ static void do_test2(int i) raminit_main(); - done: +done: memcpy(&end_buf, &tmp_buf, sizeof(end_buf)); } diff --git a/src/northbridge/intel/e7520/raminit.c b/src/northbridge/intel/e7520/raminit.c index e9a60f1e20..d226085d0d 100644 --- a/src/northbridge/intel/e7520/raminit.c +++ b/src/northbridge/intel/e7520/raminit.c @@ -161,7 +161,7 @@ static struct dimm_size spd_get_dimm_size(unsigned device) hw_err: sz.side1 = 0; sz.side2 = 0; - out: +out: return sz; } @@ -286,7 +286,7 @@ static int spd_set_row_attributes(const struct mem_controller *ctrl, /* If an hw_error occurs report that I have no memory */ hw_err: dra = 0; - out: +out: return dra; } @@ -658,7 +658,7 @@ static int spd_set_dram_controller_mode(const struct mem_controller *ctrl, /* If an hw_error occurs report that I have no memory */ hw_err: drc = 0; - out: +out: return drc; } diff --git a/src/northbridge/intel/e7525/raminit.c b/src/northbridge/intel/e7525/raminit.c index e341596997..b5895bc647 100644 --- a/src/northbridge/intel/e7525/raminit.c +++ b/src/northbridge/intel/e7525/raminit.c @@ -164,7 +164,7 @@ static struct dimm_size spd_get_dimm_size(unsigned device) hw_err: sz.side1 = 0; sz.side2 = 0; - out: +out: return sz; } @@ -291,7 +291,7 @@ static int spd_set_row_attributes(const struct mem_controller *ctrl, /* If an hw_error occurs report that I have no memory */ hw_err: dra = 0; - out: +out: return dra; } @@ -664,7 +664,7 @@ static int spd_set_dram_controller_mode(const struct mem_controller *ctrl, /* If an hw_error occurs report that I have no memory */ hw_err: drc = 0; - out: +out: return drc; } diff --git a/src/northbridge/intel/i3100/raminit.c b/src/northbridge/intel/i3100/raminit.c index ced3de1e22..926d5b3afb 100644 --- a/src/northbridge/intel/i3100/raminit.c +++ b/src/northbridge/intel/i3100/raminit.c @@ -154,7 +154,7 @@ static struct dimm_size spd_get_dimm_size(u16 device) hw_err: sz.side1 = 0; sz.side2 = 0; - out: +out: return sz; } @@ -281,7 +281,7 @@ static int spd_set_row_attributes(const struct mem_controller *ctrl, /* If an hw_error occurs report that I have no memory */ hw_err: dra = 0; - out: +out: return dra; } @@ -597,7 +597,7 @@ static int spd_set_dram_controller_mode(const struct mem_controller *ctrl, /* If an hw_error occurs report that I have no memory */ hw_err: drc = 0; - out: +out: return drc; } diff --git a/src/northbridge/intel/i3100/raminit_ep80579.c b/src/northbridge/intel/i3100/raminit_ep80579.c index de3ffcefa5..79fc5f72e2 100644 --- a/src/northbridge/intel/i3100/raminit_ep80579.c +++ b/src/northbridge/intel/i3100/raminit_ep80579.c @@ -126,7 +126,7 @@ static struct dimm_size spd_get_dimm_size(u16 device) hw_err: sz.side1 = 0; sz.side2 = 0; - out: +out: print_debug("dimm "); print_debug_hex8(device); print_debug(" size = "); diff --git a/src/northbridge/intel/i945/raminit.c b/src/northbridge/intel/i945/raminit.c index d92c00672e..a4512d7ba8 100644 --- a/src/northbridge/intel/i945/raminit.c +++ b/src/northbridge/intel/i945/raminit.c @@ -1478,7 +1478,7 @@ static struct dimm_size sdram_get_dimm_size(struct sys_info *sysinfo, u16 dimmno */ sz.side1 = 0; sz.side2 = 0; - out: +out: return sz; } diff --git a/src/southbridge/amd/cs5536/early_smbus.c b/src/southbridge/amd/cs5536/early_smbus.c index 5cb815d250..814bc5a1fb 100644 --- a/src/southbridge/amd/cs5536/early_smbus.c +++ b/src/southbridge/amd/cs5536/early_smbus.c @@ -194,7 +194,7 @@ static unsigned char do_smbus_read_byte(unsigned smbus_io_base, return smbus_get_result(smbus_io_base); - err: +err: print_debug("SMBUS READ ERROR:"); print_debug_hex8(error); print_debug(" device:"); diff --git a/util/lint/lint-004-style-labels b/util/lint/lint-004-style-labels deleted file mode 100755 index 31ad74e0e4..0000000000 --- a/util/lint/lint-004-style-labels +++ /dev/null @@ -1,22 +0,0 @@ -#!/bin/sh -# This file is part of the coreboot project. -# -# Copyright (C) 2012 Patrick Georgi -# -# 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 Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA -# -# DESCR: Check that C labels begin at start-of-line - -LC_ALL=C export LC_ALL -find src -name '*.[scS]' -exec grep '^[[:space:]][[:space:]]*[a-z][a-z]*:[[:space:]]*$' {} + |grep -v "[^a-z_]default:" diff --git a/util/lint/lint-stable-004-style-labels b/util/lint/lint-stable-004-style-labels new file mode 100755 index 0000000000..31ad74e0e4 --- /dev/null +++ b/util/lint/lint-stable-004-style-labels @@ -0,0 +1,22 @@ +#!/bin/sh +# This file is part of the coreboot project. +# +# Copyright (C) 2012 Patrick Georgi +# +# 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 Free Software Foundation; version 2 of the License. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA +# +# DESCR: Check that C labels begin at start-of-line + +LC_ALL=C export LC_ALL +find src -name '*.[scS]' -exec grep '^[[:space:]][[:space:]]*[a-z][a-z]*:[[:space:]]*$' {} + |grep -v "[^a-z_]default:" -- cgit v1.2.3