From 4b35354d399d4ee201cd8f652335d8e1b1a79f7b Mon Sep 17 00:00:00 2001 From: Myles Watsonmylesgw Date: Wed, 13 May 2009 02:48:58 +0000 Subject: Remove a shadowed variable and an unnecessary local variable in cbfstool/fs.c. It is nearly trivial. Signed-off-by: Myles Watson Acked-by: Ronald G. Minnich git-svn-id: svn://svn.coreboot.org/coreboot/trunk@4279 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1 --- util/cbfstool/fs.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'util/cbfstool') diff --git a/util/cbfstool/fs.c b/util/cbfstool/fs.c index 536804c30e..f617159563 100644 --- a/util/cbfstool/fs.c +++ b/util/cbfstool/fs.c @@ -103,7 +103,6 @@ struct cbfs_file * rom_alloc(struct rom *rom, const char *name, unsigned long si struct cbfs_file *c = NULL; unsigned long nextoffset, truncoffset; struct cbfs_file *newfile = NULL; - unsigned int csize; while (offset < rom->fssize) { @@ -150,11 +149,9 @@ struct cbfs_file * rom_alloc(struct rom *rom, const char *name, unsigned long si c->len = htonl(size); - csize = headersize(name); - strcpy(c->magic, COMPONENT_MAGIC); - c->offset = htonl(csize); + c->offset = htonl(headersize(name)); c->type = htonl(type); @@ -249,7 +246,6 @@ int rom_remove(struct rom *rom, const char *name) int rom_extract(struct rom *rom, const char *name, void** buf, int *size ) { struct cbfs_file *c = rom_find_by_name(rom, name); - unsigned int csize; if (c == NULL) { ERROR("Component %s does not exist\n", name); @@ -257,9 +253,7 @@ int rom_extract(struct rom *rom, const char *name, void** buf, int *size ) } *size = ntohl(c->len); - - csize = headersize(name); - *buf = ((unsigned char *)c) + csize; + *buf = ((unsigned char *)c) + headersize(name); return 0; } -- cgit v1.2.3