From: Patrick Georgi Date: Wed, 7 Mar 2012 14:55:47 +0000 (+0100) Subject: Move C labels to start-of-line X-Git-Url: http://wien.tomnetworks.com/gitweb/?p=coreboot.git;a=commitdiff_plain;h=c5fc7db3559e080858461b724251f87be6faa2cd 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 --- diff --git a/src/arch/x86/boot/mpspec.c b/src/arch/x86/boot/mpspec.c index d519cfaac..e7d767b7a 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 8aacaac19..a7f7b322c 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 c45fa6365..99b1493ed 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 944fd5b96..405302311 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 5c1e7607e..dc00b082e 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 989bde4d2..19d14d46b 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 2d553bed0..a00653a73 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 eb33a3974..9cb7c6000 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 dc3addbe8..33df485c8 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 e2a13a3c6..fd2107cce 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 e9a60f1e2..d226085d0 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 e34159699..b5895bc64 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 ced3de1e2..926d5b3af 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 de3ffcefa..79fc5f72e 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 d92c00672..a4512d7ba 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 5cb815d25..814bc5a1f 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 31ad74e0e..000000000 --- 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 000000000..31ad74e0e --- /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:"