From a8c461ba917a028594f41faacf66f8d7fc733ff3 Mon Sep 17 00:00:00 2001 From: Stefan Reinauer Date: Wed, 7 Mar 2007 01:05:35 +0000 Subject: [PATCH] * correct off by one error in lib/lar.c * correct LINUXBIOS_EXTRA_VERSION if it's empty in .config * enable warnings for breaking strict aliasing trivial. Signed-off-by: Stefan Reinauer Acked-by: Stefan Reinauer git-svn-id: svn://coreboot.org/repository/LinuxBIOSv3@208 f3766cd6-281f-0410-b1cd-43a5c92072e9 --- Makefile | 7 +++---- lib/lar.c | 7 +++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index a192c89ea4..3cab4d816f 100644 --- a/Makefile +++ b/Makefile @@ -37,9 +37,8 @@ MAKEFLAGS += --no-print-directory CC := gcc CFLAGS := -Os -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \ - -Werror-implicit-function-declaration \ - -fno-strict-aliasing -fno-common \ - -ffreestanding -fno-builtin + -Werror-implicit-function-declaration -Wstrict-aliasing \ + -fno-common -ffreestanding -fno-builtin HOSTCC := gcc HOSTCXX := g++ @@ -66,7 +65,7 @@ else include $(src)/.config -ifneq ($(CONFIG_LOCALVERSION),) +ifneq ($(CONFIG_LOCALVERSION),"") LINUXBIOS_EXTRA_VERSION := -$(shell echo $(CONFIG_LOCALVERSION)) endif diff --git a/lib/lar.c b/lib/lar.c index 5b8a0d2553..c00a08538e 100644 --- a/lib/lar.c +++ b/lib/lar.c @@ -39,9 +39,9 @@ int find_file(struct mem_file *archive, char *filename, struct mem_file *result) char * walk, *fullname; struct lar_header * header; printk(BIOS_INFO, "filename is %s\n", filename); -printk(BIOS_INFO, "start 0x%x len 0x%x\n", archive->start, archive->len); + printk(BIOS_SPEW, "start 0x%x len 0x%x\n", archive->start, archive->len); for (walk = archive->start; walk < (char *)archive->start + - archive->len; walk+=16) { + archive->len - 1; walk+=16) { if(strcmp(walk, MAGIC)!=0) continue; @@ -58,8 +58,7 @@ printk(BIOS_INFO, "fullname is %s\n", fullname); // skip file /* FIXME: This is doing the wrong thing. its skipping too much. - walk += ( ntohl(header->offset) + ntohl(header->len) - + 15 ) & 0xfffffff0; + walk += ( ntohl(header->offset) + ntohl(header->len) + 15 ) & 0xfffffff0; */ walk += 16; }