[coreboot-gerrit] New patch to review for coreboot: 58d88f7 cbfstool: move iself() to eflheaders.c
Aaron Durbin (adurbin@google.com)
gerrit at coreboot.org
Tue Mar 11 18:11:39 CET 2014
Aaron Durbin (adurbin at google.com) just uploaded a new patch set to gerrit, which you can find at http://review.coreboot.org/5369
-gerrit
commit 58d88f70dd4636b9343b949e345a7e0bc18e7aa5
Author: Aaron Durbin <adurbin at chromium.org>
Date: Wed Mar 5 12:01:36 2014 -0600
cbfstool: move iself() to eflheaders.c
The only user of iself() was in elfheaders.c. Move it there,
and make it local to the compilation unit.
Change-Id: I0d919ce372f6e2fce75885fb4fcba20d985979b3
Signed-off-by: Aaron Durbin <adurbin at chromium.org>
---
util/cbfstool/common.c | 7 -------
util/cbfstool/common.h | 2 --
util/cbfstool/elfheaders.c | 7 +++++++
3 files changed, 7 insertions(+), 9 deletions(-)
diff --git a/util/cbfstool/common.c b/util/cbfstool/common.c
index 2fe0f01..b746c86 100644
--- a/util/cbfstool/common.c
+++ b/util/cbfstool/common.c
@@ -23,7 +23,6 @@
#include <stdlib.h>
#include <string.h>
#include <libgen.h>
-#include "elf.h"
#include "common.h"
#include "cbfs.h"
@@ -137,12 +136,6 @@ uint32_t string_to_arch(const char *arch_string)
return ret;
}
-int iself(unsigned char *input)
-{
- Elf32_Ehdr *ehdr = (Elf32_Ehdr *) input;
- return !memcmp(ehdr->e_ident, ELFMAG, 4);
-}
-
static struct filetypes_t {
uint32_t type;
const char *name;
diff --git a/util/cbfstool/common.h b/util/cbfstool/common.h
index 60ffb51..3cb94b6 100644
--- a/util/cbfstool/common.h
+++ b/util/cbfstool/common.h
@@ -109,8 +109,6 @@ uint32_t string_to_arch(const char *arch_string);
#define ALIGN(val, by) (((val) + (by)-1)&~((by)-1))
-int iself(unsigned char *input);
-
typedef void (*comp_func_ptr) (char *, int, char *, int *);
typedef enum { CBFS_COMPRESS_NONE = 0, CBFS_COMPRESS_LZMA = 1 } comp_algo;
diff --git a/util/cbfstool/elfheaders.c b/util/cbfstool/elfheaders.c
index 78c864f..f987747 100644
--- a/util/cbfstool/elfheaders.c
+++ b/util/cbfstool/elfheaders.c
@@ -121,6 +121,13 @@
* in the buffer struct.
*/
+
+static int iself(const void *input)
+{
+ const Elf32_Ehdr *ehdr = input;
+ return !memcmp(ehdr->e_ident, ELFMAG, 4);
+}
+
/* Get the ident array, so we can figure out
* endian-ness, word size, and in future other useful
* parameters
More information about the coreboot-gerrit
mailing list