[coreboot] [PATCH] No warnings for qemu build

Myles Watson mylesgw at gmail.com
Thu Nov 12 17:09:37 CET 2009

I think we should be pushing down the number of warnings in our code
with the goal of being able to use -Werror for all of our boards.
It's possible that we should add -Wno-unused-function, since there are
lots of those warnings that would be hard to avoid, but it would help
us keep our size down if we don't ignore that warning.

The attached patch adds a Kconfig variable WARNINGS_ARE_ERRORS and
sets it for qemu.

I think the changes all make sense except for casting a
cbmem_entry.base to u32 before void* in cbmem.c.  The problem is that
it is a very large can of worms to do it right and still allow 64-bit
pointers in a cbmem entry.

- Do we need cbmem entries above 4GB?
- Can we use void* for base instead of u64?  I like the idea of using
pointers for pointers.
- What's the "right" way?

Other changes:
- include delay.h and make the prototype match in emulation/northbridge.c
- remove unused cbmem_base and cbmem_size variables
- cast 0x400 to a (void*) before passing it to memset
- conditionally define lb_forward since it is only used with high_tables
- add a DECLARE_SPIN_LOCK macro to avoid unused spin locks
- remove unneeded gcc workaround once there are no unused spin locks

Abuild tested.

Signed-off-by: Myles Watson <mylesgw at gmail.com>


Removed warnings:
src/lib/cbmem.c: In function 'cbmem_add':
src/lib/cbmem.c:154: warning: cast to pointer from integer of different size
src/lib/cbmem.c: At top level:
src/lib/cbmem.c:38: warning: 'cbmem_base' defined but not used
src/lib/cbmem.c:39: warning: 'cbmem_size' defined but not used
src/console/printk.c:26: warning: 'console_lock' defined but not used
src/console/vsprintf.c:27: warning: 'vsprintf_lock' defined but not used
src/devices/device.c:61: warning: 'dev_lock' defined but not used
util/x86emu/x86.c: In function 'run_bios':
util/x86emu/x86.c:129: warning: passing argument 1 of 'memset' makes
pointer from integer without a cast
note: expected 'void *' but argument is of type 'int'
src/arch/i386/boot/coreboot_table.c:68: warning: 'lb_next_record'
defined but not used
src/arch/i386/boot/coreboot_table.c:221: warning: 'lb_forward' defined
but not used
src/cpu/emulation/qemu-x86/northbridge.c:160: warning: no previous
prototype for 'udelay'
-------------- next part --------------
A non-text attachment was scrubbed...
Name: warnings.diff
Type: text/x-patch
Size: 6243 bytes
Desc: not available
URL: <http://www.coreboot.org/pipermail/coreboot/attachments/20091112/3f144265/attachment.diff>

More information about the coreboot mailing list